Class ASQuad
- java.lang.Object
-
- com.adobe.internal.pdftoolkit.core.types.ASObject
-
- com.adobe.internal.pdftoolkit.core.types.ASQuad
-
public class ASQuad extends ASObject
ASQuad represents a convex quadrilateral. An ASQuad is typically used to represent a bounding box (a rectangle) which has undergone an affine transformation (e.g., scaled, rotated, skewed, etc.). In this sense, the coordinate tags (p1, p2, p3, p4) do not necessarily correspond to the actual relative location of the coordinates. Instead, they correspond to the logical corners of the object encased in the quad. For instance, a word has a natural bounding box (rectangle) with a well- defined upper-left, upper-right, lower-left, and lower-right corners. When rotated 45 degrees, the coordinates of the quad rotate with the word and the tags are considered affixed to the bounding box of the word.
-
-
Constructor Summary
Constructors Constructor Description ASQuad(ASCoordinate p1, ASCoordinate p2, ASCoordinate p3, ASCoordinate p4)
ASQuad(ASQuad quad)
Copy constructorASQuad(ASRectangle rect)
Construct a quad from a rectangle
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description double
getMaxX()
double
getMaxY()
double
getMinX()
double
getMinY()
ASCoordinate
p1()
ASCoordinate
p2()
ASCoordinate
p3()
ASCoordinate
p4()
java.lang.String
toString()
ASQuad
transform(ASMatrix ctm)
void
write(OutputByteStream outputByteStream)
Writes the ASHexString in to the given OutputStream in the format expected by the PDF Spec.
-
-
-
Constructor Detail
-
ASQuad
public ASQuad(ASCoordinate p1, ASCoordinate p2, ASCoordinate p3, ASCoordinate p4)
- Parameters:
p1
- lower-left corner relative to the object enclosed by the quadp2
- lower-right corner relative to the object enclosed by the quadp3
- upper-right corner relative to the object enclosed by the quadp4
- upper-left corner relative to the object enclosed by the quad
-
ASQuad
public ASQuad(ASRectangle rect)
Construct a quad from a rectangle- Parameters:
rect
-
-
ASQuad
public ASQuad(ASQuad quad)
Copy constructor- Parameters:
quad
-
-
-
Method Detail
-
p1
public ASCoordinate p1()
-
p2
public ASCoordinate p2()
-
p3
public ASCoordinate p3()
-
p4
public ASCoordinate p4()
-
toString
public java.lang.String toString()
- Overrides:
toString
in classjava.lang.Object
-
write
public void write(OutputByteStream outputByteStream) throws PDFIOException
Writes the ASHexString in to the given OutputStream in the format expected by the PDF Spec.- Specified by:
write
in classASObject
- Parameters:
outputByteStream
- OutputByteStream to write to.- Throws:
PDFIOException
- See Also:
ASString
-
getMinX
public double getMinX()
-
getMaxX
public double getMaxX()
-
getMinY
public double getMinY()
-
getMaxY
public double getMaxY()
-
-