Classes | Public Types | Static Public Member Functions | List of all members
Celartem::DjVu::IFF Struct Reference

#include <djv_serialize.h>

Classes

struct  DIRMEntry
 
struct  Layout
 

Public Types

enum  ChunkType {
  Unknown = 0, Page = 1, Thumbnail = 2, Annotation = 3,
  SecurityInfo = 4
}
 
enum  DjVuMultipageType { NotConfigured = -1, Single = 0, Bundled = 1, Indirect = 2 }
 
enum  SerializationMode {
  smAuto = 0, smSingle = 1, smBundled = 2, smIndirect = 3,
  smAsIs = 4, smAsIsWithIncl = 5
}
 
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, Chunk::OnChunkCallback inOnFormChunkConstructionCallback=NULL, void *inContext=NULL)
 
static IFF::DjVuMultipageType serialize (Storage *inStorage, const Chunk *inChunkToSerialize, SerializationCallback inCallback=NULL, void *inContext=NULL, SerializationMode inMode=smAuto, StorageLocator *inStorageLocator=NULL, const SecurityProvider *inSecProv=NULL)
 

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.

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
inContextThe user define parameter which is passed to serialize method's 4th parameter.
inCurrentAn value which indicates the current progress status. The persentage is calculated by (inCurrent * 100 / inMax).
inMaxThe value which indicates the maximum value of inCurrent.
See Also
serialize

Member Enumeration Documentation

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.

Type of the DjVu file.

Enumerator
NotConfigured 

Not configured; it normally means the document is built on memory.

Single 

Single page; it means no DJVM.

Bundled 

Bundled.

Indirect 

Indirect.

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.

smAsIsWithIncl 

Serialize as is but with INCL.

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,
Chunk::OnChunkCallback  inOnFormChunkConstructionCallback = 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::preload.
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
inStorageA Storage instance which contains DjVu document.
inBrokerAn optional parameter which specifies a ResourceBroker instance to locate any satellite files.
outIffLayoutA 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.
inCredProvA CredentialProvider instance which is used if the DjVu file being deserialized is protected by some security mechanism.
inSecProvBrokerA 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.
inErrorRecoveryHandlerA 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.
inOnChunkCallbackPointer to a callback function which will be called when each chunk is loaded.
inContextA 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.
Warning
Without setting appropriate license script, deserialize method (DjVuDecode feature) will stop working after 2 weeks from the its built time. See License System for more information.
static IFF::DjVuMultipageType Celartem::DjVu::IFF::serialize ( Storage inStorage,
const 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::preload.
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
inStorageA Storage instance to serialize to.
inChunkToSerializeA Chunk instance to be serialized.
inCallbackPointer to a function which is called during the serialization process.
inContextPointer to a parameter which is passed to inCallback function.
inModeOne of SerializationMode enumeration values and it decides how to generate DjVu file.
inStorageLocatorPointer 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().
inSecProvThis parameter is required if you want to create Secure DjVu files. Otherwise, for normal DjVu files, this should be NULL.
Returns
The multipage type actually used.
Warning
Without setting appropriate license script, serialize method (DjVuEncode feature) will stop working after 2 weeks from the its built time. See License System for more information.

The documentation for this struct 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