#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 |
This struct contains parameters to configure the JB2 encoder settings.
anonymous enum |
Flags to control JB2 encoder behavior.
|
inline |
Initializes a new JB2Param structure.
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.
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.
bool Celartem::DjVu::JB2Encoder::Params::sortShapes |
Determine whether to sort the shapes before compression.
The default is false
.