Public Member Functions | Static Public Member Functions | List of all members
Celartem::DjVu::Renderer Class Referenceabstract

#include <djv_renderer.h>

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

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, size_t inForeX=0, size_t inForeY=0, bool inUseFastRescaling=false) const =0
 
virtual String getChunkId () const =0
 
virtual ReferablegetInternalRenderer () const =0
 
virtual ~Renderer ()
 
- Public Member Functions inherited from Celartem::Referable
 Referable ()
 
void addRef () const
 
void releaseRef () const
 
size_t getReferenceCount () const
 

Static Public Member Functions

static AutoPtr< Renderercreate (const Chunk *inChunk, const Dictionary *inDictionary)
 
- Static Public Member Functions inherited from Celartem::Referable
static void dumpDbgAllRefCount ()
 

Detailed Description

Renderer class provides the general interface to render images.

Constructor & Destructor Documentation

virtual Celartem::DjVu::Renderer::~Renderer ( )
inlinevirtual

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

Referenced by Celartem::DjVu::ImageRenderer::render().

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.

Referenced by Celartem::DjVu::ImageRenderer::render().

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,
size_t  inForeX = 0,
size_t  inForeY = 0,
bool  inUseFastRescaling = false 
) const
pure virtual

Renders a portion of the mask.

Parameters
ioImagePtrPointer 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.
inRowStrideThe row-stride of the image.
inPmThe photometric of the image.
inRectRectangle to draw in the rescaled image coordination.
inRescaledWidthThe 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.
inRescaledHeightThe 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.
inForegroundOptional 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.
inForeRowStrideThe 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.
inForeWidthThe full 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.
inForeHeightThe full 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.
inForeXThe left position, where the foreground rendering starts. The mask pixel X corresponds to the foreground pixel (X + inForeX) * inForeWidth / inRescaledWidth.
inForeYThe top position, where the foreground rendering starts. The mask pixel Y corresponds to the foreground pixel (Y + inForeY) * inForeHeight / inRescaledHeight.
inUseFastRescalingDetermine 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:

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