quicktime.qd
Class QDPoint

java.lang.Object
  |
  +--quicktime.qd.QDPoint
All Implemented Interfaces:
java.lang.Cloneable, quicktime.jdirect.PrimitivesLib, quicktime.jdirect.SharedLibrary, com.apple.jdirect.SharedLibrary

public final class QDPoint
extends java.lang.Object
implements quicktime.jdirect.PrimitivesLib, java.lang.Cloneable


Field Summary
static int kIsFixedPoint
          These constants are used in the fromArray call to indicate which of the 2 formats the byte array is encoded in.
static int kIsGXPoint
          These constants are used in the fromArray call to indicate which of the 2 formats the byte array is encoded in.
static int kIsQ3Point2D
          These constants are used in the fromArray call to indicate which of the 2 formats the byte array is encoded in.
static int kIsQTVRFloatPoint
          These constants are used in the fromArray call to indicate which of the 2 formats the byte array is encoded in.
 
Fields inherited from interface quicktime.jdirect.PrimitivesLib
JDirect_MacOSX, libraryInstance
 
Constructor Summary
QDPoint(float x, float y)
          Create a QDPoint at specified location
QDPoint(int x, int y)
          Create a QDPoint at specified location
QDPoint(java.awt.Point origin)
          Deprecated. As of QTJava v 4.0
 
Method Summary
 java.lang.Object clone()
          Return a copy of the QDPoint
 QDPoint copy()
          Returns a copy of the QDPoint with the correct return type.
 boolean equals(java.lang.Object obj)
          Checks whether two int points are equal.
static QDPoint fromArray(byte[] ptBytes, int ptType)
          Creates a QDPoint from an array of bytes that represent a FixedPoint, so the byte array must be 8bytes long at least.
static QDPoint fromArray(byte[] ptBytes, int ptType, int offset)
          Creates a QDPoint from an array of bytes that represent a FixedPoint, so the byte array must be 8bytes long at least.
static EndianDescriptor getEndianDescriptorFixedPoint()
          Returns the EndianDescriptor for FixedPoint point.
static EndianDescriptor getEndianDescriptorQTVRFloatPoint()
          Returns the EndianDescriptor for TQ3Point2D point.
static EndianDescriptor getEndianDescriptorTQ3Point2D()
          Returns the EndianDescriptor for TQ3Point2D point.
 byte[] getFixedPoint()
          Returns a byte array that contains the packed value of a FixedPoint
 byte[] getGXPoint()
          Returns a byte array that contains the packed value of a GXPoint
 int getPoint()
          Returns the QDPoint packed into a 32bit integer
 byte[] getQ3Point2D()
          Returns a byte array that contains the packed value of a 3Point2D
 byte[] getQTVRFloatPoint()
          Returns a byte array that contains the packed value of a QTVRFloatPoint
 int getX()
          Get the x location of the point.
 float getXF()
          Get the x location of the point.
 int getY()
          Get the y location of the point.
 float getYF()
          Get the y location of the point.
 void move(float x, float y)
          Moves the point, to coordinates x, y.
 void move(int x, int y)
          Moves the point, to coordinates x, y.
 void setX(float x)
          Set the x location of the point.
 void setX(int x)
          Set the x location of the point.
 void setY(float y)
          Set the y location of the point.
 void setY(int y)
          Set the y location of the point.
 java.lang.String toString()
          Returns the String representation of this QDPoint's coordinate.
 void translate(float deltaX, float deltaY)
          Translates the point, by deltaX and deltaY.
 void translate(int deltaX, int deltaY)
          Translates the point, by deltaX and deltaY.
 
Methods inherited from class java.lang.Object
getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

kIsFixedPoint

public static final int kIsFixedPoint
These constants are used in the fromArray call to indicate which of the 2 formats the byte array is encoded in.

kIsGXPoint

public static final int kIsGXPoint
These constants are used in the fromArray call to indicate which of the 2 formats the byte array is encoded in.

kIsQ3Point2D

public static final int kIsQ3Point2D
These constants are used in the fromArray call to indicate which of the 2 formats the byte array is encoded in.

kIsQTVRFloatPoint

