PICTools Programmer's Reference
TRANS2P

TRANS2P: OP_S2P

The TRANS2P structure contains the parameters for the OP_S2P opcode used for lossless conversion of a sequential JPEG image to a progressive JPEG image.

 
Copy Code
typedef struct {
   DWORD                      Reserved0;
   SCAN_PARM PICHUGE*         ScanParms;
   BYTE PICHUGE*              Reserved2;
   BYTE PICHUGE*              Reserved3;
   BYTE PICHUGE*              Reserved4;
   BYTE PICHUGE*              Reserved5;
   BYTE PICHUGE*              Reserved6;
   BYTE PICHUGE*              Reserved7;
   BYTE PICHUGE*              Reserved8;
   PICFLAGS                   PicFlags;
   PICFLAGS                   PicFlags2;
   LONG                       NumProgScans;
   LONG                       AppsToKeep;
} TRANS2P;

Fields:

Name Description

Reserved0

Reserved1

Reserved2

Reserved3

Reserved4

Reserved5

Reserved6

Reserved7

Reserved8

PicFlags

These fields are not currently used.

PicFlags2

Flags that control the TRANS2P operation.

Value

Meaning

PF2_UseAppsToKeep

Use the AppsToKeep field below to control APP marker preservation in the output image. Otherwise, use the default retention, which only preserved APP0, APP2, and APP14 markers.

NumProgScans

Number of progressive scans.

AppsToKeep

This field is only used if the PF2_UseAppsToKeep flag is set in the PicFlags2 field. The default behavior of the OP_S2P opcode is to remove any App data segments except for APP0, APP2, and APP14. If the PF2_UseAppsToKeep flag is set then the default behavior for this field is to remove all App data segments except APP0/JFIF and APP1/PIC markers.

If the PF2_UseAppsToKeep flag is ON, then when any of the bits 0 through 15 of the AppsToKeep field are ON the corresponding input image JPEG APP markers, APP0 through APP15, are preserved in the output progressive JPEG image.

If bit 16 is set, then any JFIF marker in the input image is not preserved in the output image.

If bit 17 is set, then any PIC marker in the input image is not preserved in the output image.

For example, if AppsToKeep = 0xC (1100 binary), this would mean to keep App2, App3, JFIF, and PIC data segments. If AppsToKeep = 0x3000C, this would mean to keep App2 and App3 data segments and remove any JFIF and PIC data segments. Either example will remove App0 segments that are not JFIF, and App1 segments that are not PIC.

 

 


©2022. Accusoft Corporation. All Rights Reserved.

Send Feedback