Public Member Functions | List of all members
Celartem::DjVu::DjVuEncoder::Helper Class Referenceabstract

#include <djv_djvuencoder.h>

Public Member Functions

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...
 

Detailed Description

Definitions for encoder helper functions.
You can derive this class to create your own Helper class.

Member Function Documentation

virtual void Celartem::DjVu::DjVuEncoder::Helper::finalizeSession ( Chunk inDJVM,
size_t  inFirstIndex,
size_t  inCount 
)
pure virtual

finalizeSession function

This function is called on DjVuEncoder::finalizeSession call.
Please note that several DjVuEncoder::finalizeSession calls are invoked implicitly during DjVuEncoder::addPage call if auto-dictionary-refresh is configured.
Any modifications to inDJVM can be acceptable on this call.

Parameters
inDJVMPointer to the DJVM (document-level) chunk.
inFirstIndexIndex to the first page, which is just finalized on the DjVuEncoder::finalizeSession call.
inCountNumber of pages, which are just finalized on the DjVuEncoder::finalizeSession call.
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
inDjVuChunkPointer 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
ioMaskPtrPointer 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.
inMaskRowStrideThe row-stride of the mask.
inMaskTypeThe type of the mask. This should be one of MaskType enumeration.
inWidthThe width of the mask and the input image.
inHeightThe 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
outMaskPtrPointer to a buffer on which this function writes the mask image.
inMaskRowStrideThe row-stride of the mask.
inMaskTypeThe type of the mask. This should be one of MaskType enumeration.
inWidthThe width of the mask and the input image.
inHeightThe height of the mask and the input image.
inImagePtrPointer to the first line of the input image.
inRowStrideThe row-stride of the image.
inImagePmThe 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:

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