[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Openexr-devel] Writing an image upside down & negative yStride
From: |
Ger Hobbelt |
Subject: |
Re: [Openexr-devel] Writing an image upside down & negative yStride |
Date: |
Tue, 17 Mar 2009 03:03:23 +0100 |
On Mon, Mar 16, 2009 at 10:04 PM, Werner Benger <address@hidden> wrote:
> Hereby I encountered the problem that the type of the yStride variable in
> Imf::Slice is of type size_t, which is unsigned. As a consequence, the
[...]
> A simple cure is to add a type conversion from the size_t value to an
> integer (sizeof(size_t)=8, sizeof(int)=4 on this platform, thereby assuming
[...]
> + (y - yOffset) *
> (int)slice.yStride +
Most platforms offer the 'ssize_t' (a signed size_t, note the extra
's') for this kind of issue. Though MSVC does not define this type,
but it can be done in the portability layer anyhow by
typedef __int64 ssize_t; /* MSVC 'long' is 32 bit, even for IA64 or
AMD64 targets; size_t is an __uint64 there! */
Don't know a smarter/better way to write EXR images upside down, alas.
--
Met vriendelijke groeten / Best regards,
Ger Hobbelt
--------------------------------------------------
web: http://www.hobbelt.com/
http://www.hebbut.net/
mail: address@hidden
mobile: +31-6-11 120 978
--------------------------------------------------