Celartem::DjVu::DjVuEncoder Class Reference

#include <djv_djvuencoder.h>

Inheritance diagram for Celartem::DjVu::DjVuEncoder:

Inheritance graph
[legend]

List of all members.

Public Types

enum  DictionaryType { dtNoSharedDict = 0, dtUseSharedDict = 1 }
enum  EncodeMode {
  emFG44 = 0, emColorJB2 = 1, emPicture = 2, emBitonal = 3,
  emAuto = 4, emFG44ColorJB2 = 5
}
enum  EncodeFlags { efNoMaskDilation = 1 }

Public Member Functions

virtual AutoPtr< ChunkencodePage (const u8 *CEL_RESTRICT inImagePtr, ssize_t inImageRowStride, Photometric inImagePm, size_t inWidth, size_t inHeight, size_t inDPI, const Params *inParams=NULL, const u8 *CEL_RESTRICT inMaskPtr=NULL, ssize_t inMaskRowStride=0, MaskType inMaskType=mtUnpacked)=0
virtual void writeOutDictionary ()=0

Static Public Member Functions

static AutoPtr< DjVuEncodercreate (DictionaryType inUseDictionary=dtUseSharedDict, size_t inAutoDictFlushFreq=20, const Params *inParams=NULL)
static AutoPtr< DjVuEncodercreate (const ParamsEx &inParams)
static AutoPtr< DjVuEncodercreate (const Profile *inProfile)

Classes

struct  Params
struct  ParamsEx


Detailed Description

DjVuEncoder encodes DjVu files.

Definition at line 29 of file djv_djvuencoder.h.


Member Enumeration Documentation

enum Celartem::DjVu::DjVuEncoder::DictionaryType

This enumeration is used to determine whether DjVuEncoder uses shared dictionary or not.

Enumerator:
dtNoSharedDict  Never use shared dictionary.
dtUseSharedDict  Use shared dictionary.

Definition at line 36 of file djv_djvuencoder.h.

enum Celartem::DjVu::DjVuEncoder::EncodeMode

This enumeration is used to determine what kind of encoding is used to encode the page.

Enumerator:
emFG44  FG44; IW44 variant optimized for Foreground compression.
emColorJB2  Color JB2; JB2 mask with palette.
emPicture  BG44; IW44 variant optimized for picture compression. (No image separation).
emBitonal  Black and White JB2; No color is preserved.
emAuto  Automatic mode.
emFG44ColorJB2  Emit both FG44 and FGbz; the application should remove one of them.

Definition at line 46 of file djv_djvuencoder.h.

enum Celartem::DjVu::DjVuEncoder::EncodeFlags

This enumeration is used to specify additional conditions.

Enumerator:
efNoMaskDilation  Never to dilate mask for background subsampling.

Definition at line 63 of file djv_djvuencoder.h.


Member Function Documentation

static AutoPtr<DjVuEncoder> Celartem::DjVu::DjVuEncoder::create ( DictionaryType  inUseDictionary = dtUseSharedDict,
size_t  inAutoDictFlushFreq = 20,
const Params inParams = NULL 
) [static]

Initialize a new DjVuEncoder instance.

Parameters:
inUseDictionary Determines whether it uses shared dictionary or not. This should be one of DictionaryType enumeration values. If this value is dtNoSharedDict, inAutoDictFlushFreq is ignored.
The default is dtUseSharedDict.
inAutoDictFlushFreq Determines how many pages share a dictionary; in other words, this is the frequency of the flushing the dictionary.
DjVuEncoder instance automatically flushes the dictionary if the number of pages specified by inAutoDictFlushFreq is encoded.
If 0 is specified, the automatic flush feature is disabled and you should call writeOutDictionary manually.
Even with inAutoDictFlushFreq value not equal to 0, you can manually call writeOutDictionary and then the dictionary is flushed immediately regardless of inAutoDictFlushFreq value.
inParams Parameters for page encoding. This can be NULL and then the default parameters are used.
The parameters can be overwritten lately by explict parameter to each encodePage call.
Returns:
Pointer to the newly created DjVuEncoder instance.

Referenced by create().

static AutoPtr<DjVuEncoder> Celartem::DjVu::DjVuEncoder::create ( const ParamsEx inParams  )  [inline, static]

Initialize a new DjVuEncoder instance.

Parameters:
inParams Parameters for page encoding.
The parameters can be overwritten lately by explict parameter to each encodePage call.
Returns:
Pointer to the newly created DjVuEncoder instance.

Definition at line 351 of file djv_djvuencoder.h.

static AutoPtr<DjVuEncoder> Celartem::DjVu::DjVuEncoder::create ( const Profile inProfile  )  [static]

Initialize a new DjVuEncoder instance.

Parameters:
inProfile Pointer to a Profile instance with which DjVuEncoder instance will be initialized.
Returns:
Pointer to the newly created DjVuEncoder instance.

virtual AutoPtr<Chunk> Celartem::DjVu::DjVuEncoder::encodePage ( const u8 *CEL_RESTRICT  inImagePtr,
ssize_t  inImageRowStride,
Photometric  inImagePm,
size_t  inWidth,
size_t  inHeight,
size_t  inDPI,
const Params inParams = NULL,
const u8 *CEL_RESTRICT  inMaskPtr = NULL,
ssize_t  inMaskRowStride = 0,
MaskType  inMaskType = mtUnpacked 
) [pure virtual]

Encode a page.
This function accepts an image and its separation mask.

Parameters:
inImagePtr Pointer to the first line of the input image.
inRowStride The row-stride of the image specified by inImagePtr.
It can be negative if the image is bottom-up.
inImagePm The photometric (type) of the image. It should be one of Photometric.
inWidth The width of the image.
inHeight The height of the image.
inDPI The resolution of the image in [pixel/inch].
inParams [Advanced Users Only]
Optional parameters which configures the DjVu encoder settings. With this option, you can configure the quality and the size of encoded result. For more information, see Params.
inMaskPtr [Optional] Pointer to the first line of the mask image.
In this mask, 0 means the foreground and 1 (0xff for unpacked case) does the background.
inMaskRowStride [Optional] The row-stride of the image specified by inMaskPtr.
It can be negative if the mask is bottom-up.
It is ignored if inMaskPtr is NULL.
inMaskType [Optional] The type of the mask. This should be one of MaskType enumeration.
It is ignored if inMaskPtr is NULL.
Returns:
Pointer to the Chunk which contains the encoded image.

virtual void Celartem::DjVu::DjVuEncoder::writeOutDictionary (  )  [pure virtual]

Flushes the dictionary.
You should call this function when you want to flush and write out the dictionary.
If no shared dictionary, this method do actually nothing.


The documentation for this class was generated from the following file:
This document is automatically generated using doxygen 1.5.4 at Fri Jun 27 18:23:27 2008.