Public Types | Public Member Functions | Public Attributes | List of all members
Celartem::DjVu::JB2Encoder::Params Struct Reference

#include <djv_jb2encoder.h>

Public Types

enum  { SHAPE_REFINEMENT_THRESHOLD_DEFAULT = 60, SHAPE_MATCH_THRESHOLD_DEFAULT = 12 }
 
enum  NoiseReductionMethod { , nrRemoveIsolated, nrInflate, nrDeflate, nrReserved }
 
enum  Flags {
  fl_ShapeExtractionOnlyByMask = 1, fl_DivideLargeShapes = 2, fl_ShapeErosionForPalette = 4, fl_UseRegionDetection = 8,
  fl_JBIG2CompatSort = 16
}
 

Public Member Functions

 Params ()
 

Public Attributes

size_t shapeRefinementThreshold
 JB2 shape refinement threshold in 0-100 (60). More...
 
size_t shapeMatchThreshold
 JB2 shape match threshold in 0-100. More...
 
size_t centerDiffThreshold
 JB2 shape pivot skew threshold in 0-4. More...
 
size_t maxPalettes
 Maximum number of palettes on Color-JB2. More...
 
bool sortShapes
 Determine whether to sort the shapes before compression. More...
 
NoiseReductionMethod noiseRuductionMethod
 
RegionRecognitionParams regionRecognition
 
size_t pageShapeCountThreshold
 
u32 flags
 

Detailed Description

This struct contains parameters to configure the JB2 encoder settings.

Member Enumeration Documentation

anonymous enum
Enumerator
SHAPE_REFINEMENT_THRESHOLD_DEFAULT 

Default for refinement threshold.

SHAPE_MATCH_THRESHOLD_DEFAULT 

Default for match threshold.

Flags to control JB2 encoder behavior.

Enumerator
fl_ShapeExtractionOnlyByMask 

Extraction process should use only mask data even when encoding Color JB2.

fl_DivideLargeShapes 

Extraction process should divide large shapes.

fl_ShapeErosionForPalette 

Use shape erosion for palette generation.

fl_UseRegionDetection 

Use advanced region detection.

fl_JBIG2CompatSort 

Sort shapes in JBIG2 compatible order.

Noise reduction method for mask layer.

Enumerator
nrRemoveIsolated 

Remove any completely isolated pixels.

nrInflate 

If any pixels on neighbour, set pixel.

nrDeflate 

If any empty pixels on neighbour, remove pixel.

nrReserved 

Reserved for internal use.

Constructor & Destructor Documentation

Celartem::DjVu::JB2Encoder::Params::Params ( )
inline

Initializes a new JB2Param structure.

Member Data Documentation

size_t Celartem::DjVu::JB2Encoder::Params::centerDiffThreshold

JB2 shape pivot skew threshold in 0-4.

This parameter controls the shape stem matching behavior. The default value is 1. to shapeMatchThreshold.

u32 Celartem::DjVu::JB2Encoder::Params::flags

Combination of Flags flags to control JB2 encoder behavior.

size_t Celartem::DjVu::JB2Encoder::Params::maxPalettes

Maximum number of palettes on Color-JB2.

The default is 256.

NoiseReductionMethod Celartem::DjVu::JB2Encoder::Params::noiseRuductionMethod

Noise reduction method for mask layer.
For Agressive or Lossy, if nrNone is selected, noise reduction is anyway enabled and nrRemoveIsolated is used.

size_t Celartem::DjVu::JB2Encoder::Params::pageShapeCountThreshold

If the number of shapes in a page is over than the threshold, JB2Encoder gives up encoding and throws errOperationAbandoned.
If 0 is specified, the threshold is disabled.
The default value is 0 (disabled).

RegionRecognitionParams Celartem::DjVu::JB2Encoder::Params::regionRecognition

Additional parameters for region detection to improve bitonal mask quality. The parameters are used only if fl_UseRegionDetection is set to the flags.

size_t Celartem::DjVu::JB2Encoder::Params::shapeMatchThreshold

JB2 shape match threshold in 0-100.

This parameter controls the shape match behavior.
The threshold is based on the pixel area. The default is 12. If the original shape has N pixels, it accepts the shapes of the pixel difference less than N * shapeMatchThreshold / 100. So if shapeMatchThreshold=0, it accepts only identical matches.

See Also
shapeRefinementThreshold
size_t Celartem::DjVu::JB2Encoder::Params::shapeRefinementThreshold

JB2 shape refinement threshold in 0-100 (60).

The default is 60. Unlike Match Threshold, this affects only on the compression ratio. If the two shapes, like "e" and "c", are quite similar, "e" can be created from "c" by adding "-" to "c".
The refinement process keeps only the difference information between the shapes rather than the full shape information. On the refinement process, the difference may get large if the two shapes are too much different, so in that case, the shape should not be refined and the shape information should be stored as the full shape information.
Refine threshold controls the acceptable amount of the difference by the refinement process. It should be chosen carefully so that it can determine whether a shape should be stored as the differencial information or the full information.

See Also
shapeMatchThreshold
bool Celartem::DjVu::JB2Encoder::Params::sortShapes

Determine whether to sort the shapes before compression.

The default is false.


The documentation for this struct was generated from the following file:

Cuminas DjVu SDK 3.0.33103
This document is made with doxygen 1.8.5 at Sun Dec 15 2013 19:38:07.
Cuminas Logo