PICTools Programmer's Reference
REGION

REGION

The REGION structure defines the contents of an image partition. This structure is used to reference general-purpose image regions.

 
Copy Code
typedef struct {
   BYTE                 Sig;
   BYTE                 Interlace;
   BYTE                 BitErr;
   REGION_FLAGS         Flags;
   PIXEL_TYPE           PixType;
   BYTE                 Bpp;
   WORD                 Width;
   WORD                 Height;
   SHORT                Stride;
   DWORD                Offset;
} REGION;

Fields:

Name Description

Sig

Must be 0.

Interlace

0 if not interlaced, 1 for PNG interface pattern, 2 for GIF interlace pattern. For PT_GRAY/PT_GRAYM JPEG 2000 images, bits 2-4 can hold the vertical subsampling factor minus one and bits 5-7 plus can hold the horizontal subsampling factor minus one.

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_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)

Bpp

Meaningful bits per pixel

Width

Width of region in pixels > 0

Height

Height of region in pixels > 0

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).

Offset

Offset in bytes of start of the region line whose offset has the smallest value. This is the offset of the top image line for a non-interlaced RF_TopDown image. It is the offset of the bottom image line for a non-interlaced image which is not RF_TopDown.

 

 


©2022. Accusoft Corporation. All Rights Reserved.

Send Feedback