Celartem::Doc Class Reference

#include <pxl_imagedoc.h>

Inheritance diagram for Celartem::Doc:

Inheritance graph
[legend]

List of all members.

Public Member Functions

virtual size_t getWidth () const =0
virtual size_t getHeight () const =0
virtual Photometric getPhotometric () const =0
virtual AutoPtr< DocgetNext () const =0
virtual AutoPtr< DocgetChild (size_t inIndex) const =0
virtual size_t getChildCount () const =0
virtual AutoPtr< const DataStoregetMetadata () const =0
virtual AutoPtr< ImagecreateImage (size_t inBytesAvailable=(size_t)-1)=0
virtual String getLocation () const =0
virtual String getFileType () const =0

Static Public Member Functions

static AutoPtr< DoccreateFakeDoc (const Image *inImage)


Detailed Description

Doc class manages a group of images and metadata, which are usually extracted from an image file.
Instances of this class are created by DocFactory. It is also directly created from PixelLiveSystem instance. The following code illustrates how to load a Doc instance from a Storage instance:
            // This code creates a Doc instance directly from PixelLiveSystem
            // instance.
            // AutoPtr<PixelLiveSystem> sys = PixelLiveSystem::create();
            AutoPtr<Doc> doc = sys->load(storage);

You can access to the multiple images (multiple pages or multiple resolution) in a file, see Supporting Multiple Images in a File.

A Doc instance also manages metadata and you can access to them using Doc::getMetadata function or Image::getMetadata function. For more detail information of how to handle metadata, see Metadata Handling.

See also:
DocFactory, PixelLiveSystem

Supporting Multiple Images in a File

Metadata Handling

Definition at line 45 of file pxl_imagedoc.h.


Member Function Documentation

virtual size_t Celartem::Doc::getWidth (  )  const [pure virtual]

This function returns the width of the primary image in the Doc instance. It may differ from the width obtained by Image::getWidth function when the Doc instance manages some image format that can preserve images of the multiple resoultion.

Returns:
The width of the primary image in pixels.
See also:
getHeight

virtual size_t Celartem::Doc::getHeight (  )  const [pure virtual]

This function returns the height of the primary image in the Doc instance. It may differ from the height obtained by Image::getWidth function when the Doc instance manages some image format that can preserve images of the multiple resoultion.

Returns:
The height of the primary image in pixels.
See also:
getWidth

virtual Photometric Celartem::Doc::getPhotometric (  )  const [pure virtual]

This function returns the Photometric of the primary image in the Doc instance.

Returns:
The Photometric value of the primary image.
See also:
Photometric

virtual AutoPtr<Doc> Celartem::Doc::getNext (  )  const [pure virtual]

This function returns the next Doc instance if available.
For supporting multiple images in a file, see Supporting Multiple Images in a File.

Returns:
Pointer to the next Doc instance.
See also:
Doc, getChild

Supporting Multiple Images in a File

virtual AutoPtr<Doc> Celartem::Doc::getChild ( size_t  inIndex  )  const [pure virtual]

This function returns the child instance of the specified index if available.
For supporting multiple images in a file, see Supporting Multiple Images in a File.

Returns:
Pointer to the child Doc instance.
See also:
Doc, getNext

Supporting Multiple Images in a File

virtual size_t Celartem::Doc::getChildCount (  )  const [pure virtual]

This function returns the number of the child Doc instances.
For supporting multiple images in a file, see Supporting Multiple Images in a File.

Returns:
The number of the child Doc instances.
See also:
Doc, getChild

Supporting Multiple Images in a File

virtual AutoPtr<const DataStore> Celartem::Doc::getMetadata (  )  const [pure virtual]

This function returns the metadata associated to this Doc instance. The metdata returned by this function is only for read purpose and you could not modify them. You can also get a changable copy of the metadata by Image::getMetadata function.
For more information about metadata handling, see Metadata Handling.

Returns:
Pointer to the DataStore instance that holds the metadata.
See also:
Image::getMetadata, DataStore

Metadata Handling

virtual AutoPtr<Image> Celartem::Doc::createImage ( size_t  inBytesAvailable = (size_t)-1  )  [pure virtual]

This function creates an Image instance from the primary image in this Doc instance.

Parameters:
inBytesAvailable The memory that can be assigned to the Image instance.
Please note that some Image types do not support this parameter.
Returns:
Pointer to the newly created Image instance.
See also:
Image

virtual String Celartem::Doc::getLocation (  )  const [pure virtual]

This function returns the location. The location is file path or URI that indicates the actual location of the resource.

Returns:
The location of the resource in String.

virtual String Celartem::Doc::getFileType (  )  const [pure virtual]

This function returns the type of the file format in String. For details, see the table shown below.
File FormatString returned
MrSID"MrSID"
JPEG 2000"JPEG2000"
VFZ"VFZ"
PFZ"PFZ"
TIFF"TIFF"
JPEG"JPEG"
PNG"PNG"
Windows Bitmap"Windows Bitmap"
Please note that the string returned by the function is not identical to the extension.

Returns:
The file format in String.

static AutoPtr<Doc> Celartem::Doc::createFakeDoc ( const Image inImage  )  [static]

This function creates a fake Doc instance that behaves like as a Doc instance that generates the specified Image. This function is useful when implementing your own Image class.

Parameters:
inImage An Image instance which the new Doc gathers information from.
Returns:
Pointer to the newly created Doc instance.
See also:
Image, Image::getDoc


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