Public Types | Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Celartem::DjVu::Annotation Class Referenceabstract

#include <djv_annotation.h>

Inheritance diagram for Celartem::DjVu::Annotation:
Inheritance graph
[legend]

Public Types

enum  HorzAlign { haNone = 0, haLeft = 1, haCenter = 2, haRight = 3 }
 
enum  VertAlign { vaNone = 0, vaTop = 1, vaCenter = 2, vaBottom = 3 }
 
enum  SpecialZoom {
  szNone = 0, szStretch = -4, szOne2One = -3, szFitToWidth = -2,
  szFitToPage = -1
}
 
enum  ViewerMode {
  vmNone = 0, vmNormal = 1, vmBlackAndWhite = 2, vmForeground = 3,
  vmBackground = 4
}
 

Public Member Functions

virtual void init (HorzAlign inHorzAlign=haNone, VertAlign inVertAlign=vaNone, Color inBgColor=Color::InvalidColor, int inZoom=szNone, ViewerMode inViewerMode=vmNone)=0
 
virtual bool isDefaultState () const =0
 
virtual void decode (Stream *inStream, const PageInfo &inPageInfo)=0
 
virtual void decode (const Chunk *inChunk, const PageInfo &inPageInfo)=0
 
virtual void decode (const String &inAnnoText, const PageInfo &inPageInfo)=0
 
virtual void decode (const UChar1 *inAnnoText, size_t inAnnoSize, const PageInfo &inPageInfo)=0
 
virtual void decode (Stream *inStream)=0
 
virtual void decode (const Chunk *inChunk)=0
 
virtual void decode (const String &inAnnoText)=0
 
virtual void decode (const UChar1 *inAnnoText, size_t inAnnoSize)=0
 
virtual String encode (const PageInfo &inPageInfo) const =0
 
virtual void encode (Stream *inStream, const PageInfo &inPageInfo) const =0
 
virtual AutoPtr< ChunkencodeANTzChunk (const PageInfo &inPageInfo) const =0
 
virtual AutoPtr< ChunkencodeANTaChunk (const PageInfo &inPageInfo) const =0
 
virtual String encode () const =0
 
virtual void encode (Stream *inStream) const =0
 
virtual AutoPtr< ChunkencodeANTzChunk () const =0
 
virtual AutoPtr< ChunkencodeANTaChunk () const =0
 
virtual void merge (const Annotation *inAnno, bool inOverrideByNoneValues=false)=0
 
virtual AutoPtr< Annotationduplicate (bool inDupMapAreas) const =0
 
virtual Rotation getRotation ()=0
 
virtual void setRotation (Rotation inRotation)=0
 
- Public Member Functions inherited from Celartem::Referable
 Referable ()
 
void addRef () const
 
void releaseRef () const
 
size_t getReferenceCount () const
 

Static Public Member Functions

static AutoPtr< Annotationcreate (HorzAlign inHorzAlign=haNone, VertAlign inVertAlign=vaNone, Color inBgColor=Color::InvalidColor, int inZoom=szNone, ViewerMode inViewerMode=vmNone)
 
static AutoPtr< Annotationcreate (size_t inWidth, size_t inHeight, HorzAlign inHorzAlign=haNone, VertAlign inVertAlign=vaNone, Color inBgColor=Color::InvalidColor, int inZoom=szNone, ViewerMode inViewerMode=vmNone)
 
static AutoPtr< Annotationcreate (Stream *inStream, const PageInfo &inPageInfo)
 
static AutoPtr< Annotationcreate (const Chunk *inChunk, const PageInfo &inPageInfo)
 
static AutoPtr< Annotationcreate (const String &inAnnoText, const PageInfo &inPageInfo)
 
static AutoPtr< Annotationcreate (Stream *inStream)
 
static AutoPtr< Annotationcreate (const Chunk *inChunk)
 
static AutoPtr< Annotationcreate (const String &inAnnoText)
 
- Static Public Member Functions inherited from Celartem::Referable
static void dumpDbgAllRefCount ()
 

Public Attributes

HorzAlign horzAlign
 
VertAlign vertAlign
 
Color bgColor
 
int zoom
 
ViewerMode viewerMode
 
SimpleArray< AutoPtr< MapArea > > mapAreas
 
AutoPtr< PropertySetproperties
 
AutoPtr< PrintHeaderprintHeader
 
AutoPtr< PrintHeaderprintFooter
 
String xmp
 
SimpleArray< Stringothers
 

Detailed Description

This class is used to manipulate annotation and page attributes.

Member Enumeration Documentation

This enumeration defines the horizontal alignment of the pages.

Enumerator
haNone 

No specification.

haLeft 

Align to Left.

haCenter 

Align to Center.

haRight 

Align to Right.

This enumeration defines special zoom conditions.

Enumerator
szNone 

No specification for zoom.

szStretch 

Shown as stretched. The aspect ratio is not retained.

szOne2One 

Shown as 1:1 (Actual pixels).

szFitToWidth 

Shown horizontally fit to the application client area.

szFitToPage 

Whole the page is fit to the application client area.

This enumeration defines the vertical alignment of the pages.

Enumerator
vaNone 

No specification.

vaTop 

Align to Top.

vaCenter 

Align to Center.

vaBottom 

Align to Bottom.

This enumeration defines the viewer mode.

Enumerator
vmNone 

No specification for viewer mode.

vmNormal 

Show the pages normally (color).

vmBlackAndWhite 

Show only the mask of the pages.

vmForeground 

Show only the foreground of the pages.

vmBackground 

Show only the background of the pages.

Member Function Documentation

static AutoPtr<Annotation> Celartem::DjVu::Annotation::create ( HorzAlign  inHorzAlign = haNone,
VertAlign  inVertAlign = vaNone,
Color  inBgColor = Color::InvalidColor,
int  inZoom = szNone,
ViewerMode  inViewerMode = vmNone 
)
static

Initializes Anotation instance with the specified parameters.

Parameters
inHorzAlignThe horizontal alignment of the page. See horzAlign.
inVertAlignThe vertical alignment of the page. See vertAlign.
inBgColorThe color of the background. See bgColor.
inZoomThe zoom ratio of the page. See zoom.
inViewerModeThe viewer mode. See viewerMode.
static AutoPtr<Annotation> Celartem::DjVu::Annotation::create ( size_t  inWidth,
size_t  inHeight,
HorzAlign  inHorzAlign = haNone,
VertAlign  inVertAlign = vaNone,
Color  inBgColor = Color::InvalidColor,
int  inZoom = szNone,
ViewerMode  inViewerMode = vmNone 
)
static

Initializes Anotation instance with the specified parameters.

Parameters
inWidthThe width in pixels.
inHeightThe height in pixels.
inHorzAlignThe horizontal alignment of the page. See horzAlign.
inVertAlignThe vertical alignment of the page. See vertAlign.
inBgColorThe color of the background. See bgColor.
inZoomThe zoom ratio of the page. See zoom.
inViewerModeThe viewer mode. See viewerMode.
static AutoPtr<Annotation> Celartem::DjVu::Annotation::create ( Stream inStream,
const PageInfo inPageInfo 
)
static

Initializes Anotation instance by loading ANTa data from the specified stream.
If decoding ANTz data in a stream, you should use InflateStream to convert ANTz into ANTa.
This constructor is for advanced purpose and you had better use Annotation(const Chunk*).

Parameters
inStreamPointer to a Stream which contains ANTa data.
inPageInfoThe dimensions and rotation status of the page is used during decoding ANTa chunk.
static AutoPtr<Annotation> Celartem::DjVu::Annotation::create ( const Chunk inChunk,
const PageInfo inPageInfo 
)
static

Initializes Anotation instance by loading ANTa or ANTz data from the specified chunk.

Parameters
inChunkPointer to a Chunk which contains ANTa or ANTz data.
inPageInfoThe dimensions and rotation status of the page is used during decoding ANT* chunk.
static AutoPtr<Annotation> Celartem::DjVu::Annotation::create ( const String inAnnoText,
const PageInfo inPageInfo 
)
static

Initializes Anotation instance by loading ANTa style string.

Parameters
inAnnoTextString which contains ANTa data.
inPageInfoThe dimensions and rotation status of the page is used during decoding ANTa chunk.
static AutoPtr<Annotation> Celartem::DjVu::Annotation::create ( Stream inStream)
static

Initializes Anotation instance by loading ANTa data from the specified stream.
If decoding ANTz data in a stream, you should use InflateStream to convert ANTz into ANTa.
This constructor is for advanced purpose and you had better use Annotation(const Chunk*).
Please note that this constructor cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Parameters
inStreamPointer to a Stream which contains ANTa data.
static AutoPtr<Annotation> Celartem::DjVu::Annotation::create ( const Chunk inChunk)
static

Initializes Anotation instance by loading ANTa or ANTz data from the specified chunk.
Please note that this constructor cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Parameters
inStreamPointer to a Stream which contains ANTa data.
static AutoPtr<Annotation> Celartem::DjVu::Annotation::create ( const String inAnnoText)
static

Initializes Anotation instance by loading ANTa style string.
Please note that this constructor cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Parameters
inAnnoTextString which contains ANTa data.
virtual void Celartem::DjVu::Annotation::decode ( Stream inStream,
const PageInfo inPageInfo 
)
pure virtual

