fr.esrf.tangoatk.widget.image
Class JpegDecoder

java.lang.Object
  extended by java.io.InputStream
      extended by fr.esrf.tangoatk.widget.image.JpegDecoder
All Implemented Interfaces:
java.io.Closeable

public class JpegDecoder
extends java.io.InputStream

A class to decode jpeg image Author: JL Pons


Field Summary
static int GRAY8
          8 Bits Gray scale
static int RGB24
          32 Bits RGB
 
Constructor Summary
JpegDecoder(byte[] jpgBuffer)
          Contructs a JPEG decoder
 
Method Summary
 int available()
           
 byte[][] decode()
          Decode the image
 int GetType()
          Returns type (0 is returned if no image has been decoded)
 int read()
           
 
Methods inherited from class java.io.InputStream
close, mark, markSupported, read, read, reset, skip
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

RGB24

public static final int RGB24
32 Bits RGB

See Also:
Constant Field Values

GRAY8

public static final int GRAY8
8 Bits Gray scale

See Also:
Constant Field Values
Constructor Detail

JpegDecoder

public JpegDecoder(byte[] jpgBuffer)
Contructs a JPEG decoder

Parameters:
jpgBuffer - buffer of encoded data
Method Detail

GetType

public int GetType()
Returns type (0 is returned if no image has been decoded)

See Also:
RGB24, GRAY8

decode

public byte[][] decode()
                throws java.io.IOException
Decode the image

Returns:
An array of 8Bits graysscale or 32Bits RGB
Throws:
java.io.IOException - in case of failure

read

public int read()
         throws java.io.IOException
Specified by:
read in class java.io.InputStream
Throws:
java.io.IOException

available

public int available()
              throws java.io.IOException
Overrides:
available in class java.io.InputStream
Throws:
java.io.IOException