Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
java.awt.image.Raster
java.awt.image.WritableRaster
gnu.java.awt.peer.gtk.CairoSurface
public class CairoSurface
extends WritableRaster
Field Summary |
Fields inherited from class java.awt.image.Raster | |
dataBuffer , height , minX , minY , numBands , numDataElements , parent , sampleModel , sampleModelTranslateX , sampleModelTranslateY , width |
Constructor Summary | |
| |
| |
|
Method Summary | |
void |
|
protected static SampleModel |
|
Raster |
|
WritableRaster | |
WritableRaster |
|
Raster |
|
WritableRaster |
|
WritableRaster |
|
void |
|
protected void |
|
static BufferedImage |
|
static BufferedImage |
|
static BufferedImage |
|
int[] |
|
Graphics2D |
|
GtkImage |
|
static boolean |
|
static boolean |
|
void |
|
long |
Methods inherited from class java.awt.image.WritableRaster | |
createChild , createWritableChild , createWritableTranslatedChild , getWritableParent , setDataElements , setDataElements , setDataElements , setPixel , setPixel , setPixel , setPixels , setPixels , setPixels , setRect , setRect , setSample , setSample , setSample , setSamples , setSamples , setSamples |
Methods inherited from class java.lang.Object | |
clone , equals , extends Object> getClass , finalize , hashCode , notify , notifyAll , toString , wait , wait , wait |
public CairoSurface(int width, int height)
Create a cairo_surface_t with specified width and height. The format will be ARGB32 with premultiplied alpha and native bit and word ordering.
public CairoSurface(SampleModel sm, CairoSurface parent, Rectangle bounds, Point origin)
Create a Cairo Surface that is a subimage of another Cairo Surface
public void copyAreaNative(int x, int y, int width, int height, int dx, int dy, int stride)
Copy a portion of this surface to another area on the surface. The given parameters must be within bounds - count on a segfault otherwise.
- Parameters:
x
- The x coordinate of the area to be copied from.y
- The y coordinate of the area to be copied from.width
- The width of the area to be copied.height
- The height of the area to be copied.dx
- The destination x coordinate.dy
- The destination y coordinate.stride
- The scanline stride.
protected static SampleModel createCairoSampleModel(int w, int h)
Creates a SampleModel that matches Cairo's native format
public Raster createChild(int parentX, int parentY, int width, int height, int childMinX, int childMinY, int[] bandList)
- Overrides:
- createChild in interface WritableRaster
public WritableRaster createCompatibleWritableRaster()
- Overrides:
- createCompatibleWritableRaster in interface Raster
public WritableRaster createCompatibleWritableRaster(int x, int y, int w, int h)
- Overrides:
- createCompatibleWritableRaster in interface Raster
public Raster createTranslatedChild(int childMinX, int childMinY)
- Overrides:
- createTranslatedChild in interface Raster
public WritableRaster createWritableChild(int parentX, int parentY, int w, int h, int childMinX, int childMinY, int[] bandList)
- Overrides:
- createWritableChild in interface WritableRaster
public WritableRaster createWritableTranslatedChild(int x, int y)
- Overrides:
- createWritableTranslatedChild in interface WritableRaster
public static BufferedImage getBufferedImage(CairoSurface surface)
Returns a BufferedImage backed by a Cairo surface.
public static BufferedImage getBufferedImage(GtkImage image)
Returns a BufferedImage backed by a Cairo surface, created from a GtkImage.
public static BufferedImage getBufferedImage(int width, int height)
Returns a BufferedImage backed by a Cairo surface.
public int[] getData()
Convenience method to quickly grab the data array backing this Raster.
- Returns:
- The array behind the databuffer.
public static boolean isCompatibleColorModel(ColorModel cm)
Returns whether this ColorModel is compatible with Cairo's native types.
- Parameters:
cm
- The color model to check.
- Returns:
- Whether it is compatible.
public static boolean isCompatibleSampleModel(SampleModel sm)
Returns whether this SampleModel is compatible with Cairo's native types.
- Parameters:
sm
- The sample model to check.
- Returns:
- Whether it is compatible.
public void nativeDrawSurface(long surfacePointer, long contextPointer, double[] i2u, double alpha, int interpolation)
Draws this image to a given CairoGraphics context, with an affine transform given by i2u.