pt.tumba.parser.swf
Class Image.Lossless

java.lang.Object
  extended by pt.tumba.parser.swf.Symbol
      extended by pt.tumba.parser.swf.Image
          extended by pt.tumba.parser.swf.Image.Lossless
Enclosing class:
Image

public static class Image.Lossless
extends Image

A lossless image (similar to PNG). There are 3 formats - 8, 16 and 32 bit. For 8 and 16 bit images there is a color table and the image data consists of either an 8 or 16 bit index into the table for each pixel. 32 bit images have no color table - each pixel consists of 4 bytes: (alpha,red,green,blue). If there is no alpha then the first byte will be 255. For all formats, the length of each row of pixel data must be a multiple of 32 bits. If the actual row data is smaller then it should be padded up to next multiple of 32 bits.

Author:
unknown

Nested Class Summary
 
Nested classes/interfaces inherited from class pt.tumba.parser.swf.Image
Image.JPEG, Image.Lossless
 
Field Summary
protected  Color[] colorTable
          Description of the Field
protected  int format
          Description of the Field
protected  boolean hasAlpha
          Description of the Field
protected  double height
          Description of the Field
protected  byte[] imageData
          Description of the Field
protected  double width
          Description of the Field
 
Fields inherited from class pt.tumba.parser.swf.Symbol
id
 
Constructor Summary
Image.Lossless(Color[] colorTable, byte[] imageData, double width, double height, boolean hasAlpha, int format)
           
 
Method Summary
protected  int defineSymbol(Movie movie, SWFTagTypes timelineWriter, SWFTagTypes definitionWriter)
          Description of the Method
 Color[] getColorTable()
          Gets the colorTable attribute of the Lossless object
 int getFormat()
          Gets the format attribute of the Lossless object
 double getHeight()
          Gets the height attribute of the Lossless object
 byte[] getImageData()
          Gets the imageData attribute of the Lossless object
 double getWidth()
          Gets the width attribute of the Lossless object
 boolean hasAlpha()
          Description of the Method
 
Methods inherited from class pt.tumba.parser.swf.Symbol
define, getId, getNextId
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

imageData

protected byte[] imageData
Description of the Field


colorTable

protected Color[] colorTable
Description of the Field


width

protected double width
Description of the Field


height

protected double height
Description of the Field


hasAlpha

protected boolean hasAlpha
Description of the Field


format

protected int format
Description of the Field

Constructor Detail

Image.Lossless

public Image.Lossless(Color[] colorTable,
                      byte[] imageData,
                      double width,
                      double height,
                      boolean hasAlpha,
                      int format)
Parameters:
colorTable - may be null for 32 bit bitmaps
imageData - the pixel data
width - in pixels
height - in pixels
hasAlpha - whether the image contains alpha values
format - one of: SWFConstants.BITMAP_FORMAT_8_BIT, SWFConstants.BITMAP_FORMAT_16_BIT, SWFConstants.BITMAP_FORMAT_32_BIT
Method Detail

getImageData

public byte[] getImageData()
Gets the imageData attribute of the Lossless object

Returns:
The imageData value

getColorTable

public Color[] getColorTable()
Gets the colorTable attribute of the Lossless object

Returns:
The colorTable value

getWidth

public double getWidth()
Gets the width attribute of the Lossless object

Returns:
The width value

getHeight

public double getHeight()
Gets the height attribute of the Lossless object

Returns:
The height value

hasAlpha

public boolean hasAlpha()
Description of the Method

Returns:
Description of the Return Value

getFormat

public int getFormat()
Gets the format attribute of the Lossless object

Returns:
The format value

defineSymbol

protected int defineSymbol(Movie movie,
                           SWFTagTypes timelineWriter,
                           SWFTagTypes definitionWriter)
                    throws java.io.IOException
Description of the Method

Specified by:
defineSymbol in class Symbol
Parameters:
movie - Description of the Parameter
timelineWriter - Description of the Parameter
definitionWriter - Description of the Parameter
Returns:
Description of the Return Value
Throws:
java.io.IOException - Description of the Exception