Package org.apache.fop.render.gradient
Class Shading
- java.lang.Object
-
- org.apache.fop.render.gradient.Shading
-
public class Shading extends java.lang.Object
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
Shading.FunctionRenderer
-
Field Summary
Fields Modifier and Type Field Description private boolean
antiAlias
Optional: A flag whether or not to filter the shading function to prevent aliasing artifacts.private int
bitsPerComponent
Required for Type 4,5,6, and 7: Specifies the number of bits used to represent each color coordinate.private int
bitsPerCoordinate
Required for Type 4,5,6, and 7: Specifies the number of bits used to represent each vertex coordinate.private int
bitsPerFlag
Required for Type 4,5,6, and 7: Specifies the number of bits used to represent the edge flag for each vertex.private PDFDeviceColorSpace
colorSpace
A ColorSpace representing the colorspace.private java.util.List<java.lang.Double>
coords
Required for Type 2: An Array of four numbers specifying the starting and ending coordinate pairs Required for Type 3: An Array of six numbers [x0,y0,r0,x1,y1,r1] specifying the centers and radii of the starting and ending circles.private java.util.List<java.lang.Boolean>
extend
Required for Type 2+3: An Array of two boolean values specifying whether to extend the start and end colors past the start and end points, respectively.private Function
function
Required for Type 1, 2, and 3: The object of the color mapping function (usually type 2 or 3).private int
shadingType
Required: The Type of shading (1,2,3,4,5,6,7)private int
verticesPerRow
Required for Type 5:The number of vertices in each "row" of the lattice; it must be greater than or equal to 2.
-
Constructor Summary
Constructors Constructor Description Shading(int shadingType, PDFDeviceColorSpace colorSpace, java.util.List<java.lang.Double> coords, Function function)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getBitsPerComponent()
int
getBitsPerCoordinate()
int
getBitsPerFlag()
PDFDeviceColorSpace
getColorSpace()
java.util.List<java.lang.Double>
getCoords()
java.util.List<java.lang.Boolean>
getExtend()
Function
getFunction()
int
getShadingType()
int
getVerticesPerRow()
boolean
isAntiAlias()
void
output(java.lang.StringBuilder out, GradientMaker.DoubleFormatter doubleFormatter, Shading.FunctionRenderer functionRenderer)
private void
outputFunction(java.lang.StringBuilder out, Shading.FunctionRenderer functionRenderer)
private void
outputShadingType1(java.lang.StringBuilder out, GradientMaker.DoubleFormatter doubleFormatter, Shading.FunctionRenderer functionRenderer)
private void
outputShadingType2or3(java.lang.StringBuilder out, GradientMaker.DoubleFormatter doubleFormatter, Shading.FunctionRenderer functionRenderer)
private void
outputShadingType4or6or7(java.lang.StringBuilder out, GradientMaker.DoubleFormatter doubleFormatter, Shading.FunctionRenderer functionRenderer)
private void
outputShadingType5(java.lang.StringBuilder out, GradientMaker.DoubleFormatter doubleFormatter, Shading.FunctionRenderer functionRenderer)
-
-
-
Field Detail
-
shadingType
private final int shadingType
Required: The Type of shading (1,2,3,4,5,6,7)
-
colorSpace
private final PDFDeviceColorSpace colorSpace
A ColorSpace representing the colorspace. "DeviceRGB" is an example.
-
coords
private final java.util.List<java.lang.Double> coords
Required for Type 2: An Array of four numbers specifying the starting and ending coordinate pairs Required for Type 3: An Array of six numbers [x0,y0,r0,x1,y1,r1] specifying the centers and radii of the starting and ending circles.
-
function
private final Function function
Required for Type 1, 2, and 3: The object of the color mapping function (usually type 2 or 3). Optional for Type 4,5,6, and 7: When it's nearly the same thing.
-
extend
private final java.util.List<java.lang.Boolean> extend
Required for Type 2+3: An Array of two boolean values specifying whether to extend the start and end colors past the start and end points, respectively. Default is false, false.
-
bitsPerCoordinate
private final int bitsPerCoordinate
Required for Type 4,5,6, and 7: Specifies the number of bits used to represent each vertex coordinate. Allowed to be 1,2,4,8,12,16,24, or 32.
-
bitsPerFlag
private final int bitsPerFlag
Required for Type 4,5,6, and 7: Specifies the number of bits used to represent the edge flag for each vertex. Allowed to be 2,4,or 8, while the Edge flag itself is allowed to be 0,1 or 2.
-
antiAlias
private final boolean antiAlias
Optional: A flag whether or not to filter the shading function to prevent aliasing artifacts. Default is false.
-
bitsPerComponent
private final int bitsPerComponent
Required for Type 4,5,6, and 7: Specifies the number of bits used to represent each color coordinate. Allowed to be 1,2,4,8,12, or 16
-
verticesPerRow
private final int verticesPerRow
Required for Type 5:The number of vertices in each "row" of the lattice; it must be greater than or equal to 2.
-
-
Constructor Detail
-
Shading
public Shading(int shadingType, PDFDeviceColorSpace colorSpace, java.util.List<java.lang.Double> coords, Function function)
-
-
Method Detail
-
getShadingType
public int getShadingType()
-
getColorSpace
public PDFDeviceColorSpace getColorSpace()
-
getCoords
public java.util.List<java.lang.Double> getCoords()
-
getFunction
public Function getFunction()
-
getExtend
public java.util.List<java.lang.Boolean> getExtend()
-
getBitsPerCoordinate
public int getBitsPerCoordinate()
-
getBitsPerFlag
public int getBitsPerFlag()
-
isAntiAlias
public boolean isAntiAlias()
-
getBitsPerComponent
public int getBitsPerComponent()
-
getVerticesPerRow
public int getVerticesPerRow()
-
output
public void output(java.lang.StringBuilder out, GradientMaker.DoubleFormatter doubleFormatter, Shading.FunctionRenderer functionRenderer)
-
outputShadingType1
private void outputShadingType1(java.lang.StringBuilder out, GradientMaker.DoubleFormatter doubleFormatter, Shading.FunctionRenderer functionRenderer)
-
outputShadingType2or3
private void outputShadingType2or3(java.lang.StringBuilder out, GradientMaker.DoubleFormatter doubleFormatter, Shading.FunctionRenderer functionRenderer)
-
outputShadingType4or6or7
private void outputShadingType4or6or7(java.lang.StringBuilder out, GradientMaker.DoubleFormatter doubleFormatter, Shading.FunctionRenderer functionRenderer)
-
outputShadingType5
private void outputShadingType5(java.lang.StringBuilder out, GradientMaker.DoubleFormatter doubleFormatter, Shading.FunctionRenderer functionRenderer)
-
outputFunction
private void outputFunction(java.lang.StringBuilder out, Shading.FunctionRenderer functionRenderer)
-
-