|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcz.cuni.jagrlib.DefaultProperty
cz.cuni.jagrlib.Piece
cz.cuni.jagrlib.DefaultFileFormat
cz.cuni.jagrlib.DefaultRasterFileFormat
cz.cuni.jagrlib.piece.CompressedFormatTransform
public class CompressedFormatTransform
Lossy image compression (using discrete image transform, quantization, block coding and dynamic entropy coder).
Field Summary | |
---|---|
static java.lang.String |
BLOCK_HEIGHT
|
static java.lang.String |
BLOCK_WIDTH
|
protected int |
blockHeight
Transform block height. |
protected int |
blockWidth
Transform block width. |
static int |
MAGIC
16-bit magic number (used at the file beginning). |
static java.lang.String |
PREDICTION
|
protected float |
quality
Actual coding quality (affects encoder quantization tables). |
static java.lang.String |
QUALITY
|
static RegPiece |
reg
Static registration instance for this class. |
static java.lang.String |
STAT_BLOCK
|
protected int |
statBlock
Number of block which is logged to LogFile. |
protected static java.lang.String |
TEMPLATE_NAME
Object template identifier. |
protected boolean |
usePrediction
Use inter-block prediction? |
Fields inherited from class cz.cuni.jagrlib.DefaultRasterFileFormat |
---|
CATEGORY |
Fields inherited from class cz.cuni.jagrlib.Piece |
---|
channels, info, pl, plugs, TEMPLATE_TYPE, userBreak |
Fields inherited from interface cz.cuni.jagrlib.iface.DataFileFormat |
---|
DOUBLE_STREAM |
Fields inherited from interface cz.cuni.jagrlib.iface.Property |
---|
LOGGING, STATISTICS, TEXT_DESCRIPTION |
Constructor Summary | |
---|---|
CompressedFormatTransform()
|
Method Summary | |
---|---|
protected void |
commonLoad(BitStream stream,
RasterGraphics g)
Common load code. |
protected void |
commonSave(BitStream stream,
RasterGraphics g)
Common save code. |
java.lang.String[] |
fileNameMasks()
Returns file-name masks associated with the file-format type. |
java.lang.Object |
get(java.lang.String key)
Gets the given property. |
int |
headerLength()
Length of file-format header (number of bytes which is necessary for file-format matching). |
protected void |
checkBlockSize(DiscreteTransform transform,
int width,
int height)
|
protected void |
logArray(java.lang.String str,
double[] arr)
|
protected void |
logArray(java.lang.String str,
int[] arr)
|
double |
match(byte[] header,
java.lang.String fileName)
File-format match test. |
void |
set(java.lang.String key,
java.lang.Object value)
Sets the given property. |
static int |
setTemplate(Template t,
int ord)
General-purpose registration routine. |
Methods inherited from class cz.cuni.jagrlib.DefaultRasterFileFormat |
---|
loadFile, loadFile, saveFile, saveFile |
Methods inherited from class cz.cuni.jagrlib.DefaultFileFormat |
---|
closeFile, init, readFloat, readLine, readParameters, readToken, readUnsigned16, readUnsigned16, readUnsigned32, writeFloat, writeLine, writeParameters, writeUnsigned16, writeUnsigned16, writeUnsigned32 |
Methods inherited from class cz.cuni.jagrlib.Piece |
---|
className, connect, findPlug, findPlug, getInfo, getInterface, getInterface, getPlug, getReg, isCompatible, isCompatible, isConnected, logError, logWarning, myInterface, newInputPlug, newOptOutputPlug, newOutputPlug, newPlug, noTemplates, propBegin, propBounds, propDefault, propEnd, propEnum, propManipulator, propManipulator, setProgressListener, setRegStrings, setTemplateDynamic, stop |
Methods inherited from class cz.cuni.jagrlib.DefaultProperty |
---|
booleanProperty, booleanProperty, colorDoubleProperty, colorProperty, commit, doubleProperty, doubleProperty, doubleProperty, enumProperty, floatProperty, floatProperty, floatProperty, intProperty, intProperty, intProperty, longProperty, longProperty, longProperty, set, stringProperty |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface cz.cuni.jagrlib.iface.Property |
---|
commit |
Methods inherited from interface cz.cuni.jagrlib.Breakable |
---|
setProgressListener, stop |
Field Detail |
---|
protected int blockWidth
protected int blockHeight
protected float quality
protected boolean usePrediction
protected int statBlock
public static final int MAGIC
public static final java.lang.String BLOCK_WIDTH
public static final java.lang.String BLOCK_HEIGHT
public static final java.lang.String QUALITY
public static final java.lang.String PREDICTION
public static final java.lang.String STAT_BLOCK
protected static final java.lang.String TEMPLATE_NAME
public static final RegPiece reg
Constructor Detail |
---|
public CompressedFormatTransform()
Method Detail |
---|
protected void checkBlockSize(DiscreteTransform transform, int width, int height)
protected void logArray(java.lang.String str, double[] arr)
protected void logArray(java.lang.String str, int[] arr)
protected void commonLoad(BitStream stream, RasterGraphics g) throws java.io.IOException
commonSave()
.
commonLoad
in class DefaultRasterFileFormat
stream
- Opened input bit-stream.g
- Checked raster-graphics object.
java.io.IOException
protected void commonSave(BitStream stream, RasterGraphics g) throws java.io.IOException
Binary format & principle:
Pixel-transfer function
transforms individual pixel values
(example: RGB -> YCbCr). Each band will be processed individually.
Discrete image transform
is appplied to each image block.
quantizer
.
block-codec
(and underlying entropy codec
).
commonSave
in class DefaultRasterFileFormat
stream
- Opened output bit-stream.g
- Checked raster-graphics object.
java.io.IOException
public int headerLength()
headerLength
in interface DataFileFormat
headerLength
in class DefaultFileFormat
match(byte[], java.lang.String)
public double match(byte[] header, java.lang.String fileName)
match
in interface DataFileFormat
match
in class DefaultFileFormat
header
- Bytes from beginning of the file.fileName
- Optional file-name string.
headerLength()
,
fileNameMasks()
public java.lang.String[] fileNameMasks()
fileNameMasks
in interface DataFileFormat
fileNameMasks
in class DefaultFileFormat
match(byte[], java.lang.String)
public void set(java.lang.String key, java.lang.Object value)
set
in interface Property
set
in class DefaultProperty
key
- Key string.value
- The new value.Property.commit()
public java.lang.Object get(java.lang.String key)
get
in interface Property
get
in class DefaultProperty
key
- Key string.
public static int setTemplate(Template t, int ord)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |