public final class AdobePathWriter extends Object
Shape object to an Adobe Photoshop Path or Path resource.| Constructor and Description |
|---|
AdobePathWriter(Shape path)
Creates an AdobePathWriter for the given path.
|
| Modifier and Type | Method and Description |
|---|---|
byte[] |
writePath()
Transforms the path to a byte array, containing a set of Adobe Photoshop path segments.
|
void |
writePath(DataOutput output)
Writes the path as a set of Adobe Photoshop path segments to the given stream.
|
byte[] |
writePathResource(int resourceId)
Transforms the path to a byte array, containing a complete Adobe Photoshop path resource.
|
void |
writePathResource(int resourceId,
DataOutput output)
Writes the path as a complete Adobe Photoshop clipping path resource to the given stream.
|
public AdobePathWriter(Shape path)
NOTE: Photoshop paths are stored with the coordinates (0,0) representing the top left corner of the image, and (1,1) representing the bottom right corner, regardless of image dimensions.
path - A Shape instance that has WIND_EVEN_ODD rule,
is contained within the rectangle [x=0.0,y=0.0,w=1.0,h=1.0], and is closed.IllegalArgumentException - if path is null,
the paths winding rule is not @link Path2D#WIND_EVEN_ODD} or
the paths bounding box is outside [x=0.0,y=0.0,w=1.0,h=1.0] or
the path is not closed.public void writePathResource(int resourceId,
DataOutput output)
throws IOException
resourceId - the resource id, typically PSD.RES_CLIPPING_PATH (0x07D0).output - the stream to write to.IOException - if an I/O exception happens during writing.public void writePath(DataOutput output) throws IOException
output - the stream to write to.IOException - if an I/O exception happens during writing.public byte[] writePathResource(int resourceId)
resourceId - the resource id, typically PSD.RES_CLIPPING_PATH (0x07D0).public byte[] writePath()
Copyright © 2023. All rights reserved.