#include <djv_djvuencoder.h>
|
virtual void | newPage (const u8 *CEL_RESTRICT inImagePtr, ssize_t inImageRowStride, Photometric inImagePm, size_t inWidth, size_t inHeight, size_t inDPI, Params &ioParams, const u8 *CEL_RESTRICT inMask, ssize_t inMaskRowStride, MaskType inMaskType)=0 |
|
virtual bool | segment (u8 *outMaskPtr, ssize_t inMaskRowStride, MaskType inMaskType, size_t inWidth, size_t inHeight, const u8 *const inImagePtr, ssize_t inRowStride, Photometric inImagePm)=0 |
| Alternative segment function. More...
|
|
virtual void | postSegment (u8 *ioMaskPtr, ssize_t inMaskRowStride, MaskType inMaskType, size_t inWidth, size_t inHeight)=0 |
| post-segmentation function More...
|
|
virtual void | postArrangeChunks (Chunk *inDjVuChunk)=0 |
| post-page-processing function More...
|
|
virtual void | finalizeSession (Chunk *inDJVM, size_t inFirstIndex, size_t inCount)=0 |
| finalizeSession function More...
|
|
Definitions for encoder helper functions.
You can derive this class to create your own Helper class.
virtual void Celartem::DjVu::DjVuEncoder::Helper::finalizeSession |
( |
Chunk * |
inDJVM, |
|
|
size_t |
inFirstIndex, |
|
|
size_t |
inCount |
|
) |
| |
|
pure virtual |
virtual void Celartem::DjVu::DjVuEncoder::Helper::newPage |
( |
const u8 *CEL_RESTRICT |
inImagePtr, |
|
|
ssize_t |
inImageRowStride, |
|
|
Photometric |
inImagePm, |
|
|
size_t |
inWidth, |
|
|
size_t |
inHeight, |
|
|
size_t |
inDPI, |
|
|
Params & |
ioParams, |
|
|
const u8 *CEL_RESTRICT |
inMask, |
|
|
ssize_t |
inMaskRowStride, |
|
|
MaskType |
inMaskType |
|
) |
| |
|
pure virtual |
This function is called everytime DjVuEncoder::addPage method is called. For the parameters, see DjVuEncoder::addPage. Only the important difference to DjVuEncoder::addPage is that the Params instance passed is not by pointer but by reference. This means that the parameters are always valid on the call to this function and you can even modify the parameter on this function.
- See Also
- DjVuEncoder::addPage
virtual void Celartem::DjVu::DjVuEncoder::Helper::postArrangeChunks |
( |
Chunk * |
inDjVuChunk | ) |
|
|
pure virtual |
post-page-processing function
This function is called after DJVU
chunk generation.
- Parameters
-
inDjVuChunk | Pointer to the Chunk instance, which contains the DJVU chunk. Some chunks such as Sjbz or INCL for Djbz are not finalized so the contents of such chunks may be meaning-less on the call to this method but you can append/insert chunks to inDjVuChunk. |
virtual void Celartem::DjVu::DjVuEncoder::Helper::postSegment |
( |
u8 * |
ioMaskPtr, |
|
|
ssize_t |
inMaskRowStride, |
|
|
MaskType |
inMaskType, |
|
|
size_t |
inWidth, |
|
|
size_t |
inHeight |
|
) |
| |
|
pure virtual |
post-segmentation function
This function is called after segmentation.
This function can modify the segmentation result or using the segmentation result for another purpose such as OCR.
- Parameters
-
ioMaskPtr | Pointer to the mask.
Please note that if inMask is explicity specified for DjVuEncoder::addPage call, this pointer actually points the buffer specified by the pointer (inMask) even though it's actually not a non-const pointer; be carefull for such non-writable cases. |
inMaskRowStride | The row-stride of the mask. |
inMaskType | The type of the mask. This should be one of MaskType enumeration. |
inWidth | The width of the mask and the input image. |
inHeight | The height of the mask and the input image. |
- See Also
- segment
virtual bool Celartem::DjVu::DjVuEncoder::Helper::segment |
( |
u8 * |
outMaskPtr, |
|
|
ssize_t |
inMaskRowStride, |
|
|
MaskType |
inMaskType, |
|
|
size_t |
inWidth, |
|
|
size_t |
inHeight, |
|
|
const u8 *const |
inImagePtr, |
|
|
ssize_t |
inRowStride, |
|
|
Photometric |
inImagePm |
|
) |
| |
|
pure virtual |
Alternative segment function.
This function creates a mask which separates the specified image into two layers (foreground and background).
On the mask, the pixel with 0 means that the pixel should be moved to foreground and 1 does that the pixel should be moved to background.
- Parameters
-
outMaskPtr | Pointer to a buffer on which this function writes the mask image. |
inMaskRowStride | The row-stride of the mask. |
inMaskType | The type of the mask. This should be one of MaskType enumeration. |
inWidth | The width of the mask and the input image. |
inHeight | The height of the mask and the input image. |
inImagePtr | Pointer to the first line of the input image. |
inRowStride | The row-stride of the image. |
inImagePm | The photometric (type) of the image. It should be one of Photometric. |
- Returns
- If this function gives up segmentation of the image, return
false
; otherwise return true
.
The documentation for this class was generated from the following file: