|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.brownsoft.codec.KLTDecoder
Title: Proyecto Codificacion de Imagenes y Video
Description:
Esta clase implementa un decodificador de imágenes a color y B/N aplicando la transformación de Karhunen-LoèveCopyright: Copyright (c) 2004
Company:
Field Summary | |
protected int |
BLOCK_SIZE
|
protected int |
BLOCK_WIDTH
|
private int |
coefficients
|
private java.lang.String |
comment
|
private int |
currentBand
|
private java.io.DataInputStream |
dataStream
|
private boolean |
embedKLTVectors
|
private java.lang.String |
externalKLTBaseInputName
|
private HuffmanMultiplexerBitInputStream |
externalKLTReader
|
private HuffmanMultiplexerBitInputStream |
huffmanDecoder
|
private java.awt.image.BufferedImage |
image
|
private int |
imageHeight
|
private double[][][] |
imageMatrix
|
private byte |
imageType
|
private int |
imageWidth
|
private boolean |
ownerInputStream
|
private int |
quality
|
private boolean |
showBands
|
private boolean |
useExternalKLTBase
|
private boolean |
useQuantization
|
Fields inherited from interface com.brownsoft.codec.KLTConstants |
AC_CHANNEL_BASE, AC_QUANTIZER, AC_QUANTIZER_CrCb, AC_QUANTIZER_FACTOR, AXIS_Cb, AXIS_Cr, AXIS_Y, BLUE, DC_CHANNEL, DC_QUANTIZER, EOB, FORMAT_STRING, FRACTION_MULTIPLIER, GRAY, GREEN, IMAGE_DEFAULT, IMAGE_GRAY, IMAGE_RGB, IMAGE_YCrCb, KLT_COEFF_MULTIPLIER, LOG_2, QUALITY_BEST, QUALITY_BETTER, QUALITY_GOOD, QUALITY_LOW, RED, subsampling_x, subsampling_y |
Constructor Summary | |
KLTDecoder(java.io.InputStream inputStream)
Construye una instance del decoder |
|
KLTDecoder(java.lang.String filename)
Construye una instance del decoder |
Method Summary | |
java.awt.Image |
decode()
Decodifica la imagen |
private double |
decodeBlock(double[] vector,
double lastDC)
Decodifica un bloque de la imagen |
private void |
decodeImage()
Decodifica la imagen |
private void |
decompressImage()
Descomprime la imagen |
private double |
dequantizeAC(double value,
int curCoef)
Decuantifica un componente de alterna |
private double |
dequantizeDC(double value)
Decuantifica el componente de continua |
private double[][][] |
expandSubSampling(double[][][] imageBand)
Expande el subsampling de los canales Cr y Cb |
private java.lang.String |
getBandName()
Obtiene el nombre asociado a un canal |
int |
getBlockSize()
Obtiene el tamaño del bloque NxN return Tamaño del bloque NxN |
private int |
getBufferedImageType()
|
private int |
getCantBlocks(int curBand)
Retorna la cantidad de bloques (por banda) que tiene la imagen |
java.lang.String |
getComment()
Obtiene el comentario asociado a la imagen |
private double |
getDoubleFromVLI(HuffmanMultiplexerBitInputStream huffmanDecoder,
int cantBitsNeeded)
Obtiene un double a partir de un VariableLengthInteger |
private double |
getDoubleFromVLI(int cantBitsNeeded)
Obtiene un double a partir de un VariableLengthInteger |
java.awt.Point |
getImageSize()
Obtiene el tamaño de la imagen |
int |
getImageType()
Obtiene el tipo de imagen |
boolean |
getKLTVectorsEmbeded()
Indica si los coeficientes de la base de la KLT estan embebidos en la imagen |
boolean |
getShowBands()
Retorna si se mostraran las bandas al codificar la imagen |
private void |
openExternalKLTBase()
Abre un archivo de base de la KLT (.kltc) |
private void |
readHeader()
Lee el header |
void |
setBlockSize(int blockSize)
Setea el tamaño(lado) de los bloques |
void |
setKLTBaseName(java.lang.String kltBaseName)
Indica que utilice la base de la klt a partir del archivo pasado por argumento |
private void |
setQuality(int quality)
Setea la calidad de la imagen |
void |
setShowBands(boolean showBands)
Indica si se desea mostrar las bandas que se van codificando |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
protected int BLOCK_SIZE
protected int BLOCK_WIDTH
private int coefficients
private java.lang.String comment
private int currentBand
private java.io.DataInputStream dataStream
private boolean embedKLTVectors
private java.lang.String externalKLTBaseInputName
private HuffmanMultiplexerBitInputStream externalKLTReader
private HuffmanMultiplexerBitInputStream huffmanDecoder
private java.awt.image.BufferedImage image
private int imageHeight
private double[][][] imageMatrix
private byte imageType
private int imageWidth
private boolean ownerInputStream
private int quality
private boolean showBands
private boolean useExternalKLTBase
private boolean useQuantization
Constructor Detail |
public KLTDecoder(java.io.InputStream inputStream) throws java.io.IOException
inputStream
- Stream de donde obtener la imagenpublic KLTDecoder(java.lang.String filename) throws java.io.IOException
filename
- Nombre del archivo donde se encuentra la imagenMethod Detail |
public java.awt.Image decode() throws KLTException
KLTException
private double decodeBlock(double[] vector, double lastDC) throws java.io.IOException
vector
- Vector donde colocar los coeficientes del bloquelastDC
- el coeficiente de continua del bloque anterior
java.io.IOException
private void decodeImage() throws java.io.IOException, KLTException
java.io.IOException
KLTException
private void decompressImage() throws java.io.IOException
java.io.IOException
private double dequantizeAC(double value, int curCoef)
private double dequantizeDC(double value)
private double[][][] expandSubSampling(double[][][] imageBand)
private java.lang.String getBandName()
public int getBlockSize()
private int getBufferedImageType()
private int getCantBlocks(int curBand)
public java.lang.String getComment()
private double getDoubleFromVLI(HuffmanMultiplexerBitInputStream huffmanDecoder, int cantBitsNeeded) throws java.io.IOException
huffmanDecoder
- el HuffmanMultiplexerBitInputStream con el stream de entradacantBitsNeeded
- cantidad de bits de este VLI
java.io.IOException
private double getDoubleFromVLI(int cantBitsNeeded) throws java.io.IOException
cantBitsNeeded
- cantidad de bits de este VLI
java.io.IOException
public java.awt.Point getImageSize()
public int getImageType()
public boolean getKLTVectorsEmbeded()
public boolean getShowBands()
private void openExternalKLTBase() throws java.io.IOException
java.io.IOException
private void readHeader() throws java.io.IOException, KLTException
java.io.IOException
KLTException
public void setBlockSize(int blockSize) throws KLTException
KLTException
public void setKLTBaseName(java.lang.String kltBaseName)
private void setQuality(int quality)
public void setShowBands(boolean showBands)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |