FILEJBIG2OPTIONS

typedef struct tagFILEJBIG2OPTIONS
{
   L_UINT uStructSize;
   L_UCHAR ucImageTemplateType;
   L_CHAR ImageGBATX1;
   L_CHAR ImageGBATY1;
   L_CHAR ImageGBATX2;
   L_CHAR ImageGBATY2;
   L_CHAR ImageGBATX3;
   L_CHAR ImageGBATY3;
   L_CHAR ImageGBATX4;
   L_CHAR ImageGBATY4;
   L_UINT uImageQFactor;
   L_UINT32 uImageFlags;
   L_UCHAR ucTextTemplateType;
   L_CHAR TextGBATX1;
   L_CHAR TextGBATY1;
   L_CHAR TextGBATX2;
   L_CHAR TextGBATY2;
   L_CHAR TextGBATX3;
   L_CHAR TextGBATY3;
   L_CHAR TextGBATX4;
   L_CHAR TextGBATY4;
   L_UINT uTextMinSymArea;
   L_UINT uTextMinSymWidth;
   L_UINT uTextMinSymHeight;
   L_UINT uTextMaxSymArea;
   L_UINT uTextMaxSymWidth;
   L_UINT uTextMaxSymHeight;
   L_UINT uTextDifThreshold;
   L_UINT uTextQFactor;
   L_UINT uTextFlags;
   L_UINT uXResolution;
   L_UINT uYResolution;
   L_UINT uFlags;
}FILEJBIG2OPTIONS,L_FAR * pFILEJBIG2OPTIONS;

The FILEJBIG2OPTIONS structure provides information for saving JBIG2 files.

Member

Description

uStructSize

Size of this structure in bytes, for versioning. Use the sizeof() macro to calculate this value.

ucImageTemplateType

Value that specifies which template-based arithmetic encoder to use when encoding a non-text area. Possible values are:

 

Value

Meaning

Template

 

0

Three lines with a 16-pixel template.

image\Template0.gif

 

1

Three lines with a 13-pixel template.

image\Template1.gif

 

2

Three lines with a 10-pixel template.

image\Template2.gif

 

3

Two lines with a 10-pixel template.

image\Template3.gif

ImageGBATX1

The X location of the adaptive template pixel A1 for a non-text area encoding. Possible values range from -128 to 127 except when the value of the member ImageGBATY1 is zero, in which case it ranges from –128 to –1.

ImageGBATY1

The Y location of the adaptive template pixel A1 for a non-text area encoding. Possible values range from -128 to 0.

ImageGBATX2

The X location of the adaptive template pixel A2 for a non-text area encoding. Possible values range from -128 to 127, except when the value of the member ImageGBATY2 is zero, in which case it ranges from –128 to –1.

ImageGBATY2

The Y location of the adaptive template pixel A2 for a non-text area encoding. Possible values range from -128 to 0.

ImageGBATX3

The X location of the adaptive template pixel A3 for a non-text area encoding. Possible values range from -128 to 127, except when the values of the member ImageGBATY3 is zero, in which case it ranges from –128 to -1.

ImageGBATY3

The Y location of the adaptive template pixel A3 for a non-text area encoding. Possible values range from -128 to 0.

ImageGBATX4

The X location of the adaptive template pixel A4 for a non-text area encoding. Possible values range from -128 to 127, except when the value of the member ImageGBATY4 is zero, in which case it ranges from –128 to -1.

ImageGBATY4

The Y location of the adaptive template pixel A4 for a non-text area encoding. Possible values range from -128 to 0.

uImageQFactor

Value that represents the degree of loss in the compression process for a non-text area. The value of 0 means lossless while any other value means lossy.

0 is the default value.

 

uImageFlags

Flag that indicates whether to use typical prediction (TP) when encoding a non-text area. Possible values are:

 

Value

Meaning

 

JBIG2_IMAGE_TPON

[0x0010] Use typical prediction (TP).

 

ucTextTemplateType

Value that specifies which template-based arithmetic encoder to use when encoding a text area. Possible values are:

 

Value

Meaning

Template

 

0

Three lines with a 16-pixel template.

image\Template0.gif

 

1

Three lines with a 13-pixel template.

image\Template1.gif

 

2

