|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--quicktime.util.QTByteObject | +--quicktime.qd.QDRect
This class corresponds to the Rect and FixedRect Data structures. It has a current limitation of x and y < 32767 and x+width, y+height < 32767.
The width and height values are the number of pixels that will be seen - thus if x == 1 and width is 3, the pixels drawn will be pixels at 1, 2, 3.
Field Summary | |
static int |
kIsFixedRect
These constants are used in the fromArray call to indicate which of the 2 formats the byte array is encoded in. |
static int |
kIsRect
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 | |
QDRect()
Constructs a new rectangle, with (0, 0) origin and 0 width and height |
|
QDRect(java.awt.Dimension size)
Deprecated. since QTJava 4.0 |
|
QDRect(float width,
float height)
Constructs a rectangle and initializes it with the specified width and height parameters. |
|
QDRect(float x,
float y,
float width,
float height)
Constructs and initializes a rectangle with the specified parameters. |
|
QDRect(int width,
int height)
Constructs a rectangle and initializes it with the specified width and height parameters. |
|
QDRect(int x,
int y,
int width,
int height)
Constructs and initializes a rectangle with the specified parameters. |
|
QDRect(java.awt.Point origin)
Deprecated. since QTJava 4.0 |
|
QDRect(java.awt.Point origin,
java.awt.Dimension size)
Deprecated. since QTJava 4.0 |
|
QDRect(QDDimension size)
Constructs a QDRect with an origin of 0,0 and specified size. |
|
QDRect(QDPoint origin)
Constructs a QDRect with an origin specified and 0 width and height. |
|
QDRect(QDPoint origin,
QDDimension size)
Constructs a QDRect with an origin and size specified. |
|
QDRect(java.awt.Rectangle rect)
Deprecated. since QTJava 4.0 |
Method Summary | |
void |
add(float newX,
float newY)
Adds a point to the QDRect. |
void |
add(int newX,
int newY)
Adds a point to the QDRect. |
void |
add(java.awt.Point pt)
Deprecated. as of QTJava 4.0 |
void |
add(QDPoint pt)
Adds a QDPoint to the QDRect. |
java.lang.Object |
clone()
Return a copy of the QDRect |
QDRect |
copy()
Returns a copy of the QDRect with the correct return type. |
boolean |
equals(java.lang.Object obj)
Checks whether two QDRects are equal. |
static QDRect |
fromArray(byte[] rectBytes,
int flag)
Creates a QDRect from an array of bytes. |
static EndianDescriptor |
getEndianDescriptorFixedRect()
Returns the EndianDescriptor for FixedRect Rect. |
static EndianDescriptor |
getEndianDescriptorRect()
Returns the EndianDescriptor for QDRect Rect. |
byte[] |
getFixedRect()
Returns the bytes for the FixedRect |
int |
getHeight()
Get the height of the QDRect. |
float |
getHeightF()
Get the height of the QDRect. |
byte[] |
getRect()
Returns the bytes for the QDRect |
int |
getWidth()
Get the width of the QDRect. |
float |
getWidthF()
Get the width of the QDRect. |
int |
getX()
Get the x location of the rect. |
float |
getXF()
Get the x location of the rect. |
int |
getY()
Get the y location of the rect. |
float |
getYF()
Get the y location of the rect. |
void |
grow(float h,
float v)
Grows the QDRect horizontally and vertically. |
void |
grow(int h,
int v)
Grows the QDRect horizontally and vertically. |
int |
hashCode()
Returns the hashcode for this Rectangle. |
boolean |
inside(float x,
float y)
Checks if the specified point lies inside a QDRect. |
boolean |
inside(int x,
int y)
Checks if the specified point lies inside a QDRect. |
QDRect |
intersection(QDRect r)
Computes the intersection of two QDRects, returning the largets rect that encompasses both rects. |
boolean |
intersects(QDRect r)
Checks if two QDRects intersect. |
boolean |
isDifferentOrigin(QDRect rect)
Returns true if the QDRect argument has a different origin. |
boolean |
isDifferentSize(QDRect rect)
Returns true if the QDRect argument is a different size. |
boolean |
isEmpty()
Determines whether the QDRect is empty. |
void |
move(float x,
float y)
Moves the QDRect to x, y. |
void |
move(int x,
int y)
Moves the QDRect to x, y. |
void |
reshape(float x,
float y,
float width,
float height)
Reshapes the QDRect to x, y, width and height. |
void |
reshape(int x,
int y,
int width,
int height)
Reshapes the QDRect to x, y, width and height. |
void |
resize(float width,
float height)
Resizes the QDRect. |
void |
resize(int width,
int height)
Resizes the QDRect. |
void |
setHeight(float height)
Set the height of the QDRect. |
void |
setHeight(int height)
Set the height of the QDRect. |
void |
setWidth(float width)
Set the width of the QDRect. |
void |
setWidth(int width)
Set the width of the QDRect. |
void |
setX(float x)
Set the x location of the rect. |
void |
setX(int x)
Set the x location of the rect. |
void |
setY(float y)
Set the y location of the rect. |
void |
setY(int y)
Set the y location of the rect. |
java.lang.String |
toString()
Returns the String representation of this QDRect's values. |
void |
translate(float deltaX,
float deltaY)
Translates the QDRect deltaX and deltaY. |
void |
translate(int deltaX,
int deltaY)
Translates the QDRect deltaX and deltaY. |
QDRect |
union(QDRect r)
Computes the union of two QDRects, returning the smallest Rect that is the union of the two QDRects. |
Methods inherited from class quicktime.util.QTByteObject |
fromArray, getBytes, getSize |
Methods inherited from class java.lang.Object |
getClass, notify, notifyAll, wait, wait, wait |
Field Detail |
public static final int kIsRect
public static final int kIsFixedRect
Constructor Detail |
public QDRect()
public QDRect(int x, int y, int width, int height)
x
- the x coordinatey
- the y coordinatewidth
- the width of the rectangleheight
- the height of the rectanglepublic QDRect(float x, float y, float width, float height)
x
- the x coordinatey
- the y coordinatewidth
- the width of the rectangleheight
- the height of the rectanglepublic QDRect(int width, int height)
width
- the width of the rectangleheight
- the height of the rectanglepublic QDRect(float width, float height)
width
- the width of the rectangleheight
- the height of the rectanglepublic QDRect(QDPoint origin)
origin
- the origin point of the QDRectpublic QDRect(java.awt.Point origin)
origin
- the origin point of the QDRectQDRect( QDPoint )
public QDRect(QDDimension size)
size
- the size of the QDRect.public QDRect(java.awt.Dimension size)
size
- the size of the QDRect.QDRect(QDDimension)
public QDRect(java.awt.Rectangle rect)
rect
- the Rectanglepublic QDRect(QDPoint origin, QDDimension size)
origin
- the origin point of the QDRectsize
- the size of the QDRect.public QDRect(java.awt.Point origin, java.awt.Dimension size)
origin
- the origin point of the QDRectsize
- the size of the QDRect.QDRect(QDPoint, QDDimension)
Method Detail |
public static final EndianDescriptor getEndianDescriptorFixedRect()
public static final EndianDescriptor getEndianDescriptorRect()
public static QDRect fromArray(byte[] rectBytes, int flag)
rectBytes
- the byte array containing the rect valuesflag
- flag that describes the format of the byte arrayjava.lang.IllegalArgumentException
- if mismatch between minimum length of byte array and format flagpublic byte[] getRect()
public byte[] getFixedRect()
public int getX()
public float getXF()
public void setX(int x)
x
- the new x locationpublic void setX(float x)
x
- the new x locationpublic int getY()
public float getYF()
public void setY(int y)
y
- the new y locationpublic void setY(float y)
y
- the new y locationpublic boolean isDifferentSize(QDRect rect)
public boolean isDifferentOrigin(QDRect rect)
public int getWidth()
public float getWidthF()
public void setWidth(int width)
width
- the new widthpublic void setWidth(float width)
width
- the new widthpublic int getHeight()
public float getHeightF()
public void setHeight(int height)
height
- the new heightpublic void setHeight(float height)
height
- the new heightpublic void reshape(int x, int y, int width, int height)
public void reshape(float x, float y, float width, float height)
public void move(int x, int y)
public void move(float x, float y)
public void translate(int deltaX, int deltaY)
public void translate(float deltaX, float deltaY)
public void resize(int width, int height)
public void resize(float width, float height)
public boolean inside(int x, int y)
x
- the x coordinatey
- the y coordinatepublic boolean inside(float x, float y)
x
- the x coordinatey
- the y coordinatepublic boolean intersects(QDRect r)
public QDRect intersection(QDRect r)
r
- the rect to intersect withpublic QDRect union(QDRect r)
r
- the rect to unify with thispublic void add(int newX, int newY)
public void add(float newX, float newY)
public void add(java.awt.Point pt)
pt
- the Point to addadd(QDPoint)
public void add(QDPoint pt)
pt
- the QDPoint to addpublic void grow(int h, int v)
public void grow(float h, float v)
public boolean isEmpty()
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class QTByteObject
public java.lang.String toString()
toString
in class QTByteObject
public java.lang.Object clone()
public QDRect copy()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |