Package org.openpdf.renderer.pattern
Class ShaderType2.Type2PaintContext
java.lang.Object
org.openpdf.renderer.pattern.ShaderType2.Type2PaintContext
- All Implemented Interfaces:
PaintContext
- Enclosing class:
- ShaderType2
A simple paint context that uses an existing raster in device
space to generate pixels
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate ColorModelthe color modelprivate floatprivate doubleprivate doubleprivate Point2Dthe end of the axisprivate doubleprivate Point2Dthe start of the axis -
Constructor Summary
ConstructorsConstructorDescriptionType2PaintContext(ColorModel colorModel, Point2D start, Point2D end) Create a paint context -
Method Summary
Modifier and TypeMethodDescriptionvoiddispose()getRaster(int x, int y, int w, int h) private floatgetT(float xp) t = t0 + (t1 - t0) x x'private floatgetXPrime(float x, float y, float x0, float y0) x' = (x1 - x0) * (x - x0) + (y1 - y0) * (y - y0) ------------------------------------------- (x1 - x0)^2 + (y1 - y0)^2
-
Field Details
-
colorModel
the color model -
start
the start of the axis -
end
the end of the axis -
dt1t0
private float dt1t0 -
dx1x0
private double dx1x0 -
dy1y0
private double dy1y0 -
sqdx1x0psqdy1y0
private double sqdx1x0psqdy1y0
-
-
Constructor Details
-
Type2PaintContext
Type2PaintContext(ColorModel colorModel, Point2D start, Point2D end) Create a paint context
-
-
Method Details
-
dispose
public void dispose()- Specified by:
disposein interfacePaintContext
-
getColorModel
- Specified by:
getColorModelin interfacePaintContext
-
getRaster
- Specified by:
getRasterin interfacePaintContext
-
getXPrime
private float getXPrime(float x, float y, float x0, float y0) x' = (x1 - x0) * (x - x0) + (y1 - y0) * (y - y0) ------------------------------------------- (x1 - x0)^2 + (y1 - y0)^2 -
getT
private float getT(float xp) t = t0 + (t1 - t0) x x'
-