REGION2
|
Copy Code |
typedef struct {
BYTE Sig;
REGION_FLAGS Flags;
PIXEL_TYPE PixType;
BYTE Bpp;
DWORD Width;
DWORD Height;
DWORD Stride;
} REGION2; |
The REGION2 structure defines the contents of an image partition. This structure is used to reference general-purpose image regions. The structure is a replacement for the REGION structure to allow for Width/Height/Stride larger than 65535. Read the opcode description to determine if an opcode supports REGION2. If supported, and the opcode supports both REGION2 and REGION, set ParmVerMinor to at least 4 to use REGION2 instead of REGION. Then use the accessor macros Region2() and Region2Ptr() defined in PIC2.H as, for example:
Region2(pp.u.Region).Stride =
Region2(pp.u.Region).Width *
( ( Region2(pp.u.Region).Bpp + 7 ) / 8 );
or
Region2Ptr(&pp.u.Region)->Stride =
Region2Ptr(&pp.u.Region)->Width *
( ( Region2Ptr(&pp.u.Region)->Bpp + 7 ) / 8 );
Fields:
Name |
Description |
Sig |
Must be 2. |
Flags |
Attributes of the region.
Value |
Meaning |
RF_TopDown |
Set if image stored top line first, bottom last |
RF_NonInter |
(unused for now) Set if image is non-interleaved |
RF_MakeGray |
Set if region to be treated as gray scale |
RF_SwapRB |
Set to treat input component samples as interleaved in RGB order instead of interleaved in BGR order (Windows DIBs are in BGR order) |
RF_WhiteIsZero |
Set for a bilevel (1bpp) image to indicate that 0 samples are white instead of the default of 0 samples being black. |
RF_2Byte |
Set for <= 8 Bpp images if each sample occupies two bytes |
RF_Signed |
Set if sample values are to be interpreted as signed values |
RF_BigEndian |
Set when sample values occupy two bytes and the bytes are arranged in big-endian (Motorola) order instead of little-endian (Intel) order |
RF_CM2RGB |
Set if a color-mapped image is to be converted to a 3-component RGB image |
RF_Channel |
Set if a single color channel is to be used |
RF_ChLo |
If RF_Channel is set, ChHi is two bits whose value 0..3 indicate which color channel |
RF_ChHi |
If RF_Channel is set, ChLo is two bits whose value 0..3 indicate which color channel |
RF_Packed |
Not implemented | |
PixType |
Type of pixels which comprise this region
Value |
Meaning |
PT_NONE |
Undefined or compressed pixels |
PT_CM |
Color mapped up to 256 colors |
PT_GRAY |
Gray scale up to 16 bits |
PT_GRAYM |
Gray scale up to 16 bits (big-endian) |
PT_RGB |
RGB 24, 48 bit (blue is low, red is high, Intel-ordered) |
PT_RGBM |
RGB 48 bit (blue is low, Motorola-ordered) |
PT_RGB555 |
RGB 16 bit (xrrrrrgggggbbbbb - blue is low bits) |
PT_RGB565 |
RGB 16 bit (rrrrrggggggbbbbb - blue is low bits) |
PT_CMYK |
CMYK 32 bit (cyan is low, black is high) |
PT_GRAYA |
Gray scale 1-16 bits with alpha, Intel-ordered |
PT_GRAYAM |
Gray scale 9-16 bits with alpha, Motorola-ordered |
PT_RGBA |
RGBA 32, 64 bit (blue is low, alpha is high, Intel-ordered) |
PT_RGBAM |
RGBA 64 bit (blue is low, alpha is high, Motorola-ordered) |
PT_RGB101010 |
RGB 32-bit (xxrrrrrrrrrrggggggggggbbbbbbbbbb) - blue is low bits) |
PT_RGBE |
The Radiance .HDR format floating point with an R, then G, then B mantissa followed by a shared exponent. |
PT_CMYKA |
PT_CMYK followed by an alpha channel |
PT_GRAY_MSFIXED |
Gray scale in 16-bit or 32-bit Microsoft fixed-point format |
PT_GRAY_FLOAT |
Gray scale in 16-bit (HALF) or 32-bit (single-precision IEEE) floating point format |
PT_RGB_MSFIXED |
PT_RGB in 16-bit or 32-bit Microsoft fixed-point format |
PT_RGB_FLOAT |
PT_RGB in 16-bit (HALF) or 32-bit (single-precision IEEE) floating point format |
PT_RGBA_MSFIXED |
PT_RGBA in 16-bit or 32-bit Microsoft fixed-point format |
PT_RGBA_FLOAT |
PT_RGBA in 16-bit (HALF) or 32-bit (single-precision IEEE) floating point format | |
Bpp |
Meaningful bits per pixel |
Width |
Width of region in pixels |
Height |
Height of region in pixels |
Stride |
Width in bytes of area containing the region. This value is at least ( Width * Bpp + 7 ) / 8. The stride may be larger than these values if the region is contained within a larger region or if each line is padded (e.g., to a DWORD boundary for Windows bitmaps). |