Public Member Functions | Static Public Member Functions

Celartem::DjVu::Renderer Class Reference

#include <djv_renderer.h>

Inheritance diagram for Celartem::DjVu::Renderer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual bool addChunk (const Chunk *inChunk)=0
virtual size_t getWidth () const =0
virtual size_t getHeight () const =0
virtual Photometric getPhotometric () const =0
virtual size_t getBitsPerComponent () const =0
virtual size_t getDpi () const =0
virtual void render (u8 *ioImagePtr, ssize_t inRowStride, Photometric inPm, const Rect &inRect, size_t inRescaledWidth, size_t inRescaledHeight, const u8 *inForeground=NULL, ssize_t inForeRowStride=0, size_t inForeWidth=0, size_t inForeHeight=0, bool inUseFastRescaling=false) const =0
virtual String getChunkId () const =0
virtual ReferablegetInternalRenderer () const =0
virtual ~Renderer ()

Static Public Member Functions

static AutoPtr< Renderercreate (const Chunk *inChunk, const Dictionary *inDictionary)

Detailed Description

Renderer class provides the general interface to render images.


Constructor & Destructor Documentation

virtual Celartem::DjVu::Renderer::~Renderer (  )  [inline, virtual]

Destructor.


Member Function Documentation

virtual bool Celartem::DjVu::Renderer::addChunk ( const Chunk inChunk  )  [pure virtual]

Adds the chunk as its data.
This method firstly examines the chunk content by both its chunk Id and the actual content and if the chunk is acceptable, consumes the content and updates the internal state; otherwise if the content is not acceptable, that is, the content is not for the render or some invalid data, this method do nothing but returns immediately.

Parameters:
inChunk The chunk which contains data.
Returns:
true if the chunk is correctly consumed; otherwise false.
static AutoPtr<Renderer> Celartem::DjVu::Renderer::create ( const Chunk inChunk,
const Dictionary inDictionary 
) [static]

Creates a Renderer instance from the specified chunk.

Parameters:
inChunk A chunk which contains the first data of image. param inDictionary A Dictionary instance corresponding to the chunk if exists.
Returns:
A pointer to the newly created Renderer instance.
virtual size_t Celartem::DjVu::Renderer::getBitsPerComponent (  )  const [pure virtual]

Get bits-per-component on the original image file.

Returns:
The bits-per-component. If the original image is not homogeneous bits-per-component configuration, this method returns 0.
virtual String Celartem::DjVu::Renderer::getChunkId (  )  const [pure virtual]

Gets the identifier of the chunk which was used to instanciate this instance.

Returns:
The identifier of the chunk passed to create method.
virtual size_t Celartem::DjVu::Renderer::getDpi (  )  const [pure virtual]

Get dot-per-inch on the original image file.

Returns:
If the image source cannot obtain the resolution, this method should return 96.
virtual size_t Celartem::DjVu::Renderer::getHeight (  )  const [pure virtual]

Gets the original height of the image in pixels.

Returns:
The height in pixels.
virtual Referable* Celartem::DjVu::Renderer::getInternalRenderer (  )  const [pure virtual]

Obtains the internal renderer instance.

Returns:
Pointer to the internal renderer. You can use dynamic_cast against the pointer to obtain the actual instance.
virtual Photometric Celartem::DjVu::Renderer::getPhotometric (  )  const [pure virtual]

Get photometric-interpretation of the original image file.

Returns:
The photometric-interpretation of the original image.
virtual size_t Celartem::DjVu::Renderer::getWidth (  )  const [pure virtual]

Gets the original width of the image in pixels.

Returns:
The width in pixels.
virtual void Celartem::DjVu::Renderer::render ( u8 ioImagePtr,
ssize_t  inRowStride,
Photometric  inPm,
const Rect inRect,
size_t  inRescaledWidth,
size_t  inRescaledHeight,
const u8 inForeground = NULL,
ssize_t  inForeRowStride = 0,
size_t  inForeWidth = 0,
size_t  inForeHeight = 0,
bool  inUseFastRescaling = false 
) const [pure virtual]

Renders a portion of the mask.

Parameters:
ioImagePtr Pointer to a buffer which receives the rendered image.
If this call renders a mask, the buffer already has background image or filled with some color.
inRowStride The row-stride of the image.
inPm The photometric of the 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.
inForeground Optional pointer to the foreground image. If this is NULL, then all the foreground related parameters are ignored and then the mask is painted with its own palette.
This parameter is only used if the Renderer instance is used for a mask and there's a foreground to stencil.
inForeRowStride The row-stride of the foreground image.
This parameter is only used if the Renderer instance is used for a mask and there's a foreground to stencil.
inForeWidth The width of the foreground image.
This parameter is only used if the Renderer instance is used for a mask and there's a foreground to stencil.
inForeHeight The height of the foreground image.
This parameter is only used if the Renderer instance is used for a mask and there's a foreground to stencil.
inUseFastRescaling Determine whether to use fast rescaling algorithm or not.
The default is not to use fast rescaling algorithm.

Implemented in Celartem::DjVu::ImageRenderer.


The documentation for this class was generated from the following file:

This document is made with doxygen 1.7.1 at Thu Feb 17 2011 15:40:21.
Caminova Logo