PICTools Programmer's Reference
J2KT_UNION

J2KT_UNION: OP_J2KTRANSCODE

 
Copy Code
typedef struct {
   DWORD                Reserved0;
   BYTE PICHUGE*        Reserved1;
   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;
   DWORD                ImageWidth;
   DWORD                ImageHeight;
   DWORD                ImageXOff;
   DWORD                ImageYOff;
   DWORD                TileWidth;
   DWORD                TileHeight;
   DWORD                TileXOff;  
   DWORD                TileYOff;
   DWORD                NumComponents;
   DWORD                TileCompTransform;
   DWORD                DecompositionLevels;
   DWORD                JPEG2000FileFormat;
   DWORD                JPEG2000Profile;
   DWORD                TileCompFlags;
   DWORD                PrecinctWidth;
   DWORD                PrecinctHeight;
   DWORD                ProgressionOrder;
   DWORD                NumLayers;
   DWORD                DiscardLayers;
   THUMBNAIL            Thumbnail;
   DWORD                TileFlags;
   DWORD                Rate;
   DWORD                CompFileSize;
   double*              LayerRates;
} J2KT_UNION;

Fields:

Name Description

Reserved 0

Must be 0.

Reserved1

Reserved2

Reserved3

Reserved4

Reserved5

Reserved6

Reserved7

Reserved8

Must be NULL.

PICFlags

Value

Meaning

PF_ConvertGray

If this flag is set at REQ_EXEC and the input image comprises three components and u.J2KT.TileCompTransform returned by REQ_INIT is TCT_YCbCr, OP_J2KTRANSCODE will drop the chrominance components and the output will contain the gray (Y) component only.

PICFlags2

Value

Meaning

PF2_InsertTLMMarker

Insert TLM marker, adding J2K header data that is an array of all tile part lengths.

PF2_InsertPPMMarker

Insert PPM marker facilitating random-access to improve JPIP server stateless performance.

PF2_OmitPICMetaData

Set to suppress adding Accusoft informational metadata (UUID box) to the output JP2 image.

It is recommended that this flag not be set.

PF2_MMXDisable

Set to disable MMX and later optimizations.

PF2_P2AndP3OptDisable

Set to disable P2, P3 and later optimizations.

PF2_P3OptDisable

Set to disable P3 and later optimizations. If the CPU supports SSE instructions, but the O/S doesn't support SSE instructions, then you must set PF2_P3OptDisable or the CPU will fault.

PF2_P4OptDisable

Set to disable P4 and later optimizations. If the CPU supports SSE2 instructions, but the O/S doesn't support SSE2 instructions, then you must set PF2_P4OptDisable or the CPU will fault.

PF2_FavorSpeed

Use fastest coding mode for transcoding; files created using this flag will also decode faster. Note that when this flag is set, lossless encoded files may become slightly larger and lossy rate-controlled encoded files may decode to slightly lower quality.

ImageWidth

This field is extracted from the header of the input JPEG2000 image. It is the width of the actual image data on the JPEG2000 reference canvas. It is returned by REQ_INIT.

ImageHeight

This field is extracted from the header of the input JPEG2000 image. It is the height of the actual image data on the JPEG2000 reference canvas. It is returned by REQ_INIT.

ImageXOff

This field is extracted from the header of the input JPEG2000 image. It is the horizontal offset of the top-left-corner of the actual image data on the JPEG2000 reference canvas. It is returned by REQ_INIT.

ImageYOff

This field is extracted from the header of the input JPEG2000 image. It is the vertical offset of the top-left-corner of the actual image data on the JPEG2000 reference canvas. It is returned by REQ_INIT.

TileWidth

This field is extracted from the header of the input JPEG2000 image. It is the nominal width of image tiles on the JPEG2000 reference canvas. It is returned by REQ_INIT.

TileHeight

This field is extracted from the header of the input JPEG2000 image. It is the nominal height of image tiles on the JPEG2000 reference canvas. It is returned by REQ_INIT.

TileXOff

This field is extracted from the header of the input JPEG2000 image. It is the horizontal offset of the top-left-corner tile on the JPEG2000 reference canvas. It is returned by REQ_INIT.

TileYOff

This field is extracted from the header of the input JPEG2000 image. It is the vertical offset of the top-left-corner tile on the JPEG2000 reference canvas. It is returned by REQ_INIT.

NumComponents

This field is the number of components extracted from the header of the input JPEG2000 image. It is returned by REQ_INIT.

TileCompTransform

This field reports the multiple component transformation extracted from the header of the input JPEG2000 image. It is returned by REQ_INIT.

Value

Meaning

TCT_None

No color transform

TCT_YCbCr

Uses the YCbCr transform

0

Other/Not relevant

DecompositionLevels

This field is the number of wavelet decomposition levels extracted from the header of the input JPEG2000 image. It is returned by REQ_INIT.

JPEG2000FileFormat

This field reports the JPEG2000 file format of the input JPEG2000 image. It is returned by REQ_INIT and input to REQ_EXEC. Leave unchanged or set to the desired output file format. JPX is not currently supported.

Value

Meaning

JPEG2000FileFormat_J2K

Input/Output is a JPEG2000 raw codestream image.

JPEG2000FileFormat_JP2

Input/Output is a JPEG2000 JP2 file format image.

JPEG2000FileFormat_JPX

Input is a JPEG2000 JPX file format image.

JPEG2000Profile

