Operations > OP_MDCA2D |
OP_MDCA2D: Convert a MO:DCA File to a DIB
The purpose of OP_MDCA2D is to convert Mixed Object Document Content Architecture (MO:DCA) files to DIBs. The MO:DCA standard includes many different objects but this opcode only supports Image Object Content Architecture (IOCA) and Presentation Text Object Content Architecture (PTOCA) objects. This opcode also supports the conversion of CALS1, IOCA, and C4 images not in MO:DCA files to DIBs.
The overall processing flow for this opcode is as follows:
Various items will be returned in PicParm.PIC2List depending on the type of file being processed. For MO:DCA files all of the MO:DCA Structured Fields will be returned as P2PktModca packets. If you are processing an IOCA image not in a MO:DCA file then the IOCA Self Defined Fields will be returned as P2PktIoca packets. If you are processing a CALS1 file then the CALS1 headers will be returned as P2PktCals packets. If you are processing a C4 file, the Hollerith header field, if present, will be returned as a P2PktComment packet. See PIC2List Functions for more information.
This opcode uses platform specific routines that are not available on Windows 95/98/ME. |
A MO:DCA file can contain multiple pages, however, only a single page can be rendered to a DIB at one time. The ImageNumber field is used to select the desired page. It defaults to the first page in the file.
The dimensions of the output DIB default to PageWidth and PageHeight according to the values from the input file, but can be re-sized after REQ_INIT before REQ_EXEC by specifying OutHeight and OutWidth, or OutXRes, OutYRes and OutResUnits. Otherwise these values are set according to the input file. If the file contains an IOCA object and any of these Out parameters require that the IOCA object be rendered at a different size than the actual IOCA object width and height, the opcode will internally call OP_ZOOM2. This can occur even when the Out* values aren't changed from their default values depending on the specifications of the input file. The user should provide a P2PktRegistration packet with OP_ZOOM2 registration codes in PicParm.PIC2List to avoid the OP_ZOOM2 registration message. See the PIC2List Functions section for more information.
The bit depth of the output DIB can be specified by setting OutBpp. The default is 1bpp for files containing no PTOCA objects and 8bpp for files containing PTOCA objects. Allowable values are 1 and 8 bpp.
The output DIB can be cropped to a specified sub-rectangle by setting F_InputCrop in PicParm.Flags and setting PicParm.IOCropXoff, PicParm.IOCropYoff, PicParm.IOCropWidth, and PicParm.IOCropHeight to describe the sub-rectangle. PicParm.IOCropXoff and PicParm.IOCropYoff are offsets within the image dimensions specified with the OutHeight/OutWidth or OutXRes/OutYRes fields.
Set MODCA.PicFlags |= PF_NoDibPad to avoid any padding of output lines otherwise output lines are padded to a multiple of 4 bytes.
To set a particular width for the output lines set PF_WidthPadKnown in PicFlags, and set WidthPad to the desired width in bytes.
If the Put queue is smaller than the full output image size, then rendering will take longer if the page includes any PTOCA objects, and also if F_UseDeferFn is specified for the non-coroutine mode API plus the page includes an IOCA object that requires OP_ZOOM2 to be rendered to the specified size. Under those conditions, the image rendering is banded into the Put queue such that there are N bands (N = <Output Image size> / <Put size>), then the image is rendered N * (N + 1 ) / 2 times - i.e., proportional to the number of bands squared.
If the Put queue size changes between calls to REQ_INIT and REQ_EXEC the opcode could internally render the same line multiple times for PTOCA objects causing performance to suffer. Especially if the size of the Put queue during REQ_EXEC is smaller than during REQ_INIT or if the Put queue size is larger during REQ_EXEC but not a multiple of the Put queue size during REQ_INIT.
An output DIB from a CALS1 or IOCA file will be 1bpp and cannot be resized from the original image dimensions nor image resolution.
The output DIB can be cropped to a specified sub-rectangle by setting F_InputCrop in PicParm.Flags and setting PicParm.IOCropXoff, PicParm.IOCropYoff, PicParm.IOCropWidth, and PicParm.IOCropHeight to describe the sub-rectangle. PicParm.IOCropXoff and PicParm.IOCropYoff are offsets within the image dimensions.
Set MODCA.PicFlags |= PF_NoDibPad to avoid any padding of output lines otherwise output lines are padded to a multiple of 4 bytes.
To set a particular width for the output lines set PF_WidthPadKnown in PicFlags, and set WidthPad to the desired width in bytes.
An output DIB from a C4 file will be 1bpp and cannot be resized from the original image dimensions nor image resolution.
The output DIB can be cropped to a specified sub-rectangle by setting F_InputCrop in PicParm.Flags and setting PicParm.IOCropXoff, PicParm.IOCropYoff, PicParm.IOCropWidth, and PicParm.IOCropHeight to describe the sub-rectangle. PicParm.IOCropXoff and PicParm.IOCropYoff are offsets within the image dimensions.
Set MODCA.PicFlags |= PF_NoDibPad to avoid any padding of output lines otherwise output lines are padded to a multiple of 4 bytes.
To set a particular width for the output lines set PF_WidthPadKnown in PicFlags, and set WidthPad to the desired width in bytes.
If the file contains an embedded preview image, the opcode will return from REQ_INIT with the PF2_HasThumbnail flag set. To render the embedded preview, set MODCA.PicFlags |= PF_ExpandThumbnail.