Public Types | Public Member Functions | Public Attributes

Celartem::DjVu::PageInfo Struct Reference

#include <djv_utils.h>

List of all members.

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.
size_t height
 The height of the page.
size_t version
 The version of the page.
size_t reserved
 Reserved. Should be 0.
size_t dpi
 The dpi (dot-per-inch) of the page.
size_t gamma
 The gamma of the page.
size_t flags
 The flags.

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:
inWidth The width of the page. See width.
inHeight The height of the page. See height.
inDpi The dpi (dot-per-inch) of the page. See dpi.
inGamma The gamma of the page. See gamma.
inFlags The additional flags. See flags.
inVersion The version of the page. See version.
inReserved Normally 0. See reserved.
Celartem::DjVu::PageInfo::PageInfo ( Stream inStream  )  [inline]

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

Parameters:
inStream Stream 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:
inChunk Chunk to decode.

Member Function Documentation

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

Decodes the INFO chunk from the specified stream.

Parameters:
inStream Stream to read.

Referenced by decode(), and PageInfo().

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

Decodes the specified INFO chunk.

Parameters:
inChunk Pointer 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:
inStream Stream 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:
inRotation The rotation status to set.

Member Data Documentation

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

Normally, DjVu uses 300 dpi.

Referenced by decode(), and encode().

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().

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().

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().

Reserved. Should be 0.

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

Referenced by decode(), and encode().

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().

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:

This document is made with doxygen 1.7.1 at Thu Feb 17 2011 15:40:21.
Caminova Logo