quicktime.util
Class ByteEncodedImage

java.lang.Object
  |
  +--quicktime.util.QTByteObject
        |
        +--quicktime.util.ByteEncodedImage
All Implemented Interfaces:
java.lang.Cloneable, EncodedImage, quicktime.jdirect.PrimitivesLib, java.io.Serializable, quicktime.jdirect.SharedLibrary, com.apple.jdirect.SharedLibrary

public class ByteEncodedImage
extends QTByteObject
implements EncodedImage, java.lang.Cloneable

ByteEncodedImages keep the encoded image data as an array of bytes.

See Also:
Serialized Form

Fields inherited from interface quicktime.util.EncodedImage
kRowBytesUnknown
 
Fields inherited from interface quicktime.jdirect.PrimitivesLib
JDirect_MacOSX, libraryInstance
 
Constructor Summary
ByteEncodedImage(int size)
          Creates a new ByteEncodedImage of specified size.
ByteEncodedImage(int size, int rowBytes)
          Creates a new ByteEncodedImage of specified size with the specified rowBytes
ByteEncodedImage(RawEncodedImage ptr)
          Creates a ByteEncodedImage from raw data.
 
Method Summary
 java.lang.Object clone()
          Returns a copy of the current object
static ByteEncodedImage fromByteArray(byte[] ar)
          This will make a ByteEncodedImage from an array of bytes.
static ByteEncodedImage fromByteArray(byte[] ar, int rowBytes)
          This will make a ByteEncodedImage from an array of bytes.
 byte getByte(int offset)
          Returns the byte at the specified offset The offset is specified in bytes into the encoded image object.
 int getInt(int offset)
          Returns the int at the specified offset The offset is specified in bytes into the encoded image object.
 int getRowBytes()
          Returns either kRowBytesUnknown or the number of bytes per row that the encoded image data is comprised of.
 short getShort(int offset)
          Returns the short at the specified offset The offset is specified in bytes into the encoded image object.
 
Methods inherited from class quicktime.util.QTByteObject
equals, fromArray, getBytes, getSize, toString
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface quicktime.util.EncodedImage
getSize
 

Constructor Detail

ByteEncodedImage

public ByteEncodedImage(RawEncodedImage ptr)
Creates a ByteEncodedImage from raw data. It will copy the data

ByteEncodedImage

public ByteEncodedImage(int size)
Creates a new ByteEncodedImage of specified size.

ByteEncodedImage

public ByteEncodedImage(int size,
                        int rowBytes)
Creates a new ByteEncodedImage of specified size with the specified rowBytes
Method Detail

fromByteArray

public static ByteEncodedImage fromByteArray(byte[] ar)
This will make a ByteEncodedImage from an array of bytes. It will not copy the byte array but creates a proxy for the same bytes.

fromByteArray

public static ByteEncodedImage fromByteArray(byte[] ar,
                                             int rowBytes)
This will make a ByteEncodedImage from an array of bytes. It will not copy the byte array but creates a proxy for the same bytes.

clone

public java.lang.Object clone()
Returns a copy of the current object

getByte

public byte getByte(int offset)
Returns the byte at the specified offset The offset is specified in bytes into the encoded image object.
Specified by:
getByte in interface EncodedImage

getShort

public short getShort(int offset)
Returns the short at the specified offset The offset is specified in bytes into the encoded image object.
Specified by:
getShort in interface EncodedImage

getInt

public int getInt(int offset)
Returns the int at the specified offset The offset is specified in bytes into the encoded image object.
Specified by:
getInt in interface EncodedImage

getRowBytes

public int getRowBytes()
Returns either kRowBytesUnknown or the number of bytes per row that the encoded image data is comprised of. This number will at least be as big as width*pixelSize, and maybe larger.
Specified by:
getRowBytes in interface EncodedImage