|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--quicktime.QTObject | +--quicktime.util.QTHandleRef
A QTHandleRef is a "smart" handle in that it can be either a Reference to a handle which is not disposable, or it can be a real "independent" handle which is automatically disposed on finalization. This class is used as a generic base class for handle based objects. See QTHandle for a user-level handle object.
The default setting is for the Handle to be disposable - subclasses must use the
QTHandleRef(int, Object) constructor to create a non-disposable reference
For non-disposable handles there are two situations to look out for:
(1) Upon finalization the handle should NOT be disposed - it belongs to a parent struct
(2) The parent object from which the handle is obtained should not be allowed to
go away whilst the reference object is alive.
In both situations we must maintain a reference to the parent or owner object.
When defining a clone operation subclasses should define it as:
public Object clone() { return new QTHandleSubclass (makeAndCopyHandle (), null); }
Fields inherited from interface quicktime.jdirect.QuickTimeLib |
JDirect_MacOSX, libraryInstance, name |
Method Summary | |
void |
copyFromArray(int handleOffset,
byte[] srcArray,
int srcOffset,
int length)
An efficient byte[] copy that copies length bytes from the byte array to the handle. |
void |
copyFromArray(int handleOffset,
char[] srcArray,
int srcOffset,
int length)
An efficient char[] copy that copies length chars from the byte array to the handle. |
void |
copyFromArray(int handleOffset,
double[] srcArray,
int srcOffset,
int length)
An efficient double[] copy that copies length doubles from the byte array to the handle. |
void |
copyFromArray(int handleOffset,
float[] srcArray,
int srcOffset,
int length)
An efficient float[] copy that copies length floats from the byte array to the handle. |
void |
copyFromArray(int handleOffset,
int[] srcArray,
int srcOffset,
int length)
An efficient int[] copy that copies length ints from the byte array to the handle. |
void |
copyFromArray(int handleOffset,
long[] srcArray,
int srcOffset,
int length)
An efficient long[] copy that copies length longs from the byte array to the handle. |
void |
copyFromArray(int handleOffset,
short[] srcArray,
int srcOffset,
int length)
An efficient short[] copy that copies length shorts from the byte array to the handle. |
void |
copyToArray(int handleOffset,
byte[] destArray,
int destOffset,
int length)
An efficient byte[] copy that copies length bytes from the handle to the byte array. |
void |
copyToArray(int handleOffset,
char[] destArray,
int destOffset,
int length)
An efficient char[] copy that copies length chars from the handle to the char array. |
void |
copyToArray(int handleOffset,
double[] destArray,
int destOffset,
int length)
An efficient double[] copy that copies length doubles from the handle to the double array. |
void |
copyToArray(int handleOffset,
float[] destArray,
int destOffset,
int length)
An efficient float[] copy that copies length floats from the handle to the float array. |
void |
copyToArray(int handleOffset,
int[] destArray,
int destOffset,
int length)
An efficient int[] copy that copies length ints from the handle to the int array. |
void |
copyToArray(int handleOffset,
long[] destArray,
int destOffset,
int length)
An efficient long[] copy that copies length longs from the handle to the long array. |
void |
copyToArray(int handleOffset,
short[] destArray,
int destOffset,
int length)
An efficient short[] copy that copies length shorts from the handle to the short array. |
static QTHandleRef |
fromCompressionDialogState(CompressionDialog cd)
Retrieves all of the settings for a dialog. |
static SCInfo |
fromSCSequence(SCSequence sc,
QDGraphics src,
QDRect srcRect)
Compresses a frame that is sourced by a PixMap from the supplied QDGraphics, returning the compressed data. |
byte[] |
getBytes()
Returns a copy of the data of the handle as a byte array |
int |
getSize()
This method returns the size (number of bytes) of the handle QuickTime::GetHandleSize |
boolean |
inMemory()
checks this handles purgedness |
boolean |
isLocked()
Returns true if the handle is locked otherwise false. |
void |
lock()
Locks the relocatable block. |
void |
lockHigh()
Moves the relocatable block to the top of the heap and locks it. |
void |
moveHigh()
Move the handle to high memory. |
QTPointerRef |
toQTPointer()
Locks the handle and returns a pointer object. |
QTPointerRef |
toQTPointer(int offset,
int size)
Locks the handle and returns a pointer object. |
java.lang.String |
toString()
A String representation of the class. |
void |
unlock()
Unlocks the relocatable block. |
Methods inherited from class quicktime.QTObject |
disposeQTObject, equals, ID |
Methods inherited from class java.lang.Object |
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Method Detail |
public static SCInfo fromSCSequence(SCSequence sc, QDGraphics src, QDRect srcRect) throws QTException
src
- the PixMap's source QDGraphics.srcRect
- you can specify to compress just a part of the pix map by specifying
a rectangle - or pass in null to compress the entire pix map.public static QTHandleRef fromCompressionDialogState(CompressionDialog cd) throws QTException
CompressionDialog.getInfoState()
public int getSize()
public byte[] getBytes()
public final void copyToArray(int handleOffset, byte[] destArray, int destOffset, int length)
handleOffset
- the byte offset from the handle to copy the bytes fromdestArray
- the destination byte arraydestOffset
- the offset within the byte array to start copying tolength
- the number of bytes to copypublic final void copyToArray(int handleOffset, short[] destArray, int destOffset, int length)
handleOffset
- the byte offset from the handle to copy the shorts fromdestArray
- the destination short arraydestOffset
- the offset within the short array to start copying tolength
- the number of shorts to copypublic final void copyToArray(int handleOffset, char[] destArray, int destOffset, int length)
handleOffset
- the byte offset from the handle to copy the chars fromdestArray
- the destination char arraydestOffset
- the offset within the char array to start copying tolength
- the number of chars to copypublic final void copyToArray(int handleOffset, int[] destArray, int destOffset, int length)
handleOffset
- the byte offset from the handle to copy the ints fromdestArray
- the destination int arraydestOffset
- the offset within the int array to start copying tolength
- the number of ints to copypublic final void copyToArray(int handleOffset, float[] destArray, int destOffset, int length)
handleOffset
- the byte offset from the handle to copy the floats fromdestArray
- the destination float arraydestOffset
- the offset within the float array to start copying tolength
- the number of floats to copypublic final void copyToArray(int handleOffset, long[] destArray, int destOffset, int length)
handleOffset
- the byte offset from the handle to copy the longs fromdestArray
- the destination long arraydestOffset
- the offset within the long array to start copying tolength
- the number of longs to copypublic final void copyToArray(int handleOffset, double[] destArray, int destOffset, int length)
handleOffset
- the byte offset from the handle to copy the doubles fromdestArray
- the destination double arraydestOffset
- the offset within the double array to start copying tolength
- the number of doubles to copypublic final void copyFromArray(int handleOffset, byte[] srcArray, int srcOffset, int length)
handleOffset
- how many bytes offset from the base handle to copy to.srcArray
- the byte[] to copysrcOffset
- the nth index within the byte [] to start copying fromlength
- how many elements of the byte array to copypublic final void copyFromArray(int handleOffset, short[] srcArray, int srcOffset, int length)
handleOffset
- how many bytes offset from the base handle to copy to.srcArray
- the short[] to copysrcOffset
- the nth index within the short array to start copying fromlength
- how many elements of the short array to copypublic final void copyFromArray(int handleOffset, char[] srcArray, int srcOffset, int length)
handleOffset
- how many bytes offset from the base handle to copy to.srcArray
- the char[] to copysrcOffset
- the nth index within the char array to start copying fromlength
- how many elements of the char array to copypublic final void copyFromArray(int handleOffset, int[] srcArray, int srcOffset, int length)
handleOffset
- how many bytes offset from the base handle to copy to.srcArray
- the int[] to copysrcOffset
- the nth index within the int array to start copying fromlength
- how many elements of the int array to copypublic final void copyFromArray(int handleOffset, float[] srcArray, int srcOffset, int length)
handleOffset
- how many bytes offset from the base handle to copy to.srcArray
- the float[] to copysrcOffset
- the nth index within the float array to start copying fromlength
- how many elements of the float array to copypublic final void copyFromArray(int handleOffset, long[] srcArray, int srcOffset, int length)
handleOffset
- how many bytes offset from the base handle to copy to.srcArray
- the long[] to copysrcOffset
- the nth index within the long array to start copying fromlength
- how many elements of the long array to copypublic final void copyFromArray(int handleOffset, double[] srcArray, int srcOffset, int length)
handleOffset
- how many bytes offset from the base handle to copy to.srcArray
- the double[] to copysrcOffset
- the nth index within the double array to start copying fromlength
- how many elements of the double array to copypublic boolean inMemory()
public final boolean isLocked()
public final void lock()
public final void unlock()
public void lockHigh()
public final void moveHigh()
public java.lang.String toString()
toString
in class QTObject
public QTPointerRef toQTPointer()
public QTPointerRef toQTPointer(int offset, int size)
offset
- the number of bytes to offset within the handlesize
- the number of bytes the pointer has valid access to.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |