GraphicsSurface surface = new GraphicsSurface();
PiscesRenderer pr = new PiscesRenderer(surface);
void paint(Graphics g) {
surface.bindTarget(g);
//we set stroke color
pr.setColor(0xFF, 0x00, 0xAF);
// we set required Porter-Duff Compositing Rule
pr.setComposite(RendererBase.COMPOSITE_SRC_OVER);
//switch antialising on/off as required
pr.setAntialiasing(true); // on
pr.setTransform(ourTransform6Matrix);
//and now let's draw something finally
pr.beginRendering(RendererBase.WIND_EVEN_ODD);
pr.moveTo(50 << 16, 100 << 16); //
pr.lineTo(30<<16, 1<<16);
pr.endRendering();
surface.releaseTarget();
}
| Modifier and Type | Class and Description |
|---|---|
| private static class |
| Modifier and Type | Field and Description |
|---|---|
| public static final int | |
| public static final int | |
| public static final int | |
| private long | |
| private AbstractSurface |
| Access | Constructor and Description |
|---|---|
| public | PiscesRenderer(AbstractSurface
destination surface surface)Creates a renderer that will write into a given surface. |
| Modifier and Type | Method and Description |
|---|---|
| private void | |
| public void | |
| private native void | |
| private static native void | |
| public void | drawImage(int imageType, int imageMode, int[] data, int width, int height, int offset, int stride, Transform6 textureTransform, boolean repeat, boolean linearFiltering, int bboxX, int bboxY, int bboxW, int bboxH, int lEdge, int rEdge, int tEdge, int bEdge, int txMin, int tyMin, int txMax, int tyMax, boolean hasAlpha)
|
| private native void | drawImageImpl(int imageType, int imageMode, int[] data, int width, int height, int offset, int stride, Transform6 textureTransform, boolean repeat, boolean linearFiltering, int bboxX, int bboxY, int bboxW, int bboxH, int lEdge, int rEdge, int tEdge, int bEdge, int txMin, int tyMin, int txMax, int tyMax, boolean hasAlpha)
|
| public void | emitAndClearAlphaRow(byte[] alphaMap, int[] alphaDeltas, int pix_y, int pix_x_from, int pix_x_to, int rowNum)
|
| public void | emitAndClearAlphaRow(byte[] alphaMap, int[] alphaDeltas, int pix_y, int pix_x_from, int pix_x_to, int pix_x_off, int rowNum)
|
| private native void | emitAndClearAlphaRowImpl(byte[] alphaMap, int[] alphaDeltas, int pix_y, int pix_x_from, int pix_x_to, int pix_x_off, int rowNum)
|
| public void | |
| private native void | |
| public void | |
| private native void | |
| public void | |
| private native void | |
| private native void | |
| private void | |
| public void | |
| public void | |
| private native void | |
| public void | setColor(int
a value between 0 and 255. red, int a value between 0 and 255. green, int a value between 0 and 255. blue, int a value between 0 and 255. alpha)Sets the current paint color. |
| public void | setColor(int
a value between 0 and 255. red, int a value between 0 and 255. green, int a value between 0 and 255. blue)Sets the current paint color. |
| private native void | |
| public void | setCompositeRule(int
one of compositeRule)RendererBase.COMPOSITE_* constants.Sets current Compositing Rule (Porter-Duff) to be used in following rendering operation. |
| private native void | |
| public void | |
| private native void | |
| public void | setLinearGradient(int
x-coordinate of the starting point of the linear gradient x0, int
x-coordinate of the end point of the linear gradient x1, int y1, int[] this array defines normalized distances in which color (rgba[i]) starts to fade into next color (rgba[i+1]). This distance from the point [x0,y0] is given as fraction[i]*l, where l is length of line [[x0,y0], [x1,y1]]. fraction[i+1] says, in what distance fraction[i+1]*l from [x0,y0] should color already have firm value of rgba[i+1]. Values passed in fractions should be from interval <0.0, 1.0>, in 15.16 format. fractions, int[] colors which the linear gradient passes through. Generally should be fulfilled this formula rgba, int rgba.length == fractions.lengthsome value from cycleMethod, Transform6 GradientColorMap.CYCLE_*. @see GradienColorMaptransformation applied to gradient paint data. This way we can either transform gradient fill together with filled object or leave it as if transformed gradient-filled object was a window through which we observe gradient area. gradientTransform)This method sets linear color-gradient data to be used as paint data in following rendering operation. |
| public void | setLinearGradient(int
x-coordinate of the starting point of the linear gradient x0, int
x-coordinate of the end point of the linear gradient x1, int y1, GradientColorMap The GradientColorMap calculated with @see calculateLinearGradient. gradientColorMap, Transform6 transformation applied to gradient paint data. This way we can either transform gradient fill together with filled object or leave it as if transformed gradient-filled object was a window through which we observe gradient area. gradientTransform)This method sets linear color-gradient data to be used as paint data in following rendering operation. |
| public void | setLinearGradient(int
x coordinate of point P0 x0, int y coordinate of point P0 y0, int color of P0 color0, int x coordinate of point P1 x1, int y coordinate of point P1 y1, int color of P1 color1, int type of cycling of the gradient (NONE, REFLECT, REPEAT)
As Pisces Gradient support was added to support features introduced in SVG, see e.g. http://www.w3.org/TR/SVG11/pservers.html for more information and examples. cycleMethod)Java2D-style linear gradient creation. |
| private native void | setLinearGradientImpl(int x0, int y0, int x1, int y1, int[] colors, int cycleMethod, Transform6 gradientTransform)
|
| public void | setRadialGradient(int
cx, cy and radius triplet defines the largest circle for the gradient. 100% gradient stop is mapped to perimeter of this circle. cx, int cy, int fx,fy defines focal point of the gradient. ie. 0% gradient stop is mapped to fx,fy point. If cx == fx and cy == fy, then gradient consists of homocentric circles. If these relations are not met, gradient field is deformed and eccentric ovals can be observed. fx, int fy, int @see cx radius, int[] @see setLinearGradient fractions, int[] @see setLinearGradient rgba, int @see setLinearGradient cycleMethod, Transform6 @see setLinearGradient
As Pisces Gradient support was added to support features introduced in SVG, see e.g. http://www.w3.org/TR/SVG11/pservers.html for more information and examples. gradientTransform)This method sets radial gradient paint data to be used in subsequent rendering. |
| public void | setRadialGradient(int
cx, cy and radius triplet defines the largest circle for the gradient. 100% gradient stop is mapped to perimeter of this circle. cx, int cy, int fx,fy defines focal point of the gradient. ie. 0% gradient stop is mapped to fx,fy point. If cx == fx and cy == fy, then gradient consists of homocentric circles. If these relations are not met, gradient field is deformed and eccentric ovals can be observed. fx, int fy, int @see cx radius, GradientColorMap @see setLinearGradient gradientColorMap, Transform6 @see setLinearGradient
As Pisces Gradient support was added to support features introduced in SVG, see e.g. http://www.w3.org/TR/SVG11/pservers.html for more information and examples. gradientTransform)This method sets radial gradient paint data to be used in subsequent rendering. |
| private native void | setRadialGradientImpl(int cx, int cy, int fx, int fy, int radius, int[] colors, int cycleMethod, Transform6 gradientTransform)
|
| public void | setTexture(int imageType, int[] data, int width, int height, int stride, Transform6 textureTransform, boolean repeat, boolean linearFiltering, boolean hasAlpha)
|
| private native void | setTextureImpl(int imageType, int[] data, int width, int height, int stride, Transform6 textureTransform, boolean repeat, boolean linearFiltering, boolean hasAlpha)
|
| ARC_CHORD | back to summary |
|---|---|
| public static final int ARC_CHORD | |
| ARC_OPEN | back to summary |
|---|---|
| public static final int ARC_OPEN | |
| ARC_PIE | back to summary |
|---|---|
| public static final int ARC_PIE | |
| nativePtr | back to summary |
|---|---|
| private long nativePtr | |
| surface | back to summary |
|---|---|
| private AbstractSurface surface | |
| PiscesRenderer | back to summary |
|---|---|
| public PiscesRenderer(AbstractSurface surface) Creates a renderer that will write into a given surface.
| |
| checkColorRange | back to summary |
|---|---|
| private void checkColorRange(int v, String componentName) | |
| clearRect | back to summary |
|---|---|
| public void clearRect(int x, int y, int w, int h) Clears rectangle (x, y, x + w, y + h). Clear sets all pixels to transparent black (0x00000000 ARGB). | |
| clearRectImpl | back to summary |
|---|---|
| private native void clearRectImpl(int x, int y, int w, int h) | |
| disposeNative | back to summary |
|---|---|
| private static native void disposeNative(long nativeHandle) | |
| drawImage | back to summary |
|---|---|
| public void drawImage(int imageType, int imageMode, int[] data, int width, int height, int offset, int stride, Transform6 textureTransform, boolean repeat, boolean linearFiltering, int bboxX, int bboxY, int bboxW, int bboxH, int lEdge, int rEdge, int tEdge, int bEdge, int txMin, int tyMin, int txMax, int tyMax, boolean hasAlpha) | |
| drawImageImpl | back to summary |
|---|---|
| private native void drawImageImpl(int imageType, int imageMode, int[] data, int width, int height, int offset, int stride, Transform6 textureTransform, boolean repeat, boolean linearFiltering, int bboxX, int bboxY, int bboxW, int bboxH, int lEdge, int rEdge, int tEdge, int bEdge, int txMin, int tyMin, int txMax, int tyMax, boolean hasAlpha) | |
| emitAndClearAlphaRow | back to summary |
|---|---|
| public void emitAndClearAlphaRow(byte[] alphaMap, int[] alphaDeltas, int pix_y, int pix_x_from, int pix_x_to, int rowNum) | |
| emitAndClearAlphaRow | back to summary |
|---|---|
| public void emitAndClearAlphaRow(byte[] alphaMap, int[] alphaDeltas, int pix_y, int pix_x_from, int pix_x_to, int pix_x_off, int rowNum) | |
| emitAndClearAlphaRowImpl | back to summary |
|---|---|
| private native void emitAndClearAlphaRowImpl(byte[] alphaMap, int[] alphaDeltas, int pix_y, int pix_x_from, int pix_x_to, int pix_x_off, int rowNum) | |
| fillAlphaMask | back to summary |
|---|---|
| public void fillAlphaMask(byte[] mask, int x, int y, int width, int height, int offset, int stride) | |
| fillAlphaMaskImpl | back to summary |
|---|---|
| private native void fillAlphaMaskImpl(byte[] mask, int x, int y, int width, int height, int offset, int stride) | |
| fillLCDAlphaMask | back to summary |
|---|---|
| public void fillLCDAlphaMask(byte[] mask, int x, int y, int width, int height, int offset, int stride) | |
| fillLCDAlphaMaskImpl | back to summary |
|---|---|
| private native void fillLCDAlphaMaskImpl(byte[] mask, int x, int y, int width, int height, int offset, int stride) | |
| fillRect | back to summary |
|---|---|
| public void fillRect(int x, int y, int w, int h) | |
| fillRectImpl | back to summary |
|---|---|
| private native void fillRectImpl(int x, int y, int w, int h) | |
| initialize | back to summary |
|---|---|
| private native void initialize() | |
| inputImageCheck | back to summary |
|---|---|
| private void inputImageCheck(int width, int height, int offset, int stride, int data_length) | |
| resetClip | back to summary |
|---|---|
| public void resetClip() Resets the clip rectangle. Each primitive will be clipped only to the destination image bounds. | |
| setClip | back to summary |
|---|---|
| public void setClip(int minX, int minY, int width, int height) Sets a clip rectangle for all primitives. Each primitive will be clipped to the intersection of this rectangle and the destination image bounds. | |
| setClipImpl | back to summary |
|---|---|
| private native void setClipImpl(int minX, int minY, int width, int height) | |
| setColor | back to summary |
|---|---|
| public void setColor(int red, int green, int blue, int alpha) Sets the current paint color.
| |
| setColor | back to summary |
|---|---|
| public void setColor(int red, int green, int blue) Sets the current paint color. An alpha value of 255 is used. Calling
| |
| setColorImpl | back to summary |
|---|---|
| private native void setColorImpl(int red, int green, int blue, int alpha) | |
| setCompositeRule | back to summary |
|---|---|
| public void setCompositeRule(int compositeRule) Sets current Compositing Rule (Porter-Duff) to be used in following rendering operation. Note that
| |
| setCompositeRuleImpl | back to summary |
|---|---|
| private native void setCompositeRuleImpl(int compositeRule) | |
| setLCDGammaCorrection | back to summary |
|---|---|
| public void setLCDGammaCorrection(float gamma) | |
| setLCDGammaCorrectionImpl | back to summary |
|---|---|
| private native void setLCDGammaCorrectionImpl(float gamma) | |
| setLinearGradient | back to summary |
|---|---|
| public void setLinearGradient(int x0, int y0, int x1, int y1, int[] fractions, int[] rgba, int cycleMethod, Transform6 gradientTransform) This method sets linear color-gradient data to be used as paint data in following rendering operation.
Imagine, we want to draw simple gradient from blue to red color. Each pixel on line perpendicular to line L = [[x0,y0], [x1, y1]] will have same constant color.
Pixels on perpendicular-line which passes [x0, y0] will be blue. Those on line passing [x1, y1] will be red. Colors on lines in between will be interpolated by
| |
| setLinearGradient | back to summary |
|---|---|
| public void setLinearGradient(int x0, int y0, int x1, int y1, GradientColorMap gradientColorMap, Transform6 gradientTransform) This method sets linear color-gradient data to be used as paint data in following rendering operation.
Imagine, we want to draw simple gradient from blue to red color. Each pixel on line perpendicular to line L = [[x0,y0], [x1, y1]] will have same constant color.
Pixels on perpendicular-line which passes [x0, y0] will be blue. Those on line passing [x1, y1] will be red. Colors on lines in between will be interpolated by
| |
| setLinearGradient | back to summary |
|---|---|
| public void setLinearGradient(int x0, int y0, int color0, int x1, int y1, int color1, int cycleMethod) Java2D-style linear gradient creation. The color changes proportionally between point P0 (color0) nad P1 (color1). Cycle method constants are defined in GradientColorMap (CYCLE_*). This is convenience method only. Same as if setLinearGradient method with 8 parameters was called with fractions = {0x0000, 0x10000}, rgba = {color0, color1} and identity transformation matrix.
| |
| setLinearGradientImpl | back to summary |
|---|---|
| private native void setLinearGradientImpl(int x0, int y0, int x1, int y1, int[] colors, int cycleMethod, Transform6 gradientTransform) | |
| setRadialGradient | back to summary |
|---|---|
| public void setRadialGradient(int cx, int cy, int fx, int fy, int radius, int[] fractions, int[] rgba, int cycleMethod, Transform6 gradientTransform) This method sets radial gradient paint data to be used in subsequent rendering. Radial gradient data generated will be used to fill the touched pixels of the path we draw.
| |
| setRadialGradient | back to summary |
|---|---|
| public void setRadialGradient(int cx, int cy, int fx, int fy, int radius, GradientColorMap gradientColorMap, Transform6 gradientTransform) This method sets radial gradient paint data to be used in subsequent rendering. Radial gradient data generated will be used to fill the touched pixels of the path we draw.
| |
| setRadialGradientImpl | back to summary |
|---|---|
| private native void setRadialGradientImpl(int cx, int cy, int fx, int fy, int radius, int[] colors, int cycleMethod, Transform6 gradientTransform) | |
| setTexture | back to summary |
|---|---|
| public void setTexture(int imageType, int[] data, int width, int height, int stride, Transform6 textureTransform, boolean repeat, boolean linearFiltering, boolean hasAlpha) | |
| setTextureImpl | back to summary |
|---|---|
| private native void setTextureImpl(int imageType, int[] data, int width, int height, int stride, Transform6 textureTransform, boolean repeat, boolean linearFiltering, boolean hasAlpha) | |
| Modifier and Type | Field and Description |
|---|---|
| private long |
| Access | Constructor and Description |
|---|---|
| pack-priv |
| Modifier and Type | Method and Description |
|---|---|
| public void |
| nativeHandle | back to summary |
|---|---|
| private long nativeHandle | |
| PiscesRendererDisposerRecord | back to summary |
|---|---|
| pack-priv PiscesRendererDisposerRecord(long nh) | |
| dispose | back to summary |
|---|---|
| public void dispose() Implements com.
| |