public static final int kIsQTVRFloatPoint
These constants are used in the fromArray call to indicate which of the 2 formats the byte array is encoded in.
Constructor Detail

QDPoint

public QDPoint(int x,
               int y)
Create a QDPoint at specified location
Parameters:
x - x location
y - y location

QDPoint

public QDPoint(float x,
               float y)
Create a QDPoint at specified location
Parameters:
x - x location
y - y location

QDPoint

public QDPoint(java.awt.Point origin)
Deprecated. As of QTJava v 4.0

Create a QDPoint at specified location
Parameters:
point - location of point
Method Detail

getEndianDescriptorFixedPoint

public static final EndianDescriptor getEndianDescriptorFixedPoint()
Returns the EndianDescriptor for FixedPoint point.
Returns:
an EndianDescriptor

getEndianDescriptorTQ3Point2D

public static final EndianDescriptor getEndianDescriptorTQ3Point2D()
Returns the EndianDescriptor for TQ3Point2D point.
Returns:
an EndianDescriptor

getEndianDescriptorQTVRFloatPoint

public static final EndianDescriptor getEndianDescriptorQTVRFloatPoint()
Returns the EndianDescriptor for TQ3Point2D point.
Returns:
an EndianDescriptor

fromArray

public static QDPoint fromArray(byte[] ptBytes,
                                int ptType)
Creates a QDPoint from an array of bytes that represent a FixedPoint, so the byte array must be 8bytes long at least.
Parameters:
ptBytes - the byte array containing the packed point values
ptType - the type of point to be found in the array
Returns:
a QDPoint
Throws:
java.lang.IllegalArgumentException - if mismatch between minimum length of byte array and format flag

fromArray

public static QDPoint fromArray(byte[] ptBytes,
                                int ptType,
                                int offset)
Creates a QDPoint from an array of bytes that represent a FixedPoint, so the byte array must be 8bytes long at least.
Parameters:
ptBytes - the byte array containing the packed point values
ptType - the type of point to be found in the array
offset - the offset in the array where the point is to be found
Returns:
a QDPoint
Throws:
java.lang.IllegalArgumentException - if mismatch between minimum length of byte array and format flag

getPoint

public int getPoint()
Returns the QDPoint packed into a 32bit integer

getGXPoint

public byte[] getGXPoint()
Returns a byte array that contains the packed value of a GXPoint

getFixedPoint

public byte[] getFixedPoint()
Returns a byte array that contains the packed value of a FixedPoint

getQ3Point2D

public byte[] getQ3Point2D()
Returns a byte array that contains the packed value of a 3Point2D

getQTVRFloatPoint

public byte[] getQTVRFloatPoint()
Returns a byte array that contains the packed value of a QTVRFloatPoint

getX

public int getX()
Get the x location of the point.
Returns:
the current x location

getXF

public float getXF()
Get the x location of the point.
Returns:
the current x location

setX

public void setX(int x)
Set the x location of the point.
Parameters:
x - the new x location

setX

public void setX(float x)
Set the x location of the point.
Parameters:
x - the new x location

getY

public int getY()
Get the y location of the point.
Returns:
the current y location

getYF

public float getYF()
Get the y location of the point.
Returns:
the current y location

setY

public void setY(int y)
Set the y location of the point.
Parameters:
y - the new y location

setY

public void setY(float y)
Set the y location of the point.
Parameters:
y - the new y location

translate

public void translate(int deltaX,
                      int deltaY)
Translates the point, by deltaX and deltaY.

translate

public void translate(float deltaX,
                      float deltaY)
Translates the point, by deltaX and deltaY.

move

public void move(int x,
                 int y)
Moves the point, to coordinates x, y.

move

public void move(float x,
                 float y)
Moves the point, to coordinates x, y.

equals

public boolean equals(java.lang.Object obj)
Checks whether two int points are equal.
Overrides:
equals in class java.lang.Object

toString

public java.lang.String toString()
Returns the String representation of this QDPoint's coordinate.
Overrides:
toString in class java.lang.Object

clone

public java.lang.Object clone()
Return a copy of the QDPoint
Returns:
a QDPoint

copy

public QDPoint copy()
Returns a copy of the QDPoint with the correct return type.
Returns:
a QDPoint