#include <djv_iw44decoder.h>
|
virtual bool | decode (Stream *inStream)=0 |
|
virtual bool | decode (const Chunk *inChunk)=0 |
|
virtual bool | isNextIW44Data (Stream *inStream) const =0 |
|
virtual bool | isNextIW44Data (const Chunk *inChunk) const =0 |
|
virtual bool | isReadyToRender () const =0 |
|
virtual size_t | getNumDecodedChunks () const =0 |
|
virtual size_t | getWidth () const =0 |
|
virtual size_t | getHeight () const =0 |
|
virtual bool | isColorImage () const =0 |
|
virtual void | render (u8 *outImagePtr, ssize_t inRowStride, Photometric inImagePm, size_t inSubsample=1, const Rect *inSubRect=NULL) const =0 |
|
virtual void | render (u8 *outImagePtr, ssize_t inRowStride, Photometric inImagePm, const Rect &inRect, size_t inRescaledWidth=0, size_t inRescaledHeight=0, Rotation inRotation=rot0, bool inUseFastScaling=false) const =0 |
|
virtual void | setProgressiveDecoding (bool inProgressive)=0 |
|
virtual bool | addChunk (const Chunk *inChunk)=0 |
|
virtual size_t | decodeProgressively (size_t inNumSlices)=0 |
|
virtual bool | isDecodeCompleted () const =0 |
|
| Referable () |
|
void | addRef () const |
|
void | releaseRef () const |
|
size_t | getReferenceCount () const |
|
This class decompresses color or grayscale images with the IW44 wavelet transformation and ZPCoder.
typedef SliceCallbackResult(* Celartem::DjVu::IW44Decoder::SliceCallback)(IW44Decoder *inIW44Decoder, size_t inChunkIndex, size_t inSlicesInChunk, size_t inBytesInChunk, void *inContext) |
Definition for the callback function which is called after decoding each slice.
The main purpose of the callback are to decide the end of decoding processes. You can optionally call render methods in this function to get the decoding image (which is not yet completely loaded).
Be sure that if you quit decoding in middle of a chunk, slices and chunks follows that chunk are simply discarded and you cannot restart the decoding from that point.
- Parameters
-
inIW44Decoder | The instance of IW44Decoder. |
inChunkIndex | The index of the current chunk beeing decoded.
The index of the first chunk is 0. |
inSlicesInChunk | The number of slices already decoded in the current chunk.
At the first call to this function, this is 1. |
inBytesInChunk | The size of the data already decoded in the current chunk. |
inContext | Pointer to user defined context data. |
- Returns
- One of the SliceCallbackResult enumeration which decides whether decode process will continue or not.
This enumeration is used for the return values of SliceCallback callback functions.
Enumerator |
---|
continueDecoding |
Continue decoding until the end of the chunk.
|
quitDecoding |
Quit decoding processes.
|
virtual bool Celartem::DjVu::IW44Decoder::addChunk |
( |
const Chunk * |
inChunk | ) |
|
|
pure virtual |
Add the chunk.
You must feed the chunk in the decoded (IFF chunk) order.
To decode the chunk, you need to call or .
- Parameters
-
inChunk | The chunk which contains **44 data. |
- Returns
- Return true if the chunk is next to last added chunk otherwise false.
Create a new IW44Decoder instance that decodes the image from encoded data by IW44 encoders.
- Parameters
-
inSliceCallback | The pointer to a callback function which will be called right after decoding each slice. |
inSliceCallbackContext | The pointer to a user defined context data. It is given to the callback specified as inSliceCallback. |
- Returns
- Pointer to the newly created IW44Decoder instance.
virtual bool Celartem::DjVu::IW44Decoder::decode |
( |
Stream * |
inStream | ) |
|
|
pure virtual |
Decode the image from the stream.
You must feed the stream in the decoded order.
This method is for advanced purpose and you had better use decode(const Chunk*) in normal case.
Unlike other classes, this method is intended to be called repeatedly during decoding a IW44 encoded image.
- Parameters
-
inStream | The stream to read from. |
- Returns
- Return false when a SliceCallback callback function is specified and it returns quitDecoding. After that, you cannot call decode to gain more quality for the resulting image.
virtual bool Celartem::DjVu::IW44Decoder::decode |
( |
const Chunk * |
inChunk | ) |
|
|
pure virtual |
Decode the image in the chunk.
You must feed the chunk in the decoded (IFF chunk) order.
Unlike other classes, this method is intended to be called repeatedly during decoding a IW44 encoded image.
- Parameters
-
inChunk | The chunk which contains **44 data. |
- Returns
- Return false when a SliceCallback callback function is specified and it returns quitDecoding. After that, you cannot call decode to gain more quality for the resulting image.
virtual size_t Celartem::DjVu::IW44Decoder::decodeProgressively |
( |
size_t |
inNumSlices | ) |
|
|
pure virtual |
Decode IW44 chunk partially. This method may decode series of chunks at a time.
- Parameters
-
inNumSlices | The number of slices to be decoded on this call.
It can be larger than the actual number of slices in the series of chunks; ultimately, set it to SIZE_MAX to decode all the slices of available chunks at once. |
- Returns
- The number of total slices decoded so far.
virtual size_t Celartem::DjVu::IW44Decoder::getHeight |
( |
| ) |
const |
|
pure virtual |
Get the height of the resulting image.
Untill isReadyToRender returns true the result of this method is not valid.
- Returns
- The height of the image in pixels.
virtual size_t Celartem::DjVu::IW44Decoder::getNumDecodedChunks |
( |
| ) |
const |
|
pure virtual |
Get the number of IW44 chunks already decoded.
This is not the "number of slices" but the number of "chunks", which is actually same to the number of calls to decode methods.
- Returns
- The number of decoded chunks.
virtual size_t Celartem::DjVu::IW44Decoder::getWidth |
( |
| ) |
const |
|
pure virtual |
Get the width of the resulting image.
Untill isReadyToRender returns true, the result of this method is not valid.
- Returns
- The width of the image in pixels.
virtual bool Celartem::DjVu::IW44Decoder::isColorImage |
( |
| ) |
const |
|
pure virtual |
Determine whether the resulting image is color or grayscale.
Untill isReadyToRender returns true the result of this method is not valid.
- Returns
true
if the image is color, otherwise false
.
virtual bool Celartem::DjVu::IW44Decoder::isDecodeCompleted |
( |
| ) |
const |
|
pure virtual |
Determine whether or not the decoder decoded all of the chunks added by addChunk method.
- Returns
true
if all the chunks are completely decoded; otherwise false
.
virtual bool Celartem::DjVu::IW44Decoder::isNextIW44Data |
( |
Stream * |
inStream | ) |
const |
|
pure virtual |
Determine whether the specified stream contains the next IW44 data, which should be processed by decode method.
- Parameters
-
inStream | The stream to read from. |
- Returns
- Return
true
if the stream contains the next data.
virtual bool Celartem::DjVu::IW44Decoder::isNextIW44Data |
( |
const Chunk * |
inChunk | ) |
const |
|
pure virtual |
Determine whether the specified chunk contains the next IW44 data, which should be processed by decode method.
- Parameters
-
inChunk | The chunk which contains **44 data. |
- Returns
- Return
true
if the chunk contains the next data.
virtual bool Celartem::DjVu::IW44Decoder::isReadyToRender |
( |
| ) |
const |
|
pure virtual |
Determine whether the encoder instance is ready to render image.
This method returns true
after the first call of decode method or even in the first time of SliceCallback callback function is called. Otherwise this method return false
.
virtual void Celartem::DjVu::IW44Decoder::render |
( |
u8 * |
outImagePtr, |
|
|
ssize_t |
inRowStride, |
|
|
Photometric |
inImagePm, |
|
|
size_t |
inSubsample = 1 , |
|
|
const Rect * |
inSubRect = NULL |
|
) |
| const |
|
pure virtual |
Render the resulting image onto the specified buffer. You may get incomplete rendered result if some of **44
chunks are not loaded.
- Parameters
-
outImagePtr | The pointer to the first line of the buffer. |
inRowStride | The row-stride for the image on the buffer. |
inImagePm | The photometric of destination image. You can specify any of the Photometric enumeration values even if it does not match to the one of the original image. |
inSubsample | The subsampling ratio. It must be one of the values between 1 to 32. The default is 1, which means the original scale. |
inSubRect | The pointer to the Rect instance that indicates the portion to be extracted in pixels of the subsampled image. If it is NULL , this method returns whole the image. |
virtual void Celartem::DjVu::IW44Decoder::render |
( |
u8 * |
outImagePtr, |
|
|
ssize_t |
inRowStride, |
|
|
Photometric |
inImagePm, |
|
|
const Rect & |
inRect, |
|
|
size_t |
inRescaledWidth = 0 , |
|
|
size_t |
inRescaledHeight = 0 , |
|
|
Rotation |
inRotation = rot0 , |
|
|
bool |
inUseFastScaling = false |
|
) |
| const |
|
pure virtual |
Render the resulting image onto the specified buffer. You may get incomplete rendered result if some of **44
chunks are not loaded.
- Parameters
-
outImagePtr | The pointer to the first line of the buffer. |
inRowStride | The row-stride for the image on the buffer. |
inImagePm | The photometric of destination image. You can specify any of the Photometric enumeration values even if it does not match to the one of the original image. |
inRect | Rectangle to draw in the rescaled image coordination. |
inRescaledWidth | The virtual width of the rescaled page image.
This method renders page image as if it had this width. If 0 is specified, the rendered image is same size to the original page size. |
inRescaledHeight | The virtual height of the rescaled page image.
This method renders page image as if it had this height. If 0 is specified, the rendered image is same size to the original page size. |
inRotation | The rotation of the image. |
inUseFastScaling | Determine whether to use faster scaling or not.
The default is not to use faster scaling. |
virtual void Celartem::DjVu::IW44Decoder::setProgressiveDecoding |
( |
bool |
inProgressive | ) |
|
|
pure virtual |
Enable/disable progressive decoding mode.
- Parameters
-
inProgressive | Whether or not to decode IW44 chunks in progressive mode. |
The documentation for this class was generated from the following file: