Public Types | Public Member Functions | Public Attributes | List of all members
Celartem::DjVu::PageInfo Struct Reference

#include <djv_utils.h>

Public Types

enum  { DJVUVER_SUPPORTROTATION = 22, DJVUVER_RECOMMENDED = 25, DJVUVER_LATEST = 27 }
 
enum  Flags {
  Compressible = 0x80, BgIsPalettized = 0x40, BgIsNotWhite = 0x20, ReservedBits = 0x18,
  OrientationBits = 0x07
}
 

Public Member Functions

 PageInfo (size_t inWidth=0, size_t inHeight=0, size_t inDpi=300, size_t inGamma=22, size_t inFlags=1, size_t inVersion=25, size_t inReserved=0)
 
 PageInfo (Stream *inStream)
 
 PageInfo (const Chunk *inChunk)
 
void decode (Stream *inStream)
 
void decode (const Chunk *inChunk)
 
void encode (Stream *inStream)
 
AutoPtr< ChunkencodeINFOChunk ()
 
Rotation getRotation () const
 
void setRotation (Rotation inRotation)
 

Public Attributes

size_t width
 The width of the page. More...
 
size_t height
 The height of the page. More...
 
size_t version
 The version of the page. More...
 
size_t reserved
 Reserved. Should be 0. More...
 
size_t dpi
 The dpi (dot-per-inch) of the page. More...
 
size_t gamma
 The gamma of the page. More...
 
size_t flags
 The flags. More...
 

Detailed Description

This structure is used to get/set the information against INFO chunk.

Member Enumeration Documentation

anonymous enum
Enumerator
DJVUVER_SUPPORTROTATION 

The version with which the rotation feature is introduced.

DJVUVER_RECOMMENDED 

The version wide-spreadly used.

DJVUVER_LATEST 

The latest version. (Introduces new print header/footer format)

The bits used with flags variable.

Enumerator
Compressible 

Reserved.

BgIsPalettized 

(SHOULD NOT BE USED) The background is palettized with foreground palette.

BgIsNotWhite 

(SHOULD NOT BE USED) The background color is not white.

ReservedBits 

Reserved.

OrientationBits 

Bits used for preserving rotation status.

Constructor & Destructor Documentation

Celartem::DjVu::PageInfo::PageInfo ( size_t  inWidth = 0,
size_t  inHeight = 0,
size_t  inDpi = 300,
size_t  inGamma = 22,
size_t  inFlags = 1,
size_t  inVersion = 25,
size_t  inReserved = 0 
)
inline

Initialize the data members.

Parameters
inWidthThe width of the page. See width.
inHeightThe height of the page. See height.
inDpiThe dpi (dot-per-inch) of the page. See dpi.
inGammaThe gamma of the page. See gamma.
inFlagsThe additional flags. See flags.
inVersionThe version of the page. See version.
inReservedNormally 0. See reserved.
Celartem::DjVu::PageInfo::PageInfo ( Stream inStream)
inline

This constructor initializes the structure by loading INFO chunk from the specified stream.

Parameters
inStreamStream to read.
Celartem::DjVu::PageInfo::PageInfo ( const Chunk inChunk)
inline

This constructor initializes the structure by loading INFO chunk from the specified Chunk instance.

Parameters
inChunkChunk to decode.

Member Function Documentation

void Celartem::DjVu::PageInfo::decode ( Stream inStream)
inline

Decodes the INFO chunk from the specified stream.

Parameters
inStreamStream to read.

Referenced by decode(), and PageInfo().

void Celartem::DjVu::PageInfo::decode ( const Chunk inChunk)
inline

Decodes the specified INFO chunk.

Parameters
inChunkPointer to the Chunk instance which contains INFO chunk.
void Celartem::DjVu::PageInfo::encode ( Stream inStream)
inline

Converts the current status of this instance to INFO chunk and write out to the specified stream.

Parameters
inStreamStream to write on.

Referenced by encodeINFOChunk().

AutoPtr<Chunk> Celartem::DjVu::PageInfo::encodeINFOChunk ( )
inline

Converts the current status of this instance to INFO chunk.

Returns
Pointer to the newly created Chunk instance.
Rotation Celartem::DjVu::PageInfo::getRotation ( ) const
inline

Returns the rotation status according to the current flags variable.

Returns
The rotation status.
void Celartem::DjVu::PageInfo::setRotation ( Rotation  inRotation)
inline

Sets the rotation status to the current flags variable.
Please note that if the version is smaller than DJVUVER_SUPPORTROTATION (22), this method internally updates the file version.

Parameters
inRotationThe rotation status to set.

Member Data Documentation

size_t Celartem::DjVu::PageInfo::dpi

The dpi (dot-per-inch) of the page.

Normally, DjVu uses 300 dpi.

Referenced by decode(), and encode().

size_t Celartem::DjVu::PageInfo::flags

The flags.

Traditionally, the flags has many meanings but currently, only rotation specification is used.
To access rotation status, you had better use setRotation and getRotation methods.

The rotation feature seems to have introduced with DjVu file format version 22. And the following values are supported by the current viewer:

0 or 10 degree
6 or 790 degree
2 or 3180 degree
4 or 5270 degree

Referenced by decode(), encode(), getRotation(), and setRotation().

size_t Celartem::DjVu::PageInfo::gamma

The gamma of the page.

The value should be 10 times of the actual gamma. If you set gamma 2.2, this value is 22.
You had better keep the value to 22.

Referenced by decode(), and encode().

size_t Celartem::DjVu::PageInfo::height

The height of the page.

In pixels. It should be no more than 65535. Note that this is the height of the original and before rotation.

Referenced by decode(), and encode().

size_t Celartem::DjVu::PageInfo::reserved

Reserved. Should be 0.

In the spec, this is described as "Major Version". Currently, this should be 0.

Referenced by decode(), and encode().

size_t Celartem::DjVu::PageInfo::version

The version of the page.

In the spec, this is described as "Minor Version".

DjVu Ver.Viewer Ver.Notes
22 ? Add support for page rotation feature.
25 5.X Wide-spreaded version.
26 6.0 Add support for Line/Text annotation.

Referenced by decode(), encode(), getRotation(), and setRotation().

size_t Celartem::DjVu::PageInfo::width

The width of the page.

In pixels. It should be no more than 65535. Note that this is the width of the original and before rotation.

Referenced by decode(), and encode().


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