public class Shading
extends java.lang.Object
Modifier and Type | Field and Description |
---|---|
static int |
e_axial_shading
The Constant e_axial_shading.
|
static int |
e_coons_shading
The Constant e_coons_shading.
|
static int |
e_free_gouraud_shading
The Constant e_free_gouraud_shading.
|
static int |
e_function_shading
The Constant e_function_shading.
|
static int |
e_lattice_gouraud_shading
The Constant e_lattice_gouraud_shading.
|
static int |
e_null
The Constant e_null.
|
static int |
e_radial_shading
The Constant e_radial_shading.
|
static int |
e_tensor_shading
The Constant e_tensor_shading.
|
Constructor and Description |
---|
Shading(Obj shading_dict)
Create a Shading from the given SDF/Cos object listed under /Shading
entry in the page Resource dictionary.
|
Modifier and Type | Method and Description |
---|---|
boolean |
getAntialias()
check if shading is anti-alias.
|
ColorPt |
getBackground()
An color point represented in base color space specifying a single
background color value.
|
ColorSpace |
getBaseColorSpace()
Get the base color space.
|
Rect |
getBBox()
Get the bounding box
|
ColorPt |
getColor(double t)
Get the color point from parametric varible t
|
ColorPt |
getColor(double t1,
double t2)
Get the color for the given value of the parametric variables
|
double[] |
getCoords()
Get the starting and ending coordinates of the axis, expressed in the
shading?s target coordinate space.
|
double[] |
getCoordsRadial()
Get the coords radial.
|
double[] |
getDomain()
Get the domain.
|
Matrix2D |
getMatrix()
Get the transformation matrix.
|
double |
getParamEnd()
Get the number specifying the limiting value of a parametric variable t.
|
double |
getParamStart()
Get the number specifying the limiting value of a parametric variable t.
|
Obj |
getSDFObj()
Get the SDFObj.
|
int |
getType()
Get this shading object's type
|
static int |
getType(Obj shading_dict)
Get the shading type from specifed shading object
|
boolean |
hasBackground()
Checks for background.
|
boolean |
hasBBox()
Checks for bounding box
|
boolean |
isExtendEnd()
Checks whether to extend the shading beyond the ending point of the axis
for Axial shading or ending circle for Radial shading.
|
boolean |
isExtendStart()
Checks whether to extend the shading beyond the starting point of the
axis for Axial shading or starting circle for Radial shading.
|
public static final int e_function_shading
public static final int e_axial_shading
public static final int e_radial_shading
public static final int e_free_gouraud_shading
public static final int e_lattice_gouraud_shading
public static final int e_coons_shading
public static final int e_tensor_shading
public static final int e_null
public Shading(Obj shading_dict)
shading_dict
- the shading dictionary objectpublic static int getType(Obj shading_dict) throws PDFNetException
shading_dict
- input shading dictionary objectPDFNetException
public int getType() throws PDFNetException
PDFNetException
public Obj getSDFObj()
public ColorSpace getBaseColorSpace() throws PDFNetException
PDFNetException
public boolean hasBBox() throws PDFNetException
PDFNetException
public Rect getBBox() throws PDFNetException
Note: Use HasBBox() method to determine whether the shading has a background color.
PDFNetException
public boolean hasBackground() throws PDFNetException
PDFNetException
public ColorPt getBackground() throws PDFNetException
Note: The background color is applied only when the shading is used as part of a shading pattern, not when it is painted directly with the sh operator.
Use HasBackground() method to determine whether the shading has a background color.
PDFNetException
public boolean getAntialias() throws PDFNetException
PDFNetException
public double getParamStart() throws PDFNetException
Note: the returned value corresponds to the first value in Domain array.
for shadings other than Axial or Radial this method throws an exception.
PDFNetException
public double getParamEnd() throws PDFNetException
Note: the returned value corresponds to the second value in Domain array.
for shadings other than Axial or Radial this method throws an exception.
PDFNetException
public boolean isExtendStart() throws PDFNetException
Note: for shadings other than Axial or Radial this method throws an exception.
PDFNetException
public boolean isExtendEnd() throws PDFNetException
Note: for shadings other than Axial or Radial this method throws an exception.
PDFNetException
public ColorPt getColor(double t) throws PDFNetException
Note: for shadings other than Axial or Radial this method throws an exception.
t
- parametric variable tPDFNetException
public double[] getCoords() throws PDFNetException
Note: for shadings other than Axial this method throws an exception.
PDFNetException
public double[] getCoordsRadial() throws PDFNetException
Note: for shadings other than Radial this method throws an exception.
PDFNetException
public double[] getDomain() throws PDFNetException
Note: for shadings other than Function this method throws an exception.
PDFNetException
public Matrix2D getMatrix() throws PDFNetException
Note: for shadings other than Function this method throws an exception.
PDFNetException
public ColorPt getColor(double t1, double t2) throws PDFNetException
Note: for shadings other than Function this method throws an exception.
t1
- a parametric variblet2
- a parametric variblePDFNetException