|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.lizardtech.djvu.DjVuObject
com.lizardtech.djvu.anno.DjVuAnno
public class DjVuAnno
DjVuAnno implement the mechanism for annotating DjVuImages. Annotations are additional instructions for the plugin about how the image should be displayed. The exact format of annotations is not strictly defined. The only requirement is that they have to be stored as a sequence of chunks inside a FORM:ANNO.
This file implements annotations understood by the DjVu plugins and encoders.
using: contents of ANT chunks.
>Contents of the FORM:ANNO should be passed to DjVuAnno.decode() for parsing, which initializes DjVuAnno.ANT and fills them with decoded data.
This is a top-level class containing annotations of a DjVu document (or just a page). It has only two functions: encode() and decode(). Both of them work with a sequence of annotation chunks from FORM:ANNO form. Basing on the name of the chunks they call encode() and decode() functions of the proper annotation structure (like ANT). The real work of encoding and decoding is done by lower-level classes.
Field Summary | |
---|---|
static java.lang.String[] |
ALIGN_STRING_ARRAY
The array of align specifications. |
static int |
BACKGROUND
Background mode. |
static int |
BITONAL
Bitonal mode. |
static int |
BOTTOM
Align bottom. |
static int |
CENTER
Align center. |
static int |
COLOR
Color mode. |
static long |
DEFAULT_BG_COLOR
The default background color. |
static int |
FIT_PAGE
Display fit page. |
static int |
FIT_WIDTH
Display fit width. |
static int |
FOREGROUND
Foreground mode. |
static int |
LEFT
Align left. |
static java.lang.String[] |
MODE_STRING_ARRAY
The array of legal mode specifications. |
static int |
ONE2ONE
Display 1 to 1. |
static int |
RIGHT
Align right. |
static int |
STRETCH
Display stretched. |
static int |
TOP
Align top. |
static int |
UNSPEC
Used for unspecifed. |
static java.lang.String[] |
ZOOM_STRING_ARRAY
The array of legal zoom specifications. |
Fields inherited from class com.lizardtech.djvu.DjVuObject |
---|
hasReferences |
Constructor Summary | |
---|---|
DjVuAnno()
Creates a new DjVuAnno object. |
Method Summary | |
---|---|
static DjVuAnno |
createDjVuAnno(DjVuInterface ref)
Creates an instance of DjVuAnno with the options interherited from the specified reference. |
static int |
cvt_color(java.lang.String color,
int retval)
Converts color from string in #RRGGBB notation to a long. |
void |
decode(DataPool pool)
Same as init() but adds the new data to what has been decoded before. |
long |
get_bg_color()
Get background color in #0x00RRBBGG# format unless DEFAULT_BG_COLOR is used because there was no background color records in the annotation chunk. |
int |
getHorAlign()
Get the horizontal alignment. |
java.util.Vector |
getMapArea()
Get the vector of Rect, Oval, and Poly objects. |
int |
getMode()
Get the display mode value. |
java.lang.String |
getRaw()
Query the raw annotation string. |
int |
getVerAlign()
Get the vertical alignment. |
int |
getZoom()
Get the zoom value. |
DjVuAnno |
init(DataPool pool)
Decodes contents of annotation chunk ANTa. |
boolean |
is_empty()
Returns TRUE if no features are specified or specified features are not different from default ones |
boolean |
isImageData()
Query if this is image data. |
void |
set_bg_color(long bg_color)
Set background color in #0x00RRBBGG# format unless DEFAULT_BG_COLOR is used because there was no background color records in the annotation chunk. |
void |
setHorAlign(int hor_align)
Set the horizontal alignment. |
void |
setMapArea(java.util.Vector map_area)
Set the vector of Rect, Oval, and Poly objects. |
void |
setMode(int mode)
Set the display mode value. |
void |
setRaw(java.lang.String raw)
Set the raw annotation string. |
void |
setRaw(java.lang.StringBuffer raw)
Set the raw annotation string. |
void |
setVerAlign(int ver_align)
Set the vertical alignment. |
void |
setZoom(int zoom)
Set the zoom value. |
Methods inherited from class com.lizardtech.djvu.DjVuObject |
---|
checkLockTime, create, create, createSoftReference, createWeakReference, getDjVuOptions, getFromReference, invoke, setDjVuOptions |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface com.lizardtech.djvu.DjVuInterface |
---|
getDjVuOptions, setDjVuOptions |
Field Detail |
---|
public static final long DEFAULT_BG_COLOR
public static final java.lang.String[] ZOOM_STRING_ARRAY
public static final java.lang.String[] MODE_STRING_ARRAY
public static final java.lang.String[] ALIGN_STRING_ARRAY
public static final int UNSPEC
public static final int COLOR
public static final int FOREGROUND
public static final int BACKGROUND
public static final int BITONAL
public static final int STRETCH
public static final int ONE2ONE
public static final int FIT_WIDTH
public static final int FIT_PAGE
public static final int LEFT
public static final int CENTER
public static final int RIGHT
public static final int TOP
public static final int BOTTOM
Constructor Detail |
---|
public DjVuAnno()
Method Detail |
---|
public boolean isImageData()
isImageData
in interface Codec
public static DjVuAnno createDjVuAnno(DjVuInterface ref)
ref
- Object to interherit DjVuOptions from.
public void setHorAlign(int hor_align)
hor_align
- desired horizontal alignmentpublic int getHorAlign()
public void setMapArea(java.util.Vector map_area)
map_area
- Vector of area maps.public java.util.Vector getMapArea()
public void setMode(int mode)
mode
- the desired display modepublic int getMode()
public void setRaw(java.lang.StringBuffer raw)
raw
- a buffer with the raw annotationspublic void setRaw(java.lang.String raw)
raw
- The raw annotation.public java.lang.String getRaw()
public void setVerAlign(int ver_align)
ver_align
- the desired vertical alignmentpublic int getVerAlign()
public void setZoom(int zoom)
zoom
- the desired zoom modepublic int getZoom()
public static int cvt_color(java.lang.String color, int retval)
color
- the string with the formatted color.retval
- the default value to use if the string can not be converted
public void decode(DataPool pool) throws java.io.IOException
decode
in interface Codec
pool
- the annotation chunk.
java.io.IOException
- if an error occurespublic long get_bg_color()
public DjVuAnno init(DataPool pool) throws java.io.IOException
pool
- Stream to read data from.
java.io.IOException
- if an error occurs reading the stream.public boolean is_empty()
public void set_bg_color(long bg_color)
bg_color
- the desired background color
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |