|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.gnu.glib.GObject
org.gnu.gdk.Pixbuf
This class describes an image in memory.
Image data in a pixbuf is stored in memory in uncompressed, packed format. Rows in the image are stored top to bottom, and in each row pixels are stored from left to right. There may be padding at the end of a row. The "rowstride" value of a pixbuf, as returned by getRowstride(), indicates the number of bytes between rows.
Field Summary |
Fields inherited from class org.gnu.glib.GObject |
eventsInitialized |
Constructor Summary | |
Pixbuf(byte[] data)
Create a new Pixbuf by parsing XPM data in memory. |
|
Pixbuf(byte[] data,
boolean copyPixels)
Create a new Pixbuf from a flat representation that is suitable for storing as inline data in a program. |
|
Pixbuf(Colorspace colorSpace,
boolean hasAlpha,
int bitsPerSample,
int width,
int height)
Create a new Pixbuf object and allocate a buffer to it. |
|
Pixbuf(Handle handle)
Constructs a Pixbuf from a handle to native resources. |
|
Pixbuf(Pixbuf srcPixbuf,
int srcX,
int srcY,
int width,
int height)
Create a new Pixbuf which represents a sub-region of another Pixbuf. |
|
Pixbuf(java.lang.String filename)
Construct a new Pixbuf from an image file. |
|
Pixbuf(java.lang.String filename,
int width,
int height,
boolean preserveAspect)
Creates a new Pixbuf by loading an image from a file. |
Method Summary | |
Pixbuf |
addAlpha(boolean substituteColor,
int red,
int green,
int blue)
Adds alpha channel to this Pixbuf and returns the results. |
Pixbuf |
composite(int width,
int height,
InterpType type,
int overallAlpha,
int checkSize,
int color1,
int color2)
Creates a new Pixbuf by scaling this Pixbuf to the provided width and height and compositing the results with a checkboard of colors color1 and color2. |
Pixbuf |
composite(Pixbuf dest,
int destX,
int destY,
int destWidth,
int destHeight,
double offsetX,
double offsetY,
double scaleX,
double scaleY,
InterpType type,
int overallAlpha)
Creates a transformation of this image by scaling scaleX and scaleY then translating by offsetX and offsetY. |
Pixbuf |
composite(Pixbuf dest,
int destX,
int destY,
int destWidth,
int destHeight,
double offsetX,
double offsetY,
double scaleX,
double scaleY,
InterpType type,
int overallAlpha,
int checkX,
int checkY,
int checkSize,
int color1,
int color2)
Creates a transformation of this image by scaling scaleX and scaleY then translating by offsetX and offsetY then composites the rectangle (destX, destY, destWidth, destHeight) of the resulting image with a checkboard of the colors color1 and color2 and renders it onto the destination image. |
Pixbuf |
copy()
Return a copy of this Pixbuf. |
void |
copyArea(int x,
int y,
int width,
int height,
Pixbuf dest,
int destX,
int destY)
Copies a rectangle area from this Pixbuf to the destination Pixbuf. |
void |
fill(int pixel)
Clears the Pixbuf to a given RGBA value, converting the RGBA value into the Pixbuf's pixel format. |
Pixbuf |
flip(boolean horizontal)
Flips a Pixbuf horizontally or vertically and returns the result in a new Pixbuf. |
protected static Handle |
gdk_pixbuf_add_alpha(Handle pixbuf,
boolean substituteColor,
int r,
int g,
int b)
|
protected static Handle |
gdk_pixbuf_composite_color_simple(Handle src,
int destWidth,
int destHeight,
int interpType,
int overallAlpha,
int checkSize,
int color1,
int color2)
|
protected static void |
gdk_pixbuf_composite_color(Handle src,
Handle dest,
int destX,
int destY,
int destWidth,
int destHeight,
double offsetX,
double offsetY,
double scaleX,
double scaleY,
int interpType,
int overallAlpha,
int checkX,
int checkY,
int checkSize,
int color1,
int color2)
|
protected static void |
gdk_pixbuf_composite(Handle src,
Handle dest,
int destX,
int destY,
int destWidth,
int destHeight,
double offsetX,
double offsetY,
double scaleX,
double scaleY,
int interpType,
int overallAlpha)
|
protected static void |
gdk_pixbuf_copy_area(Handle srcPixbuf,
int srcX,
int srcY,
int width,
int height,
Handle destPixbuf,
int destX,
int destY)
|
protected static Handle |
gdk_pixbuf_copy(Handle pixbuf)
|
protected static void |
gdk_pixbuf_fill(Handle pixbuf,
int pixel)
|
protected static Handle |
gdk_pixbuf_flip(Handle pixbuf,
boolean horizontal)
|
protected static int |
gdk_pixbuf_get_bits_per_sample(Handle pixbuf)
|
protected static int |
gdk_pixbuf_get_colorspace(Handle pixbuf)
|
protected static Handle |
gdk_pixbuf_get_file_info(java.lang.String filename,
int[] width,
int[] height)
|
protected static boolean |
gdk_pixbuf_get_has_alpha(Handle pixbuf)
|
protected static int |
gdk_pixbuf_get_height(Handle pixbuf)
|
protected static int |
gdk_pixbuf_get_n_channels(Handle pixbuf)
|
protected static java.lang.String |
gdk_pixbuf_get_option(Handle pixbuf,
java.lang.String key)
|
protected static byte[] |
gdk_pixbuf_get_pixels(Handle pixbuf)
|
protected static int |
gdk_pixbuf_get_rowstride(Handle pixbuf)
|
protected static int |
gdk_pixbuf_get_width(Handle pixbuf)
|
protected static Handle |
gdk_pixbuf_new_from_file_at_scale(java.lang.String filename,
int width,
int height,
boolean preserveAspect,
Handle error)
|
protected static Handle |
gdk_pixbuf_new_from_file_at_size(java.lang.String filename,
int width,
int height,
Handle error)
|
protected static Handle |
gdk_pixbuf_new_from_file(java.lang.String filename,
Handle error)
|
protected static Handle |
gdk_pixbuf_new_from_inline(int dataLength,
byte[] data,
boolean copyPixels,
Handle error)
|
protected static Handle |
gdk_pixbuf_new_from_xpm_data(byte[] data)
|
protected static Handle |
gdk_pixbuf_new_subpixbuf(Handle srcPixbuf,
int srcX,
int srcY,
int width,
int height)
|
protected static Handle |
gdk_pixbuf_new(int colorspace,
boolean hasAlpha,
int bitsPerSample,
int width,
int height)
|
protected static Handle |
gdk_pixbuf_rotate_simple(Handle pixbuf,
int angle)
|
protected static void |
gdk_pixbuf_saturate_and_pixelate(Handle src,
Handle dest,
double saturation,
boolean pixelate)
|
protected static boolean |
gdk_pixbuf_save_to_bufferv(Handle pixbuf,
java.lang.String buffer,
java.lang.String type,
java.lang.String[] optionKeys,
java.lang.String[] optionValues,
Handle error)
|
protected static boolean |
gdk_pixbuf_savev(Handle pixbuf,
java.lang.String filename,
java.lang.String type,
java.lang.String[] optionKeys,
java.lang.String[] optionValues,
Handle error)
|
protected static Handle |
gdk_pixbuf_scale_simple(Handle src,
int destWidth,
int destHeight,
int interpType)
|
protected static void |
gdk_pixbuf_scale(Handle src,
Handle dest,
int destX,
int destY,
int destWidth,
int destHeight,
double offsetX,
double offsetY,
double scaleX,
double scaleY,
int interpType)
|
int |
getBitsPerSample()
|
Colorspace |
getColorspace()
Returns the Colorspace for the Pixbuf. |
static PixbufFormat |
getFileInformation(java.lang.String filename)
|
int |
getNumChannels()
Returns the number of channels for the Pixbuf. |
java.lang.String |
getOption(java.lang.String key)
|
byte[] |
getPixels()
Returns the pixel data for the Pixbuf |
int |
getRowstride()
Returns the rowstride which is the number of bytes between the start of a row and the start of the next row. |
boolean |
hasAlpha()
|
int |
height()
Return the height of the pixbuf. |
Pixbuf |
rotate(PixbufRotation direction)
Rotate this pixbuf and return the results as a new Pixbuf. |
Pixbuf |
saturateAndPixelate(Pixbuf dest,
double saturation,
boolean pixelate)
Modifies saturation and optionally pixelates this Pixbuf placing the result in the destination Pixbuf. |
void |
save(java.lang.String filename,
java.lang.String type,
java.lang.String[] optionKeys,
java.lang.String[] optionValues)
Saves a Pixbuf to a file in the format type provided. |
byte[] |
saveToBuffer(java.lang.String type,
java.lang.String[] optionKeys,
java.lang.String[] optionValues)
Saves a Pixbuf to a buffer in the format type provided. |
Pixbuf |
scale(int width,
int height,
InterpType itype)
Create a new pixbuf from an existing pixbuf scaled to the size provided. |
Pixbuf |
scale(Pixbuf dest,
int destX,
int destY,
int destWidth,
int destHeight,
double offsetX,
double offsetY,
double scaleX,
double scaleY,
InterpType type)
Creates a transformation of this Pixbuf by scaling scaleX and scaleY then translating by offsetX and offsetY, then renders the rectangle of the resulting image onto the destination image replacing the previous contents. |
int |
width()
Return the width of the pixbuf. |
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Pixbuf(Handle handle)
public Pixbuf(java.lang.String filename) throws java.io.FileNotFoundException, JGException
filename
- The name of the image file.
java.io.FileNotFoundException
- if filename doesn't exist.
JGException
public Pixbuf(java.lang.String filename, int width, int height, boolean preserveAspect) throws java.io.FileNotFoundException, JGException
filename
- width
- height
- preserveAspect
-
java.io.FileNotFoundException
JGException
public Pixbuf(Colorspace colorSpace, boolean hasAlpha, int bitsPerSample, int width, int height)
colorSpace
- hasAlpha
- bitsPerSample
- width
- height
- public Pixbuf(byte[] data)
data
- public Pixbuf(byte[] data, boolean copyPixels) throws JGException
data
- copyPixels
-
JGException
public Pixbuf(Pixbuf srcPixbuf, int srcX, int srcY, int width, int height)
srcPixbuf
- srcX
- srcY
- width
- height
- Method Detail |
public static PixbufFormat getFileInformation(java.lang.String filename)
public Pixbuf copy()
public void copyArea(int x, int y, int width, int height, Pixbuf dest, int destX, int destY)
x
- y
- width
- height
- dest
- destX
- destY
- public int width()
public int height()
public Pixbuf scale(int width, int height, InterpType itype)
public Pixbuf scale(Pixbuf dest, int destX, int destY, int destWidth, int destHeight, double offsetX, double offsetY, double scaleX, double scaleY, InterpType type)
dest
- destX
- destY
- destWidth
- destHeight
- offsetX
- offsetY
- scaleX
- scaleY
- type
- public Pixbuf composite(int width, int height, InterpType type, int overallAlpha, int checkSize, int color1, int color2)
width
- height
- type
- overallAlpha
- checkSize
- color1
- color2
- public Pixbuf composite(Pixbuf dest, int destX, int destY, int destWidth, int destHeight, double offsetX, double offsetY, double scaleX, double scaleY, InterpType type, int overallAlpha)
dest
- destX
- destY
- destWidth
- destHeight
- offsetX
- offsetY
- scaleX
- scaleY
- type
- overallAlpha
- public Pixbuf composite(Pixbuf dest, int destX, int destY, int destWidth, int destHeight, double offsetX, double offsetY, double scaleX, double scaleY, InterpType type, int overallAlpha, int checkX, int checkY, int checkSize, int color1, int color2)
dest
- destX
- destY
- destWidth
- destHeight
- offsetX
- offsetY
- scaleX
- scaleY
- type
- overallAlpha
- checkX
- checkY
- checkSize
- color1
- color2
- public Pixbuf rotate(PixbufRotation direction)
direction
- public Pixbuf flip(boolean horizontal)
horizontal
- public Colorspace getColorspace()
public int getNumChannels()
public boolean hasAlpha()
public int getBitsPerSample()
public byte[] getPixels()
public int getRowstride()
public java.lang.String getOption(java.lang.String key)
public void save(java.lang.String filename, java.lang.String type, java.lang.String[] optionKeys, java.lang.String[] optionValues) throws JGException
filename
- type
- optionKeys
- optionValues
-
JGException
public byte[] saveToBuffer(java.lang.String type, java.lang.String[] optionKeys, java.lang.String[] optionValues) throws JGException
type
- optionKeys
- optionValues
-
JGException
public Pixbuf addAlpha(boolean substituteColor, int red, int green, int blue)
If substituteColor is true the color specified by (red, green, blue) will be assigned zero opacity. That is, if you pass (255, 255, 255) for the substitute color all white pixels will become fully transparent.
substituteColor
- red
- green
- blue
- public void fill(int pixel)
pixel
- public Pixbuf saturateAndPixelate(Pixbuf dest, double saturation, boolean pixelate)
dest
- saturation
- pixelate
- protected static final int gdk_pixbuf_get_colorspace(Handle pixbuf)
protected static final int gdk_pixbuf_get_n_channels(Handle pixbuf)
protected static final boolean gdk_pixbuf_get_has_alpha(Handle pixbuf)
protected static final int gdk_pixbuf_get_bits_per_sample(Handle pixbuf)
protected static final byte[] gdk_pixbuf_get_pixels(Handle pixbuf)
protected static final int gdk_pixbuf_get_width(Handle pixbuf)
protected static final int gdk_pixbuf_get_height(Handle pixbuf)
protected static final int gdk_pixbuf_get_rowstride(Handle pixbuf)
protected static final Handle gdk_pixbuf_new(int colorspace, boolean hasAlpha, int bitsPerSample, int width, int height)
protected static final Handle gdk_pixbuf_copy(Handle pixbuf)
protected static final Handle gdk_pixbuf_new_subpixbuf(Handle srcPixbuf, int srcX, int srcY, int width, int height)
protected static final Handle gdk_pixbuf_new_from_file(java.lang.String filename, Handle error)
protected static final Handle gdk_pixbuf_new_from_file_at_size(java.lang.String filename, int width, int height, Handle error)
protected static final Handle gdk_pixbuf_new_from_file_at_scale(java.lang.String filename, int width, int height, boolean preserveAspect, Handle error)
protected static final Handle gdk_pixbuf_get_file_info(java.lang.String filename, int[] width, int[] height)
protected static final Handle gdk_pixbuf_new_from_xpm_data(byte[] data)
protected static final Handle gdk_pixbuf_new_from_inline(int dataLength, byte[] data, boolean copyPixels, Handle error)
protected static final boolean gdk_pixbuf_savev(Handle pixbuf, java.lang.String filename, java.lang.String type, java.lang.String[] optionKeys, java.lang.String[] optionValues, Handle error)
protected static final boolean gdk_pixbuf_save_to_bufferv(Handle pixbuf, java.lang.String buffer, java.lang.String type, java.lang.String[] optionKeys, java.lang.String[] optionValues, Handle error)
protected static final Handle gdk_pixbuf_rotate_simple(Handle pixbuf, int angle)
protected static final Handle gdk_pixbuf_flip(Handle pixbuf, boolean horizontal)
protected static final void gdk_pixbuf_fill(Handle pixbuf, int pixel)
protected static final Handle gdk_pixbuf_add_alpha(Handle pixbuf, boolean substituteColor, int r, int g, int b)
protected static final void gdk_pixbuf_copy_area(Handle srcPixbuf, int srcX, int srcY, int width, int height, Handle destPixbuf, int destX, int destY)
protected static final void gdk_pixbuf_saturate_and_pixelate(Handle src, Handle dest, double saturation, boolean pixelate)
protected static final void gdk_pixbuf_scale(Handle src, Handle dest, int destX, int destY, int destWidth, int destHeight, double offsetX, double offsetY, double scaleX, double scaleY, int interpType)
protected static final void gdk_pixbuf_composite(Handle src, Handle dest, int destX, int destY, int destWidth, int destHeight, double offsetX, double offsetY, double scaleX, double scaleY, int interpType, int overallAlpha)
protected static final void gdk_pixbuf_composite_color(Handle src, Handle dest, int destX, int destY, int destWidth, int destHeight, double offsetX, double offsetY, double scaleX, double scaleY, int interpType, int overallAlpha, int checkX, int checkY, int checkSize, int color1, int color2)
protected static final Handle gdk_pixbuf_scale_simple(Handle src, int destWidth, int destHeight, int interpType)
protected static final Handle gdk_pixbuf_composite_color_simple(Handle src, int destWidth, int destHeight, int interpType, int overallAlpha, int checkSize, int color1, int color2)
protected static final java.lang.String gdk_pixbuf_get_option(Handle pixbuf, java.lang.String key)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |