Operation Structures > DIB_OUTPUT |
DIB_OUTPUT: OP_S2D, OP_SE2D, OP_SE2DPLUS, OP_P2D
The DIB_OUTPUT structure contains the parameters for expanding a sequential JPEG image to a DIB using the OP_S2D opcode.
Copy Code | |
---|---|
typedef struct {
DWORD Reserved0;
BYTE PICHUGE* AppField;
BYTE PICHUGE* MadeColorTable;
BYTE PICHUGE* PrecisionReq;
BYTE PICHUGE* ColorMap;
BYTE PICHUGE* ExifThumbnail;
BYTE PICHUGE* GrayMap12Bit;
BYTE PICHUGE* Reserved7;
BYTE PICHUGE* Reserved8;
PICFLAGS PicFlags;
PICFLAGS PicFlags2;
LONG DibSize;
THUMBNAIL Thumbnail;
LONG NumScansReq;
LONG NumScansDone;
LONG NumBytesDone;
LONG GraysToMake;
LONG PrimClrToMake;
LONG SecClrToMake;
LONG StripSize;
LONG WidthPad;
LONG LumFactor;
LONG ChromFactor;
SUBSAMPLING SubSampling;
JPEG_TYPE JpegType;
LONG AppFieldSize;
LONG AppFieldLen;
LONG NumOfPages;
LONG PageNum;
LONG Context;
LONG DitherType;
LONG YuvOutputType;
LONG ExifThumbnailLen;
DWORD ResolutionUnit;
DWORD XResolution;
DWORD YResolution;
LONG Brightness;
LONG Contrast;
LONG ContrastOfs;
DWORD EnhanceMethod;
DWORD Planar1Offset;
DWORD Planar2Offset;
} DIB_OUTPUT; |
Name | Description | ||||||||||||||||||||||||||||||||
Reserved0 |
This field is not currently used and must be set to 0. | ||||||||||||||||||||||||||||||||
AppField |
Points to a buffer to hold the application data stored with the image. This buffer is allocated and freed by the application. When expanding a JPEG image file, any APP2 data is stored into this buffer up to the size specified by AppFieldSize. If the buffer is too small, only AppFieldSize bytes are stored in the buffer. The size of the data stored is returned in the AppFieldLen field. | ||||||||||||||||||||||||||||||||
MadeColorTable |
Points to a buffer that will can hold the color table created for a color output image when PF_MakeColors is set in PicFlags. This buffer holds an array of RGBQUAD structures that define the primary and secondary colors for the output image. The buffer must be large enough to hold the total number of RGBQUAD colors as specified by PrimClrToMake and SecClrToMake. The MadeColorTable is only strictly necessary when both a primary and a secondary palette are desired and when the DibSize is 4. In that case, the secondary palette will be copied to ColorTable to display the DIB and the primary palette would be lost if not for MadeColorTable and if not copied in response to the RES_MADE_COLORS event. | ||||||||||||||||||||||||||||||||
PrecisionReq |
Not used by the OP_S2D opcode and must be set to 0. | ||||||||||||||||||||||||||||||||
ColorMap |
Not used by the OP_S2D opcode and must be set to 0. | ||||||||||||||||||||||||||||||||
ExifThumbnail |
Points to EXIF Thumbnail data to be used as source for decompression when PF_ExpandThumbnail switch is specified. | ||||||||||||||||||||||||||||||||
GrayMap12Bit |
(OP_SE2DPLUS) A translation table to be used to remap 12bpp grayscale data to 8bpp during decompression. | ||||||||||||||||||||||||||||||||
Reserved7 Reserved8 |
These fields are not currently used and must be set to 0. | ||||||||||||||||||||||||||||||||
PicFlags |
Flags that control the Pegasus operations.
| ||||||||||||||||||||||||||||||||
PicFlags2 |
| ||||||||||||||||||||||||||||||||
DibSize |
Specifies the size of the desired DIB in bits (4, 8, 16, 24 or 32). If DibSize is 0, then it is set by Pegasus to 24 if the input image is not gray scale or 8 if the input image is gray scale. If DibSize is 16, 24 or 32 and the input image is 8bpp gray scale or PF_ConvertGray is set in PicFlags, then Pegasus sets DibSize to 8. If DIBSize is 16 and input image is 12bpp gray scale, then 12 bpp gray is output within 16 bits. | ||||||||||||||||||||||||||||||||
Thumbnail |
Specifies the size of the thumbnail to create. This field can be one of the following values:
| ||||||||||||||||||||||||||||||||
NumScansReq NumScansDone NumBytesDone |
Not used by the OP_S2D opcode and must be set to 0. | ||||||||||||||||||||||||||||||||
GraysToMake |
When PF_ConvertGray is set in PicFlags or the input image is gray scale, then the output DIB will be gray scale. In that case, GraysToMake can be used to specify the number of gray levels (0 or 2..256) to create when converting the image to gray scale. A value of 0 defaults to 16 or 236 levels depending on DibSize. If the output DIB will be gray scale, and if PF_MakeColors is specified and GraysToMake is consistent with DibSize, then GraysToMake is honored by Pegasus. If the output DIB will be gray scale, and if PF_ConvertGray is not specified or the PIC_PARM Head.biClrUsed field is 0 (no input color/gray table is supplied), and if GraysToMake is consistent with DibSize, then GraysToMake is honored by Pegasus. | ||||||||||||||||||||||||||||||||
PrimClrToMake |
If PF_MakeColors is set In PicFlags, and PF_ConvertGray is not set and the input image is a color image, PrimClrToMake specifies the desired number of colors to make in the primary palette [0 or 2..256]. A value of 0 defaults to 236. | ||||||||||||||||||||||||||||||||
SecClrToMake |
if PF_MakeColors is set In PicFlags, and PF_ConvertGray is not set and PrimClrToMake is not 0 and the input image is a color image, SecClrToMake specifies the desired number of colors to make in the secondary palette [0 or 2..16]. A value of 0 defaults to 16. | ||||||||||||||||||||||||||||||||
StripSize |
Specifies the minimum buffer size needed to hold one strip of output 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 output data is to the Put queue at a time, except at the end of the image. Thus, this is also the minimum buffer size for the Put queue. If larger, and using Q_REVERSE, the Put 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 expand Head.biWidth bits and will then use WidthPad to advance to the next pixel line. This allows the application to easily expand to a rectangle within the DIB which is aligned on the left edge of a DIB. The application can expand to an arbitrary rectangle within the DIB with some additional complexity. This technique is also used to generate 'raw' image data that contains specific padding or, more frequently, no padding. | ||||||||||||||||||||||||||||||||
LumFactor |
If the JPEG image were created by a PICTools/AIMTools operation, then the LumFactor specified when the file was created is returned in this field. See the LumFactor description in the DIB_INPUT: OP_D2S section for additional information. | ||||||||||||||||||||||||||||||||
ChromFactor |
If the JPEG image were created by a PICTools/AIMTools operation, then the ChromFactor specified when the file was created is returned in this field. See the ChromFactor description in the DIB_INPUT: OP_D2S section for additional information. | ||||||||||||||||||||||||||||||||
SubSampling |
Specifies sub-sampling used to create the input image.
If any other value is returned for SubSampling, the returned value was computed by Pegasus as:
where H and V are the sub-sampling factors defined in the JPEG specification. | ||||||||||||||||||||||||||||||||
JpegType |
Specifies the type of JPEG file.
| ||||||||||||||||||||||||||||||||
AppFieldSize |
Specifies the size of the buffer pointed to by the AppField field. If the application sets this field to -1 and the image contains APP2 marker data, the Pegasus routine will return to the application with a RES_ALLOCATE_APP2_BUF response. At this time, AppFieldLen field will contain the length of the APP2 marker data in the image. The application can allocate a buffer, set AppField to point to the buffer, and continue Pegasus execution to retrieve all of the data associated with the APP2 marker. | ||||||||||||||||||||||||||||||||
AppFieldLen |
When the operation is complete, this field contains the length of APP2 marker data copied to the AppField buffer. When Pegasus returns with a RES_ALLOCATE_APP2_BUF response, this field has the length of the APP2 marker data in the image. The application can allocate a buffer, set AppField to point to the buffer, and continue Pegasus execution to retrieve the data associated with the APP2 marker. | ||||||||||||||||||||||||||||||||
NumOfPages PageNum Context |
These fields are not used by the OP_S2D opcode and must be set to 0. | ||||||||||||||||||||||||||||||||
DitherType |
Used if dithering. 0 = Floyd-Steinberg. (If != 1 on Solaris, it is a fast dither for colormapped output.) | ||||||||||||||||||||||||||||||||
YuvOutputType |
BI_UYVY, BI_YUY2, BI_YV12, or BI_IYUV. Ignored unless PF_YuvOutput is set. | ||||||||||||||||||||||||||||||||
ExifThumbnailLen |
Length of the buffer pointed to by ExifThumbnail when decompressing the thumbnail from an Exif image file. | ||||||||||||||||||||||||||||||||
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 the decompressed output image's brightness, contrast and contrast offset (as specified below) during decompression. 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 the appropriate output range. 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. | ||||||||||||||||||||||||||||||||
EnhanceMethod |
If PF_NoCrossBlockSmoothing is not set in PicFlags, then this field further specifies which of the Accusoft proprietary enhancement algorithms to apply when decompressing sequential JPEG images (opcodes OP_S2D and OP_SE2D). Either set this field to 0 to select Method 0 or set it to a value that is the bitwise 'OR' of the numeric values of the individual methods other than Method 0 to select those methods; any combination of methods may be chosen. When decompressing progressive JPEG images (opcode OP_P2D) this field is ignored and the default Method 0 is used.
| ||||||||||||||||||||||||||||||||
Planar1Offset Planar2Offset |
Set to 0 if 'simple' decompression to planar YUV. Otherwise (defining 'not simple') these mean the output image is re-interleaving lines or compositing the decompressed image into a larger image subrectangle. For planar YUV the Get queue must hold the entire image. If Q_Reverse is not set: if Put.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 Put.Front of the U or V samples corresponding to the Y sample pointed to by Put.Front. Else Error if Q_Reverse is set. |