Operation Structures > DIB_INPUT |
DIB_INPUT: OP_D2J, OP_D2S, OP_D2SE, OP_D2SEPLUS
The DIB_INPUT structure contains the parameters for compressing a DIB to a sequential JPEG image using the OP_D2S group of opcodes. The possible input DIB formats include BI_RGB, BI_CMYK, BI_GR12, B_RGB555, BI_RGB565, BI_RGBA, BI_YUY2, BI_UYVY, BI_YV12, and BI_IYUV.
Copy Code | |
---|---|
typedef struct {
DWORD Reserved0;
BYTE PICHUGE* AppField;
BYTE PICHUGE* QTable;
SCAN_PARM PICHUGE* ScanParms;
BYTE PICHUGE * ExifThumbnail;
BYTE PICHUGE* Reserved5;
BYTE PICHUGE* Reserved6;
BYTE PICHUGE* Reserved7;
BYTE PICHUGE* Reserved8;
PICFLAGS PicFlags;
PICFLAGS PicFlags2;
LONG PrimClrToMake;
LONG SecClrToMake;
LONG LumFactor;
LONG ChromFactor;
SUBSAMPLING SubSampling;
JPEG_TYPE JpegType;
LONG AppFieldSize;
LONG AppFieldLen;
LONG NumOfPages;
LONG PageNum;
LONG Context;
LONG StripSize;
LONG WidthPad;
LONG NumProgScans;
LONG ExifAppsToKeep;
DWORD ExifThumbnailLen;
THUMBNAIL ExifThumbnailToMake
LONG AppsToOmit;
LONG RightShift12;
DWORD ResolutionUnit;
DWORD XResolution;
DWORD YResolution;
LONG Brightness;
LONG Contrast;
LONG ContrastOfs;
LONG RestartInterval;
DWORD Planar1Offset;
DWORD Planar2Offset;
} DIB_INPUT; |
Name | Description | ||||||||||||||||||||||||||
Reserved0 |
This field is not currently used and must be set to 0. | ||||||||||||||||||||||||||
AppField |
Points to a buffer to hold application binary data to be saved as APP2 marker code data in the JPEG image. | ||||||||||||||||||||||||||
QTable |
Points to two buffers of 64 bytes each to be used as the luminance and chrominance quantization tables during compression. If the application supplies these tables, then the LumFactor and ChromFactor fields are not used. If the application sets this field to 0, the operation uses default quantization tables as adjusted by LumFactor and ChromFactor. | ||||||||||||||||||||||||||
ScanParms |
This field is not used by the OP_D2S opcode and must be set to 0. | ||||||||||||||||||||||||||
ExifThumbnail |
Points to JFIF format thumbnail image for Exif output if desired. Error unless JpegType == JT_EXIF && ExifThumbnailoMake == THUMB_NONE. | ||||||||||||||||||||||||||
Reserved5 Reserved6 Reserved7 Reserved8 |
These fields are not currently used and must be set to 0. | ||||||||||||||||||||||||||
PicFlags |
Flags that control the JPEG compression operation.
| ||||||||||||||||||||||||||
PicFlags2 |
| ||||||||||||||||||||||||||
PrimClrToMake |
Specifies the number of colors to be made for an optimum primary palette [0 or 2..256]. If 0 is specified, then 236 primary colors are made and 16 secondary colors are made. This field is ignored unless the PF_MakeColors flag is set in PicFlags. | ||||||||||||||||||||||||||
SecClrToMake |
Specifies the desired number of colors to be made for an optimum secondary palette [0 or 2..16]. This field is ignored unless the PF_MakeColors flag is set in PicFlags and unless PrimClrToMake is not 0. Otherwise, if 0 is specified, then no secondary colors are made. | ||||||||||||||||||||||||||
LumFactor |
If QTable is NULL, specifies the desired luminance compression factor [0..255]. The luminance compression factor is used to adjust the default luminance quantization table values. When LumFactor is 32, the default luminance quantization table values are used as is. When LumFactor and ChromFactor are 0, the quality is highest and the compression ratio is virtually non-existent. When LumFactor and ChromFactor are 255, the quality is lowest and the compression ratio is highest. | ||||||||||||||||||||||||||
ChromFactor |
If QTable is NULL, specifies the desired chrominance compression factor [0..255]. The chrominance compression factor is used to adjust the default chrominance quantization table values. When ChromFactor is 32, the default chrominance quantization table values are used as is. When LumFactor and ChromFactor are 0, the quality is highest and the compression ratio is virtually non-existent. When LumFactor and ChromFactor are 255, the quality is lowest and the compression ratio is highest. | ||||||||||||||||||||||||||
SubSampling |
Specifies the desired sub-sampling. This field, together with Compactor and LumFactor, controls the compression ratio and the compressed image quality. Note that, in all cases, Y is not sub-sampled.
| ||||||||||||||||||||||||||
JpegType |
Specifies the desired type of JPEG file to create.
| ||||||||||||||||||||||||||
AppFieldSize |
This field is not used by the OP_D2S opcode and must be set to 0. | ||||||||||||||||||||||||||
AppFieldLen |
Specifies the length, in bytes, of the data in the buffer pointed to by the AppField field and which is to be saved as APP2 marker code data in the JPEG image. | ||||||||||||||||||||||||||
NumOfPages PageNum Context |
These fields are not used by the OP_D2S opcode and must be set to 0. | ||||||||||||||||||||||||||
StripSize |
Specifies the minimum buffer size needed to hold one strip of input data. This field is output by Pegasus. Each JPEG strip is 8 or 16 image lines. The operation acts on the input data one strip at a time, so at least one complete strip of input data should be added to the Get queue at a time, except at the end of the image. Thus, this is also the minimum buffer size for the Get queue. If larger and using Q_REVERSE, the Get queue buffer size must be an integer multiple of StripSize. | ||||||||||||||||||||||||||
WidthPad |
Specifies the width of an uncompressed DIB pixel line in bytes. WidthPad takes into account the number of bits needed to represent a pixel and any padding that may be required at the end of each line. WidthPad will be output by Pegasus unless the PF_WidthPadKnown flag is set in PicFlags. If PF_WidthPadKnown is set, then WidthPad must be input by the application. In that case, the operation will compress Head.biWidth bits and will then use WidthPad to advance to the next pixel line. This allows the application to easily compress a rectangle within the DIB which is aligned on the left edge of a DIB. An arbitrary rectangle within the DIB can be compressed with some additional complexity. | ||||||||||||||||||||||||||
NumProgScans |
This field is not used by the OP_D2S opcode and must be set to 0. | ||||||||||||||||||||||||||
ExifAppsToKeep |
Bit level control of the application markers to keep when saving as Exif JPEG. Bit 0 on keeps JFIF App0, Bit 1 on keeps PIC App1 marker (not recommended). | ||||||||||||||||||||||||||
ExifThumbnailLen |
Used to insert an application provided thumbnail image into an Exif file's thumbnail field. It contains the length of the JFIF thumbnail data pointed to by ExifThumbnail. JpegType must = JT_EXIF and ExifThumbnailToMake must = THUMB_NONE. | ||||||||||||||||||||||||||
ExifThumbnailToMake |
To force D2S opcodes to make an Exif Thumbnail from the compressed data, ExifThumbnailToMake must not = THUMB_NONE and JpegType must = JT_EXIF and ExifThumbnailLen must = 0. This forces the use of OP_S2D and OP_D2S to create the thumbnail. | ||||||||||||||||||||||||||
AppsToOmit |
This controls which JFIF application markers are omitted from the output image. Bit 0 on causes the omission of the JFIF App0 marker, Bit 1 on omits the PIC App1 marker. | ||||||||||||||||||||||||||
RightShift12 |
Only used for compressing 2 byte per pixel grayscale data to 12 bit JPEG format. This is how much the data needs to be right-shifted so that the high 4 bits of the word are guaranteed to be 0. It can take values from 0 through 4. For example if the data were left-justified in the word, this parameter would be set to 4. | ||||||||||||||||||||||||||
ResolutionUnit |
ResolutionUnit is 0 if XResolution/YResolution specifies aspect ratio, otherwise 1 is inches and 2 is centimeters. | ||||||||||||||||||||||||||
XResolution |
Horizontal pixels / resolution unit or numerator of aspect ratio. | ||||||||||||||||||||||||||
YResolution |
Vertical pixels / resolution unit or denominator of aspect ratio. | ||||||||||||||||||||||||||
Brightness Contrast ContrastOfs |
Specifies the amount to increase or decrease a YUY2 or UYVY input image's brightness, contrast and contrast offset (as specified below) during compression. Acceptable values are from -4095 to 4095. A value of 0 means the image is not changed for that parameter. The adjusted pixel luminance (Lout) is related to the unadjusted pixel luminance (Lin) as:
for 8-bit intensity samples (0-255). For 12-bit intensity samples, Brightness and ContrastOfs aren't divided by 16. The output Lout values are clamped to an 8-bit or 12-bit range as appropriate. If you graph this equation with Lin as the horizontal axis and Lout as the vertical axis, changes to Contrast without changing Brightness or ContrastOfs have the effect of rotating the graphed line around the point (ContrastOfs, Brightness). Brightness raises (+) or lowers(-) the graphed line without rotating it. ContrastOfs shifts the graphed line right (+) or left (-) without rotating it. | ||||||||||||||||||||||||||
RestartInterval |
If 0, then no JPEG restart markers are output with the compressed data. Otherwise, RestartInterval specifies the number of MCUs (minimum coded units) to appear between restart markers. For SubSampling SS_111, each MCU is 8x8 pixels. For SS_211, each MCU is 16x8 pixels. For SS_211v, each MCU is 8x16 pixels. For SS_411, each MCU is 16x16 pixels. Each image MCU row is horizontally-padded to an MCU boundary if needed. For example, to output a restart marker every 16 lines for an image whose SubSampling is SS_211, set RestartInterval to:
Set to 0 if 'simple' compression from planar YUV. Otherwise (defining 'not simple') these describe a compressed image that will have de-interlaced lines from the input image or a subrectangle of the input is being compressed. For planar YUV the Get queue must hold the entire image. If Q_Reverse is not set: if Get.Front is offset N samples from the actual start of the entire image Y plane, set Planar1Offset to <size Y plane> +N/2 where <size Y plane> is <width> * <height> for the <width> and <height> of the entire image. Set Planar2Offset to Planar1Offset + <size Y plane>/4. Thus Planar1/2Offset are the offsets from Get.Front of the U or V samples corresponding to the Y sample pointed to by Get.Front. Else Error if Q_Reverse is set. |