Celartem::DjVu::IFF Struct Reference

#include <djv_serialize.h>

List of all members.

Public Types

enum  ChunkType {
  Unknown = 0, Page = 1, Thumbnail = 2, Annotation = 3,
  SecurityInfo = 4
}
enum  DjVuMultipageType { Single = 0, Bundled = 1, Indirect = 2 }
enum  SerializationMode {
  smAuto = 0, smSingle = 1, smBundled = 2, smIndirect = 3,
  smAsIs = 4
}
typedef void(* SerializationCallback )(void *inContext, size_t inCurrent, size_t inMax)

Static Public Member Functions

static AutoPtr< Chunkdeserialize (Storage *inStorage, ResourceBroker *inBroker=NULL, Layout *outIffLayout=NULL, CredentialProvider *inCredProv=NULL, SecurityProviderBroker *inSecProvBroker=NULL, IFFErrorRecoveryHandler *inErrorRecoveryHandler=NULL, Chunk::OnChunkCallback inOnChunkCallback=NULL, void *inContext=NULL)
static void serialize (Storage *inStorage, Chunk *inChunkToSerialize, SerializationCallback inCallback=NULL, void *inContext=NULL, SerializationMode inMode=smAuto, StorageLocator *inStorageLocator=NULL, const SecurityProvider *inSecProv=NULL)

Classes

struct  DIRMEntry
struct  Layout


Detailed Description

This struct provides the functions to access IFF structured DjVu files.
This structure is for advanced purpose so if you are a beginner programmer, you had better start with Document class anyway.

Definition at line 33 of file djv_serialize.h.


Member Typedef Documentation

typedef void(* Celartem::DjVu::IFF::SerializationCallback)(void *inContext, size_t inCurrent, size_t inMax)

Definition for the callback function which is used by serialize method.

Parameters:
inContext The user define parameter which is passed to serialize method's 4th parameter.
inCurrent An value which indicates the current progress status. The persentage is calculated by (inCurrent * 100 / inMax).
inMax The value which indicates the maximum value of inCurrent.
See also:
serialize


Member Enumeration Documentation

enum Celartem::DjVu::IFF::ChunkType

Type of chunks.

Enumerator:
Unknown  Unknown type.
Page  DJVU (page) chunk.
Thumbnail  THUM (Thumbnails) chunk.
Annotation  ANTz or ANTa (Annotation) chunk.
SecurityInfo  SINF (Security Information) chunk.

Definition at line 38 of file djv_serialize.h.

enum Celartem::DjVu::IFF::DjVuMultipageType

Type of the DjVu file.

Enumerator:
Single  Single page; it means no DJVM.
Bundled  Bundled.
Indirect  Indirect.

Definition at line 50 of file djv_serialize.h.

enum Celartem::DjVu::IFF::SerializationMode

This enumeration is used to decide the serialization mode.

Enumerator:
smAuto  The serialization mode is automatically decided.

If there are multiple pages in the document, they will be serialized into a bundled DjVu file; otherwise, the page is serialized into a single page DjVu file.

smSingle  Create a single page DjVu file.

If there are multiple pages in the document, only the first page is serialized.

smBundled  Create bundled DjVu format.

Even if there's only one page in the document, this option instructs the serialize method to output DJVM chunk on the top of it. This is useful when you want to retain some extra information such as NAVM with a single page DjVu file.

smIndirect  Create indirect DjVu format.

Create indirect DjVu file; the output is in multiple files; the satellite files are located by StorageLocator.

smAsIs  For special IFF structure construction.

Definition at line 215 of file djv_serialize.h.


Member Function Documentation

static AutoPtr<Chunk> Celartem::DjVu::IFF::deserialize ( Storage inStorage,
ResourceBroker inBroker = NULL,
Layout outIffLayout = NULL,
CredentialProvider inCredProv = NULL,
SecurityProviderBroker inSecProvBroker = NULL,
IFFErrorRecoveryHandler inErrorRecoveryHandler = NULL,
Chunk::OnChunkCallback  inOnChunkCallback = NULL,
void *  inContext = NULL 
) [static]

Deserialize a Chunk which contains DjVu document from a IFF structured DjVu file.
Please note that this function actually does not load all the content of the file if the file has DIRM chunk on the top of file. In this case, the returned Chunk instance may keep the storage open until all the chunks are loaded onto memory. To make sure all the chunks are loaded onto the memory, use Chunk::assureImmediateResponse.
Note that Document class is easy wrapper for this method so you had better use Document::create method to load DjVu files for normal purpose.

Parameters:
inStorage A Storage instance which contains DjVu document.
inBroker An optional parameter which specifies a ResourceBroker instance to locate any satellite files.
outIffLayout A Layout instance which receives the information about IFF chunk layout in the DjVu file.
Please note that Layout::broker variable may lock the files until it is NULL cleared or destructed.
inCredProv A CredentialProvider instance which is used if the DjVu file being deserialized is protected by some security mechanism.
inSecProvBroker A SecurityProviderBroker instance which loads SecurityProvider instance from 4 character security system Id. If this is NULL, this function uses the default SecurityProviderBroker instance.
This parameter is useful if you want to create your own SecurityProvider class and let deserialize function to use that class.
inErrorRecoveryHandler A IFFErrorRecoveryHandler instance which handles exceptions during deserializing the input DjVu file.
This can be NULL and then all the exceptions are directly thrown to the user code.
For more information, see IFFErrorRecoveryHandler.
inOnChunkCallback Pointer to a callback function which will be called when each chunk is loaded.
inContext A user defined data which is passed to the callback function.
Returns:
Pointer to newly created Chunk instance.
If the DjVu file is a multipage, this chunk is corresponding to DJVM but if is a single page, this chunk is DJVU. If you don't want to check such conditions, you had better use Document class rather than this method.

static void Celartem::DjVu::IFF::serialize ( Storage inStorage,
Chunk inChunkToSerialize,
SerializationCallback  inCallback = NULL,
void *  inContext = NULL,
SerializationMode  inMode = smAuto,
StorageLocator inStorageLocator = NULL,
const SecurityProvider inSecProv = NULL 
) [static]

Serialize a Chunk which contains DjVu document to a IFF structured DjVu file.
When serializing the IFF data onto the file from which deserialize function has loaded the chunks, the original file may be locked by some half-serialized chunks and the overwrite process may fail. To recover from such failures, use Chunk::assureImmediateResponse.
Note that Document class is easy wrapper for this method so you had better use Document::save method to save DjVu files for normal purpose.

Parameters:
inStorage A Storage instance to serialize to.
inChunkToSerialize A Chunk instance to be serialized.
inCallback Pointer to a function which is called during the serialization process.
inContext Pointer to a parameter which is passed to inCallback function.
inMode One of SerializationMode enumeration values and it decides how to generate DjVu file.
inStorageLocator Pointer to a StorageLocator instance which is used when create Storage instance for indirect DjVu files. It can be NULL if you want to use StorageLocator instance initialized with the index name which is returned by inStorage->getStorageId().
inSecProv This parameter is required if you want to create Secure DjVu files. Otherwise, for normal DjVu files, this should be NULL.


The documentation for this struct was generated from the following file:
This document is automatically generated using doxygen 1.5.4 at Fri Jun 27 18:23:30 2008.