Public Types | Static Public Member Functions

Celartem::DjVu::RendererHelper Class Reference

#include <djv_renderer.h>

List of all members.

Public Types

enum  ChunkType {
  citUnknown = 0, citDictionary = 1, citMask = 2, citForeground = 3,
  citBackground = 4
}
enum  RenderingLayer { rlMask = 0, rlForeground = 1, rlBackground = 2 }
typedef AutoPtr< Renderer >(* RendererFactoryFunc )(const Chunk *inChunk, const Dictionary *inDictionary)
typedef AutoPtr< Dictionary >(* DictionaryFactoryFunc )(const Chunk *inChunk)

Static Public Member Functions

static ChunkType determineChunkType (const String &inChunkId)
static String getCorrespondingDictionaryId (const String &inChunkId)
static void registerRendererFactory (RendererFactoryFunc inRendererFactoryFunc, RenderingLayer inRenderingLayer, const String &inPrimaryId, DictionaryFactoryFunc inDictionaryFactoryFunc=NULL, const String &inDictId=NullString, const String *inChunkIDs=NULL, size_t inCountChunkIDs=0)

Detailed Description

This class provides helper methods for Renderer instanciation.


Member Typedef Documentation

Dictionary factory function definition.
A dictionary factory function is a function which instanciates an instance of Dictionary from the specified chunk.

Parameters:
inChunk The chunk which contains data.
typedef AutoPtr<Renderer>(* Celartem::DjVu::RendererHelper::RendererFactoryFunc)(const Chunk *inChunk, const Dictionary *inDictionary)

Renderer factory function definition.
A renderer factory function is a function which instanciates an instance of Renderer from the specified chunk.

Parameters:
inChunk The chunk which contains data.
inDictionary Optional data which contains some data which is shared between pages; some renderer never uses dictionary so this may be NULL.

Member Enumeration Documentation

This enumeration is used to describe the types of a chunk.

Enumerator:
citUnknown 

Unknown.

citDictionary 

Dictionary.

citMask 

Image data for mask.

citForeground 

Image data for foreground.

citBackground 

Image data for background.

This enumeration is used to specify a layer which a renderer renders.

Enumerator:
rlMask 

Mask Layer.

rlForeground 

Foreground Layer.

rlBackground 

Background Layer.


Member Function Documentation

static ChunkType Celartem::DjVu::RendererHelper::determineChunkType ( const String inChunkId  )  [static]

Determines the type of a chunk.

Parameters:
inChunkId A chunk identifier.
Returns:
The type of the chunk. This is one of ChunkType enumeration.
static String Celartem::DjVu::RendererHelper::getCorrespondingDictionaryId ( const String inChunkId  )  [static]

Gets the corresponding dictionary chunk Id.

Parameters:
inChunkId A chunk identifier of image/mask chunk.
Returns:
The corresponding dictionary chunk Id if available; otherwise, if no such chunk, NullString.
static void Celartem::DjVu::RendererHelper::registerRendererFactory ( RendererFactoryFunc  inRendererFactoryFunc,
RenderingLayer  inRenderingLayer,
const String inPrimaryId,
DictionaryFactoryFunc  inDictionaryFactoryFunc = NULL,
const String inDictId = NullString,
const String inChunkIDs = NULL,
size_t  inCountChunkIDs = 0 
) [static]

Registers a new renderer factory function.
This method allows you to develop a new internal chunk format support for Page class.

Parameters:
inRendererFactoryFunc A renderer factory function.
inRenderingLayer A layer which the renderers will render.
inPrimaryId An identifier which starts instanciation of the Renderer instance.
inDictionaryFactoryFunc An optional dictionary factory function. If no dictionary is used, this should be NULL.
inDictId An optional chunk identifier which identifies dictionaries for this renderers. If no dictionary is used, this should be NullString.
inChunkIDs An array of the chunks identifiers which the renderers consumes after instanciation. It can be NULL.
inCountChunkIDs The number of entries in the array specified by inChunkIDs.

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