Main Page | Modules | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

#define phIMAGE_SIZE_IN_BYTES s,
w,
h,
 ) 
 

Value:

{                                                       \
    if (f & (phImageRGB24 | phImageBGR24 | phImageHSV24|\
             phImageSCT24 ))                            \
    {                                                   \
        s = w * h * 3;                                  \
    }                                                   \
    else if (f & (phImageRGBA32 | phImageABGR32 |       \
                  phImageBGRA32))                       \
    {                                                   \
        s = w * h * 4;                                  \
    }                                                   \
    else if (f & phImageGREY8)                          \
    {                                                   \
        s = w * h * 1;                                  \
    }                                                   \
    else if (f & phImageYUV9)                           \
    {                                                   \
        s = (w * h) + (2 * ((w * h) / 16));             \
    }                                                   \
    else                                                \
    {                                                   \
        /*phPRINT_RC(-1,NULL,"Invalid image format [0x%08x].",f);*/ \
        s = 0;                                          \
    }                                                   \
}
This calculates the number of bytes for an image of a given width, height and format. The value is stored in s when it's computed. This macro is useful in many cases including figuring out what the ZLib decompressed size of a piece of memory will be given the format flag with the Zlib special bit set.

Parameters:
[out] s The size of the memory that can store an image of w x h of format f.
[in] w The width of the image.
[in] h The height of the image.
[in] f The format of the image.

Definition at line 568 of file ImageDefinitions.h.





Copyright (C) 2002 - 2007 Philip D.S. Thoren ( pthoren@users.sourceforge.net )
University Of Massachusetts at Lowell
Robotics Lab
SourceForge.net Logo

Generated on Sat Jun 16 02:45:27 2007 for phission by  doxygen 1.4.4