This field reports the JPEG2000 profile indicator extracted from the header of the input JPEG2000 image. It is returned by REQ_INIT and input to REQ_EXEC. Leave unchanged or set to the desired output file JPEG2000 profile indicator. Ordinarily, applications will not need to change this setting. See the JPEG2000 ISO standard for the details of these profiles. Part-2 is not currently supported.

Value

Meaning

JPEG2000Profile_None

No profile - no restrictions (Part-1)

JPEG2000Profile_0

Profile-0 - most restrictive (Part-1)

JPEG2000Profile_1

Profile-1 - some restrictions (Part-1)

JPEG2000Profile_2

Same as JPEG2000Profile_None

JPEG2000Profile_Part2_Full

Requires full capabilities of JPEG2000 Part-2

JPEG2000Profile_Part2_JPXBaseline

Conforms to JPEG2000 JPX baseline (Part-2)

TileCompFlags

This field reports the state of the EBCOT encoder selective coding bypass mode of the input JPEG2000 image. It is returned by REQ_INIT and input to REQ_EXEC. Leave unchanged or set to the desired mode for the output image.

Value

Meaning

TCF_Bypass

Use the EBCOT encoder selective coding bypass mode.

TCF_NoBypass

Do not use the EBCOT encoder selective coding bypass mode.

PrecinctWidth

PrecinctHeight

These fields report the precinct width and height of the input JPEG2000 image. They are returned by REQ_INIT and input to REQ_EXEC. Precinct width and height must each be equal to a power of 2 from 2 to 32768. Leave unchanged or set to the desired values for the output image.

ProgressionOrder

This field reports the prograssion order of data in the input JPEG2000 image. It is returned by REQ_INIT and input to REQ_EXEC. Leave unchanged or set to the desired value for the output image.

Value Meaning

PO_LRCP

Layer-Resolution level-Component-Position progression, this is a recommended choice for OP_JPIPSERVER.

PO_RLCP

Resolution level-Layer-Component-Position progression, this is a recommended choice for OP_JPIPSERVER.

PO_RPCL

Resolution level-Position-Component-Layer progression, this is the best choice for OP_TIDP2.

PO_PCRL

Position-Component-Resolution level-Layer progression.

PO_CPRL

Component-Position-Resolution level-Layer progression.

NumLayers

This field reports the number of quality layers in the input JPEG2000 image. It is returned by REQ_INIT and input to REQ_EXEC. Leave unchanged or set to the desired number of layers for the output image. Leave unchanged if DiscardLayers is set to a nonzero value. Upon return from REQ_EXEC, this field will contain the number of layers that OP_J2KTRANSCODE tried to create.

DiscardLayers

Set this field at REQ_EXEC to the number of layers in the JPEG2000 image to discard before any further transcoder processing. The layers that remain after the requested number are discardeded will appear in the output image. Cannot be used with NumLayers, Rate, CompFileSize, or LayerRates. Set to zero to do nothing.

Thumbnail

Set this field at REQ_EXEC to the power of 2 by which to scale down the image size. The uppermost resolution levels are discarded and the image dimensions are reduced to match the reduced size. Set to zero to do nothing.

TileFlags

Set this field at REQ_EXEC to control certain other tile-specific JPEG options for inserting PLT markers for random access and dividing tiles into tile parts for random access or for better progressive display. One or more of these flags may be set simultaneously. Set to zero to do nothing.

Value Meaning

TF_InsertPLTMarker

Insert PLT markers, packet lengths within a tile part.

TF_TilePartResolution

Start a new tile part at every resolution boundary.

TF_TilePartComponent

Start a new tile part at every component boundary.

TF_TilePartLayer

Start a new tile part at every layer boundary.

Rate

Set this field at REQ_EXEC to specify the desired degree of compression as a target value equal to the number of thousandths of a bit per pixel. For example, to request a rate of 0.15 bpp, set Rate to 150. In REQ_EXEC, OP_J2KTRANSCODE will use this value and the image dimensions to derive a target compressed file size and it will set CompFileSize to that calculated value. This field is ignored if CompFileSize is nonzero, in which case the value in CompFileSize will be used as the target. Cannot be used with DiscardLayers. Set to zero to not limt by rate.

CompFileSize

Set this field at REQ_EXEC to specify the desired degree of compression as a target compressed file size in bytes. This field takes precedence over the value in Rate. Cannot be used with DiscardLayers. Set to zero to not limit by size and to instruct OP_J2KTRANSCODE to use the value in Rate. If, as a result of values set for Rate or LayerRates, OP_J2KTRANSCODE had to compute or modify CompFileSize, then this field will contain that new value upon return from REQ_EXEC.

LayerRates

Set this field at REQ_EXEC to an array of values specifying the cumulative target size in bytes for each quality layer, according to NumLayers, of the output image. The array must contain a nonzero value for each layer (in order from coarsest to finest) for which a target size is being specified and must contain a terminating 0 as the last entry. The number of nonzero values may be less than the number of layers in the output image, in which case the remaining layers are assigned sizes by the opcode. If the target overall size as specified by Rate or CompFileSize is less than the last size in the LayerRates array, then the target overall size will be increased by OP_J2KTRANSCODE to that last layer size. If there are more values in the LayerRates array than layers, the extraneous values are ignored. Cannot be used with DiscardLayers. Set to NULL to not specify individual layer rates.

 

 


©2022. Accusoft Corporation. All Rights Reserved.

Send Feedback