quicktime.util
Class RawEncodedImage

java.lang.Object
  |
  +--quicktime.QTObject
        |
        +--quicktime.util.QTPointerRef
              |
              +--quicktime.util.QTPointer
                    |
                    +--quicktime.util.RawEncodedImage
All Implemented Interfaces:
java.lang.Cloneable, EncodedImage, quicktime.jdirect.InterfaceLib, quicktime.jdirect.PrimitivesLib, quicktime.jdirect.QuickTimeLib, quicktime.jdirect.SharedLibrary, com.apple.jdirect.SharedLibrary

public final class RawEncodedImage
extends QTPointer
implements quicktime.jdirect.QuickTimeLib, EncodedImage

RawEncodedImages keep the encoded image data as a pointer to some block of memory. This is a totally opaque representation of the encoded image - it does not provide any means of directly manipulating the encoded data.


Fields inherited from interface quicktime.jdirect.QuickTimeLib
JDirect_MacOSX, libraryInstance, name
 
Fields inherited from interface quicktime.util.EncodedImage
kRowBytesUnknown
 
Constructor Summary
RawEncodedImage(byte[] bytes)
          This will return a RawEncodedImage object from a byte array.
RawEncodedImage(int[] ints)
          This will return a RawEncodedImage object from an int array.
RawEncodedImage(int[] ints, int rowBytes)
          This will return a RawEncodedImage object from an int array.
RawEncodedImage(int size, boolean clear)
          Allocate the specified amount of bytes for containing encoded image data.
RawEncodedImage(int size, boolean clear, int rowBytes)
          Allocate the specified amount of bytes for containing encoded image data.
 
Method Summary
 java.lang.Object clone()
          Returns a copy of this object
static RawEncodedImage fromPixMap(PixMap pm)
          Returns the actual Pixel data itself.
static RawEncodedImage fromQTHandle(QTHandleRef hdl)
          This will return a RawEncodedImage object from a handle.
static RawEncodedImage fromQTPointer(QTPointerRef ptr)
          This will return a RawEncodedImage object from a pointer.
static RawEncodedImage fromSprite(Sprite s)
          This method gets the image data property of this sprite.
 byte getByte(int offset)
          Returns the byte at the specified offset
 int getInt(int offset)
          Returns the int at the specified offset
 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
 void setByte(int offset, byte value)
          Sets the byte at the specified offset
 void setInt(int offset, int value)
          Sets the int at the specified offset
 void setInts(int offset, int[] value)
          Sets an array of ints at the specified offset
 void setShort(int offset, short value)
          Sets the short at the specified offset
 
Methods inherited from class quicktime.util.QTPointer
concatenate, fromEncodedImage, fromGraphicsExporter, fromSCData, setSize
 
Methods inherited from class quicktime.util.QTPointerRef
copyFromArray, copyFromArray, copyFromArray, copyFromArray, copyFromArray, copyFromArray, copyFromArray, copyToArray, copyToArray, copyToArray, copyToArray, copyToArray, copyToArray, copyToArray, getBytes, getSize, toString
 
Methods inherited from class quicktime.QTObject
disposeQTObject, equals, ID
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface quicktime.util.EncodedImage
getSize
 

Constructor Detail

RawEncodedImage

public RawEncodedImage(byte[] bytes)
                throws QTException
This will return a RawEncodedImage object from a byte array. It will copy the bytes.

RawEncodedImage

public RawEncodedImage(int[] ints)
                throws QTException
This will return a RawEncodedImage object from an int array. It will copy the ints.

RawEncodedImage

public RawEncodedImage(int[] ints,
                       int rowBytes)
                throws QTException
This will return a RawEncodedImage object from an int array. It will copy the ints.

RawEncodedImage

public RawEncodedImage(int size,
                       boolean clear)
                throws QTException
Allocate the specified amount of bytes for containing encoded image data.
Parameters:
size - the size of the pointer to create.
clear - clear the pointer upon creation.

RawEncodedImage

public RawEncodedImage(int size,
                       boolean clear,
                       int rowBytes)
                throws QTException
Allocate the specified amount of bytes for containing encoded image data.
Parameters:
size - the size of the pointer to create.
clear - clear the pointer upon creation.
Method Detail

fromQTPointer

public static RawEncodedImage fromQTPointer(QTPointerRef ptr)
This will return a RawEncodedImage object from a pointer. It will not copy the pointer but will reference the same data.

fromQTHandle

public static RawEncodedImage fromQTHandle(QTHandleRef hdl)
This will return a RawEncodedImage object from a handle. It will not copy the handle but will reference the same data.

fromPixMap

public static RawEncodedImage fromPixMap(PixMap pm)
Returns the actual Pixel data itself. This can then be passed around in ICM calls that deal with pixel data.

QuickTime::GetPixBaseAddr()

Parameters:
pm - the PixMap
Returns:
the pixels
See Also:
PixMap.getPixelData()

fromSprite

public static RawEncodedImage fromSprite(Sprite s)
                                  throws StdQTException
This method gets the image data property of this sprite.

QuickTime::GetSpriteProperty ()

Returns:
the image data.
See Also:
Sprite.getImageData()

clone

public java.lang.Object clone()
Returns a copy of this object
Overrides:
clone in class QTPointer

getByte

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

setByte

public void setByte(int offset,
                    byte value)
Sets the byte at the specified offset
Parameters:
offset - The offset is specified in bytes into the encoded image object.
value - the new value.

getShort

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

setShort

public void setShort(int offset,
                     short value)
Sets the short at the specified offset
Parameters:
offset - The offset is specified in bytes into the encoded image object.
value - the new value.

getInt

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

setInt

public void setInt(int offset,
                   int value)
Sets the int at the specified offset
Parameters:
offset - The offset is specified in bytes into the encoded image object.
value - the new value.

setInts

public void setInts(int offset,
                    int[] value)
Sets an array of ints at the specified offset
Parameters:
offset - The offset is specified in bytes into the encoded image object.
value - an array of ints

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
Returns:
an int