public class NvrtResource extends AdjustmentLayerResource
Class NvrtResource. Resource of Invert Adjustment Layer.
AdjustmentLayerResource
,
LayerResource
An example of finding NvrtResource of an invert adjustment layer.
String inPsdFilePath = "InvertAdjustmentLayer.psd"; NvrtResource nvrtResource = null; // Load a predefined PSD containing an invert adjustment layer PsdImage psdImage = (PsdImage)Image.load(inPsdFilePath); try { // Try to find a resource of the invert adjustment layer for (Layer layer : psdImage.getLayers()) { if (layer instanceof InvertAdjustmentLayer) { for (LayerResource layerResource : layer.getResources()) { if (layerResource instanceof NvrtResource) { // The NvrtResource is found nvrtResource = (NvrtResource)layerResource; break; } } } } } finally { psdImage.dispose(); }
Modifier and Type | Field and Description |
---|---|
static int |
TypeToolKey
The type tool info key.
|
PsbResourceSignature, ResourceSignature
Constructor and Description |
---|
NvrtResource()
Initializes a new instance of the
NvrtResource class. |
NvrtResource(byte[] data)
Initializes a new instance of the
NvrtResource class. |
Modifier and Type | Method and Description |
---|---|
int |
getKey()
Gets the layer resource key.
|
int |
getLength()
Gets the layer resource length in bytes.
|
int |
getPsdVersion()
Gets the PSD version.
|
void |
save(StreamContainer streamContainer,
int psdVersion)
Saves the resource to the specified stream container.
|
getData, getSignature
toString
public static final int TypeToolKey
The type tool info key.
public NvrtResource()
Initializes a new instance of the NvrtResource
class.
public NvrtResource(byte[] data)
Initializes a new instance of the NvrtResource
class.
data
- The data of the resource.PsdImageArgumentException
- Invalid NvrtResource data.public int getKey()
Gets the layer resource key.
getKey
in class LayerResource
public int getLength()
Gets the layer resource length in bytes.
getLength
in class LayerResource
public int getPsdVersion()
Gets the PSD version.
getPsdVersion
in class LayerResource
public void save(StreamContainer streamContainer, int psdVersion)
Saves the resource to the specified stream container.
save
in class AdjustmentLayerResource
streamContainer
- The stream container to save to.psdVersion
- The PSD version.