#include <djv_djvuencoder.h>

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< Chunk > | 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)=0 |
| virtual void | writeOutDictionary ()=0 |
Static Public Member Functions | |
| static AutoPtr< DjVuEncoder > | create (DictionaryType inUseDictionary=dtUseSharedDict, size_t inAutoDictFlushFreq=20, const Params *inParams=NULL) |
| static AutoPtr< DjVuEncoder > | create (const ParamsEx &inParams) |
| static AutoPtr< DjVuEncoder > | create (const Profile *inProfile) |
Classes | |
| struct | Params |
| struct | ParamsEx |
Definition at line 29 of file djv_djvuencoder.h.
This enumeration is used to determine whether DjVuEncoder uses shared dictionary or not.
Definition at line 36 of file djv_djvuencoder.h.
This enumeration is used to determine what kind of encoding is used to encode the page.
| 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.
This enumeration is used to specify additional conditions.
Definition at line 63 of file djv_djvuencoder.h.
| static AutoPtr<DjVuEncoder> Celartem::DjVu::DjVuEncoder::create | ( | DictionaryType | inUseDictionary = dtUseSharedDict, |
|
| size_t | inAutoDictFlushFreq = 20, |
|||
| const Params * | inParams = NULL | |||
| ) | [static] |
Initialize a new DjVuEncoder instance.
| 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. |
Referenced by create().
| static AutoPtr<DjVuEncoder> Celartem::DjVu::DjVuEncoder::create | ( | const ParamsEx & | inParams | ) | [inline, static] |
Initialize a new DjVuEncoder instance.
| inParams | Parameters for page encoding. The parameters can be overwritten lately by explict parameter to each encodePage call. |
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.
| inProfile | Pointer to a Profile instance with which DjVuEncoder instance will be initialized. |
| 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.
| 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. |
| 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.