Three lines with a 10-pixel template.

image\Template2.gif

 

3

Two lines with a 10-pixel template.

image\Template3.gif

TextGBATX1

The X location of the adaptive template pixel A1 for a text area encoding. Possible values range from -128 to 127 except when the value of the member TextGBATY1 is zero, in which case it ranges from –128 to –1.

TextGBATY1

The Y location of the adaptive template pixel A1 for a text area encoding. Possible values range from -128 to 0.

TextGBATX2

The X location of the adaptive template pixel A2 for a text area encoding. Possible values range from -128 to 127, except when the value of the member TextGBATY2 is zero, in which case it ranges from –128 to –1.

TextGBATY2

The Y location of the adaptive template pixel A2 for a text area encoding. Possible values range from -128 to 0.

TextGBATX3

The X location of the adaptive template pixel A3 for a text area encoding. Possible values range from -128 to 127 except when the value of the member TextGBATY3 is zero, in which case it ranges from –128 to -1.

TextGBATY3

The Y location of the adaptive template pixel A3 for a text area encoding. Possible values range from -128 to 0.

TextGBATX4

The X location of the adaptive template pixel A4 for a text area encoding. Possible values range from -128 to 127 except when the value of the member TextGBATY4 is zero, in which case it ranges from –128 to -1.

TextGBATY4

The Y location of the adaptive template pixel A4 for a text area encoding. Possible values range from -128 to 0.

uTextMinSymArea

Value that represents the minimum text symbol area, in pixels.

uTextMinSymWidth

Value that represents the minimum text symbol width, in pixels.

uTextMinSymHeight

Value that represents the minimum text symbol height, in pixels.

uTextMaxSymArea

Value that represents the maximum text symbol area, in pixels.

uTextMaxSymWidth

Value that represents the maximum text symbol width, in pixels.

uTextMaxSymHeight

Value that represents the maximum text symbol height, in pixels.

uTextDifThreshold

Value that represents the maximum difference allowed to map a text symbol to a dictionary symbol, in percent.

uTextQFactor

Value that represents the degree of the loss in the compression process for a text area. The value of 0 means lossless while any other value means lossy.

0 is the default value.

 

uTextFlags

Flag that indicates whether to keep all dictionary symbols or remove unrepeated symbols from the dictionary. Possible values are:

 

Value

Meaning

 

JBIG2_TEXT_REMOVEUNREPEATEDSYM

[0x1000] Remove unrepeated symbols from the dictionary. When this flag is used those symbols in the dictionary which do not have any match in the bitmap are removed from the text dictionary to be encoded as non-text, resulting in a smaller file size.

 

JBIG2_TEXT_KEEPALLSYM

[0x2000] Keep all dictionary symbols.

uXResolution

The bitmap X resolution to be used when setting JBIG2 options.

uYResolution

The bitmap Y resolution to be used when setting JBIG2 options.

uFlags

Flags that indicate whether to remove unwanted JBIG2 segments and whether to use the dictionary for text symbols. You can use a bit-wise OR (|) to specify more than one flag. Possible values are:

 

Value

Meaning

 

Removing the unwanted JBIG2 segments:

 

JBIG2_REMOVE_MARKER

[0x0001] Remove the two bytes marker from the generic region segment data.

 

JBIG2_REMOVE_HEADER_SEGMENT

[0x0002] Remove the JBIG2 header.

 

JBIG2_REMOVE_EOP_SEGMENT

[0x0004] Remove the End Of Page segment.

 

JBIG2_REMOVE_EOF_SEGMENT

[0x0008] Remove the End Of File segment.

 

Using dictionary for text symbols:

 

JBIG2_ENABLE_DICTIONARY

[0x0100] Enable the encoder to use the text symbol dictionary.

Comments

pFILEJBIG2OPTIONS is a pointer to a FILEJBIG2OPTIONS structure. Where the function parameter type is pFILEJBIG2OPTIONS, declare a FILEJBIG2OPTIONS variable, update the structure's fields, and pass the variable's address in the parameter. Declaring a pFILEJBIG2OPTIONS variable is necessary only if the program requires a pointer.

The following functions make use of this structure:

LFileSettings::GetJBIG2Options

LFileSettings::SetJBIG2Options