Initializes Anotation instance by loading ANTa data from the specified stream.
If decoding ANTz data in a stream, you should use InflateStream to convert ANTz into ANTa.
This constructor is for advanced purpose and you had better use Annotation(const Chunk*).

Parameters
inStreamPointer to a Stream which contains ANTa data.
inPageInfoThe dimensions and rotation status of the page is used during decoding ANTa chunk.
virtual void Celartem::DjVu::Annotation::decode ( const Chunk inChunk,
const PageInfo inPageInfo 
)
pure virtual

Initializes Anotation instance by loading ANTa or ANTz data from the specified chunk.

Parameters
inStreamPointer to a Stream which contains ANTa data.
inPageInfoThe dimensions and rotation status of the page is used during decoding ANT* chunk.
virtual void Celartem::DjVu::Annotation::decode ( const String inAnnoText,
const PageInfo inPageInfo 
)
pure virtual

Initializes Anotation instance by loading ANTa style string.

Parameters
inAnnoTextString which contains ANTa data.
inPageInfoThe dimensions and rotation status of the page is used during decoding ANTa chunk.
virtual void Celartem::DjVu::Annotation::decode ( const UChar1 inAnnoText,
size_t  inAnnoSize,
const PageInfo inPageInfo 
)
pure virtual

Initializes Anotation instance by loading ANTa style string.

Parameters
inAnnoTextPointer to a buffer which contains ANTa data.
inAnnoSizeThe size of the data.
inPageInfoThe dimensions and rotation status of the page is used during decoding ANTa chunk.
virtual void Celartem::DjVu::Annotation::decode ( Stream inStream)
pure virtual

Initializes Anotation instance by loading ANTa data from the specified stream.
If decoding ANTz data in a stream, you should use InflateStream to convert ANTz into ANTa.
This constructor is for advanced purpose and you had better use Annotation(const Chunk*).
Please note that this function cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Parameters
inStreamPointer to a Stream which contains ANTa data.
virtual void Celartem::DjVu::Annotation::decode ( const Chunk inChunk)
pure virtual

Initializes Anotation instance by loading ANTa or ANTz data from the specified chunk.
Please note that this function cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Parameters
inStreamPointer to a Stream which contains ANTa data.
virtual void Celartem::DjVu::Annotation::decode ( const String inAnnoText)
pure virtual

Initializes Anotation instance by loading ANTa style string.
Please note that this function cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Parameters
inAnnoTextString which contains ANTa data.
virtual void Celartem::DjVu::Annotation::decode ( const UChar1 inAnnoText,
size_t  inAnnoSize 
)
pure virtual

Initializes Anotation instance by loading ANTa style string.
Please note that this function cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Parameters
inAnnoTextPointer to a buffer which contains ANTa data.
inAnnoSizeThe size of the data.
virtual AutoPtr<Annotation> Celartem::DjVu::Annotation::duplicate ( bool  inDupMapAreas) const
pure virtual

Duplicates the instance.

Parameters
inDupMapAreasWhether to duplicate MapArea instances or not.
If this is false, MapArea instances are not duplicated but their reference counts are incremented.
Returns
New instance.
virtual String Celartem::DjVu::Annotation::encode ( const PageInfo inPageInfo) const
pure virtual

Encodes the instance to the DjVu's ANTa block.
This method is for advanced purpose and for normal purpose, you had better use encodeANTzChunk or encodeANTaChunk. To encode ANTz chunk, you should compress the returned data using DeflateStream.

Parameters
inPageInfoThe dimensions and rotation status of the page is used during encoding ANTa chunk.
Returns
String which contains ANTa data.
virtual void Celartem::DjVu::Annotation::encode ( Stream inStream,
const PageInfo inPageInfo 
) const
pure virtual

Encodes the instance to the DjVu's ANTa block.
This method is for advanced purpose and for normal purpose, you had better use encodeANTzChunk or encodeANTaChunk. To encode ANTz chunk, you should compress the returned data using DeflateStream.

Parameters
inStreamThe stream to write on.
inPageInfoThe dimensions and rotation status of the page is used during encoding ANTa chunk.
virtual String Celartem::DjVu::Annotation::encode ( ) const
pure virtual

Encodes the instance to the DjVu's ANTa block.
This method is for advanced purpose and for normal purpose, you had better use encodeANTzChunk or encodeANTaChunk. To encode ANTz chunk, you should compress the returned data using DeflateStream.
Please note that this function cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Returns
String which contains ANTa data.
virtual void Celartem::DjVu::Annotation::encode ( Stream inStream) const
pure virtual

