Public Types | Static Public Member Functions | List of all members
Celartem::DjVu::RendererHelper Class Reference

#include <djv_renderer.h>

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

typedef AutoPtr<Dictionary>(* Celartem::DjVu::RendererHelper::DictionaryFactoryFunc)(const Chunk *inChunk)

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

Parameters
inChunkThe 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
inChunkThe chunk which contains data.
inDictionaryOptional 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
inChunkIdA 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
inChunkIdA 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
inRendererFactoryFuncA renderer factory function.
inRenderingLayerA layer which the renderers will render.
inPrimaryIdAn identifier which starts instanciation of the Renderer instance.
inDictionaryFactoryFuncAn optional dictionary factory function. If no dictionary is used, this should be NULL.
inDictIdAn optional chunk identifier which identifies dictionaries for this renderers. If no dictionary is used, this should be NullString.
inChunkIDsAn array of the chunks identifiers which the renderers consumes after instanciation. It can be NULL.
inCountChunkIDsThe number of entries in the array specified by inChunkIDs.

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