Encodes the instance to the DjVu's ANTa block.
This method is for advanced purpose and for normal purpose, you had better use encodeANTzChunk or encodeANTaChunk. To encode ANTz chunk, you should compress the returned data using DeflateStream.
Please note that this function cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Parameters
inStreamThe stream to write on.
virtual AutoPtr<Chunk> Celartem::DjVu::Annotation::encodeANTaChunk ( const PageInfo inPageInfo) const
pure virtual

Encodes the instance to the DjVu's ANTa chunk.

Parameters
inPageInfoThe dimensions and rotation status of the page is used during encoding ANTa chunk.
Returns
ANTa Chunk.
virtual AutoPtr<Chunk> Celartem::DjVu::Annotation::encodeANTaChunk ( ) const
pure virtual

Encodes the instance to the DjVu's ANTa chunk.
Please note that this function cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Returns
ANTa Chunk.
virtual AutoPtr<Chunk> Celartem::DjVu::Annotation::encodeANTzChunk ( const PageInfo inPageInfo) const
pure virtual

Encodes the instance to the DjVu's ANTz chunk.

Parameters
inPageInfoThe dimensions and rotation status of the page is used during encoding ANTz chunk.
Returns
ANTz Chunk.
virtual AutoPtr<Chunk> Celartem::DjVu::Annotation::encodeANTzChunk ( ) const
pure virtual

Encodes the instance to the DjVu's ANTz chunk.
Please note that this function cannot deal with mapAreas; if mapAreas has any elements in it, they're simply ignored.

Returns
ANTz Chunk.
virtual Rotation Celartem::DjVu::Annotation::getRotation ( )
pure virtual

Get the current rotation angle.

Returns
The current rotation angle.
virtual void Celartem::DjVu::Annotation::init ( HorzAlign  inHorzAlign = haNone,
VertAlign  inVertAlign = vaNone,
Color  inBgColor = Color::InvalidColor,
int  inZoom = szNone,
ViewerMode  inViewerMode = vmNone 
)
pure virtual

Initializes Annotation instance with the specified values.

virtual bool Celartem::DjVu::Annotation::isDefaultState ( ) const
pure virtual

Determines whether the annotation attributes are modified from the default (the parameters initialized by the constructors or init method) or not.

Returns
true if the annotation attributes are not changed from the default state.
virtual void Celartem::DjVu::Annotation::merge ( const Annotation inAnno,
bool  inOverrideByNoneValues = false 
)
pure virtual

Merges the specified Annotation into this instance.

Parameters
inAnnoAnnotation to merge.
Please note that page attributes of this instance are completely overwritten by the ones of inAnno.
inOverrideByNoneValuesWhether the values on this instance should be replaced by values like none/empty/nothing.
virtual void Celartem::DjVu::Annotation::setRotation ( Rotation  inRotation)
pure virtual

Rotate all the MapArea instance.
Please note that this may take long if there're many MapArea instances.

Parameters
inRotationThe resulting rotation angle.
Please note that this is NOT the degrees to rotate but the absolute rotation destination.

Member Data Documentation

Color Celartem::DjVu::Annotation::bgColor

Specifies the background color of the page(s).
If this annotation is shared by pages in the DjVu file, it may be overrode by page-by-page annotation.
If the color is invalid (i.e. Color::InvalidColor), the background color is considered to be not specified.

HorzAlign Celartem::DjVu::Annotation::horzAlign

Specifies the horizontal alignment of the page(s).
If this annotation is shared by pages in the DjVu file, it may be overrode by page-by-page annotation.

SimpleArray< AutoPtr<MapArea> > Celartem::DjVu::Annotation::mapAreas

The mapareas which annotate a page.
It cannot contain any MapArea instances if it is shared annotation.

SimpleArray<String> Celartem::DjVu::Annotation::others

The annotation strings which cannot be recognized by the system. They're written back to the ANT* chunk on encode method just as a string; no syntax checks on them; you are responsible for these ones.

AutoPtr<PrintHeader> Celartem::DjVu::Annotation::printFooter

Print footer.

AutoPtr<PrintHeader> Celartem::DjVu::Annotation::printHeader

Print header.

AutoPtr<PropertySet> Celartem::DjVu::Annotation::properties

Custom properties, known as Metadata.

VertAlign Celartem::DjVu::Annotation::vertAlign

Specifies the vertical alignment of the page(s).
If this annotation is shared by pages in the DjVu file, it may be overrode by page-by-page annotation.

ViewerMode Celartem::DjVu::Annotation::viewerMode

Specifies the viewer mode of the viewer.
If this annotation is shared by pages in the DjVu file, it may be overrode by page-by-page annotation.

String Celartem::DjVu::Annotation::xmp

XMP metadata.

int Celartem::DjVu::Annotation::zoom

Specifies the zoom ratio either by a value within [1 999] or one of SpecialZoom enumeration values.


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