|
virtual | ~Pixbuf () |
|
GdkPixbuf * | gobj () |
| Provides access to the underlying C GObject. More...
|
|
const GdkPixbuf * | gobj () const |
| Provides access to the underlying C GObject. More...
|
|
GdkPixbuf * | gobj_copy () |
| Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs. More...
|
|
Glib::RefPtr< Pixbuf > | copy () const |
|
Colorspace | get_colorspace () const |
|
int | get_n_channels () const |
|
bool | get_has_alpha () const |
|
int | get_bits_per_sample () const |
|
guint8 * | get_pixels () const |
|
int | get_width () const |
|
int | get_height () const |
|
int | get_rowstride () const |
|
void | fill (guint32 pixel) |
|
void | save (const std::string &filename, const Glib::ustring &type) |
|
void | save (const std::string &filename, const Glib::ustring &type, const Glib::StringArrayHandle &option_keys, const Glib::StringArrayHandle &option_values) |
|
void | save_to_buffer (gchar *&buffer, gsize &buffer_size, const Glib::ustring &type="png") |
|
void | save_to_buffer (gchar *&buffer, gsize &buffer_size, const Glib::ustring &type, const Glib::StringArrayHandle &option_keys, const Glib::StringArrayHandle &option_values) |
|
Glib::RefPtr< Gdk::Pixbuf > | add_alpha (bool substitute_color, guint8 r, guint8 g, guint8 b) const |
|
void | copy_area (int src_x, int src_y, int width, int height, const Glib::RefPtr< Gdk::Pixbuf > &dest_pixbuf, int dest_x, int dest_y) const |
|
void | saturate_and_pixelate (const Glib::RefPtr< Gdk::Pixbuf > &dest, float saturation, bool pixelate) const |
|
void | scale (const Glib::RefPtr< Gdk::Pixbuf > &dest, int dest_x, int dest_y, int dest_width, int dest_height, double offset_x, double offset_y, double scale_x, double scale_y, InterpType interp_type) const |
|
void | composite (const Glib::RefPtr< Gdk::Pixbuf > &dest, int dest_x, int dest_y, int dest_width, int dest_height, double offset_x, double offset_y, double scale_x, double scale_y, InterpType interp_type, int overall_alpha) const |
|
void | composite_color (const Glib::RefPtr< Gdk::Pixbuf > &dest, int dest_x, int dest_y, int dest_width, int dest_height, double offset_x, double offset_y, double scale_x, double scale_y, InterpType interp_type, int overall_alpha, int check_x, int check_y, int check_size, guint32 color1, guint32 color2) const |
|
Glib::RefPtr< Gdk::Pixbuf > | scale_simple (int dest_width, int dest_height, InterpType interp_type) const |
|
Glib::RefPtr< Gdk::Pixbuf > | composite_color_simple (int dest_width, int dest_height, InterpType interp_type, int overall_alpha, int check_size, guint32 color1, guint32 color2) const |
|
Glib::RefPtr< Gdk::Pixbuf > | rotate_simple (PixbufRotation angle) const |
|
Glib::RefPtr< Gdk::Pixbuf > | flip (bool horizontal=true) const |
|
void | render_threshold_alpha (const Glib::RefPtr< Gdk::Bitmap > &bitmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height, int alpha_threshold) |
|
void | render_to_drawable (const Glib::RefPtr< Drawable > &drawable, const Glib::RefPtr< Gdk::GC > &gc, int src_x, int src_y, int dest_x, int dest_y, int width, int height, RgbDither dither, int x_dither, int y_dither) |
|
void | render_to_drawable_alpha (const Glib::RefPtr< Drawable > &drawable, int src_x, int src_y, int dest_x, int dest_y, int width, int height, PixbufAlphaMode alpha_mode, int alpha_threshold, RgbDither dither, int x_dither, int y_dither) |
|
void | render_pixmap_and_mask_for_colormap (const Glib::RefPtr< Colormap > &colormap, Glib::RefPtr< Pixmap > &pixmap_return, Glib::RefPtr< Bitmap > &mask_return, int alpha_threshold) |
|
void | render_pixmap_and_mask (Glib::RefPtr< Pixmap > &pixmap_return, Glib::RefPtr< Bitmap > &mask_return, int alpha_threshold) |
|
Glib::ustring | get_option (const Glib::ustring &key) const |
|
|
static GType | get_type () G_GNUC_CONST |
|
static Glib::RefPtr< Gdk::Pixbuf > | create (const Glib::RefPtr< Drawable > &src, const Glib::RefPtr< Colormap > &cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height) |
|
static Glib::RefPtr< Gdk::Pixbuf > | create (const Glib::RefPtr< Image > &src, const Glib::RefPtr< Colormap > &cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height) |
|
static Glib::RefPtr< Pixbuf > | create (const Glib::RefPtr< Drawable > &src, const Glib::RefPtr< Colormap > &cmap, int src_x, int src_y, int width, int height) |
|
static Glib::RefPtr< Pixbuf > | create (const Glib::RefPtr< Drawable > &src, int src_x, int src_y, int width, int height) |
|
static Glib::RefPtr< Pixbuf > | create (const Glib::RefPtr< Image > &src, const Glib::RefPtr< Colormap > &cmap, int src_x, int src_y, int width, int height) |
|
static Glib::RefPtr< Pixbuf > | create (const Glib::RefPtr< Image > &src, int src_x, int src_y, int width, int height) |
|
static Glib::RefPtr< Pixbuf > | create (Colorspace colorspace, bool has_alpha, int bits_per_sample, int width, int height) |
|
static Glib::RefPtr< Pixbuf > | create_subpixbuf (const Glib::RefPtr< Pixbuf > &src_pixbuf, int src_x, int src_y, int width, int height) |
|
static Glib::RefPtr< Pixbuf > | create_from_file (const std::string &filename) |
|
static Glib::RefPtr< Pixbuf > | create_from_file (const std::string &filename, int width, int height, bool preserve_aspect_ratio=true) |
|
static Glib::RefPtr< Pixbuf > | create_from_data (const guint8 *data, Colorspace colorspace, bool has_alpha, int bits_per_sample, int width, int height, int rowstride) |
|
static Glib::RefPtr< Pixbuf > | create_from_data (const guint8 *data, Colorspace colorspace, bool has_alpha, int bits_per_sample, int width, int height, int rowstride, const SlotDestroyData &destroy_slot) |
|
static Glib::RefPtr< Pixbuf > | create_from_xpm_data (const char *const *data) |
|
static Glib::RefPtr< Pixbuf > | create_from_inline (int data_length, const guint8 *data, bool copy_pixels=false) |
|
static Glib::RefPtr< Pixbuf > | create_from_stream (const Glib::RefPtr< Gio::InputStream > &stream, const Glib::RefPtr< Gio::Cancellable > &cancelable) |
|
static Glib::RefPtr< Pixbuf > | create_from_stream (const Glib::RefPtr< Gio::InputStream > &stream) |
|
static Glib::RefPtr< Pixbuf > | create_from_stream_at_scale (const Glib::RefPtr< Gio::InputStream > &stream, int width, int height, bool preserve_aspect_ratio, const Glib::RefPtr< Gio::Cancellable > &cancelable) |
|
static Glib::RefPtr< Pixbuf > | create_from_stream_at_scale (const Glib::RefPtr< Gio::InputStream > &stream, int width, int height, bool preserve_aspect_ratio) |
|
static SListHandle_PixbufFormat | get_formats () |
|
|
| Pixbuf (const Glib::RefPtr< Drawable > &src, const Glib::RefPtr< Colormap > &cmap, int src_x, int src_y, int width, int height) |
|
| Pixbuf (const Glib::RefPtr< Drawable > &src, int src_x, int src_y, int width, int height) |
|
| Pixbuf (const Glib::RefPtr< Drawable > &src, const Glib::RefPtr< Colormap > &cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height) |
|
| Pixbuf (const Glib::RefPtr< Image > &src, const Glib::RefPtr< Colormap > &cmap, int src_x, int src_y, int width, int height) |
|
| Pixbuf (const Glib::RefPtr< Image > &src, int src_x, int src_y, int width, int height) |
|
| Pixbuf (const Glib::RefPtr< Image > &src, const Glib::RefPtr< Colormap > &cmap, int src_x, int src_y, int dest_x, int dest_y, int width, int height) |
|
Gdk::Pixbuf::Pixbuf |
( |
const Glib::RefPtr< Drawable > & |
src, |
|
|
const Glib::RefPtr< Colormap > & |
cmap, |
|
|
int |
src_x, |
|
|
int |
src_y, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
protected |
Creates a pixbuf object from a drawable.
Transfers image data from a Drawable and converts it to an RGB(A) representation inside a Pixbuf. In other words, copies image data from a server-side drawable to a client-side RGB(A) buffer. This allows you to efficiently read individual pixels on the client side.
If the drawable src
has no colormap (See Gdk::Drawable::get_colormap()), then a suitable colormap must be specified. Otherwise, you may use the constructor that takes no colormap argument. Typically a Gdk::Window or a pixmap created by passing a Gdk:Window to the Gdk::Pixbuf constructor will already have a colormap associated with it. If the drawable is a bitmap (1 bit per pixel pixmap), then a colormap is not required; pixels with a value of 1 are assumed to be white, and pixels with a value of 0 are assumed to be black. For taking screenshots, Gdk::Colormap::get_system() returns the correct colormap to use.
This will create an RGB pixbuf with 8 bits per channel and no alpha, with the same size specified by the width and height arguments.
If the specified drawable is a pixmap, then the requested source rectangle must be completely contained within the pixmap, otherwise the constructor will fail. For pixmaps only (not for windows) passing -1 for width or height is allowed to mean the full width or height of the pixmap.
If the specified drawable is a window, and the window is off the screen, then there is no image data in the obscured/offscreen regions to be placed in the pixbuf. The contents of portions of the pixbuf corresponding to the offscreen region are undefined.
If the window you're obtaining data from is partially obscured by other windows, then the contents of the pixbuf areas corresponding to the obscured regions are undefined.
See alo Gdk::Drawable::get_image().
- Parameters
-
src | Source drawable. |
cmap | A colormap. |
src_x | Source X coordinate within drawable. |
src_y | Source Y coordinate within drawable. |
width | Width in pixels of region to get. |
height | Height in pixels of region to get. |
static Glib::RefPtr<Pixbuf> Gdk::Pixbuf::create |
( |
const Glib::RefPtr< Drawable > & |
src, |
|
|
const Glib::RefPtr< Colormap > & |
cmap, |
|
|
int |
src_x, |
|
|
int |
src_y, |
|
|
int |
width, |
|
|
int |
height |
|
) |
| |
|
static |
Creates a pixbuf object from a drawable.
Transfers image data from a Drawable and converts it to an RGB(A) representation inside a Pixbuf. In other words, copies image data from a server-side drawable to a client-side RGB(A) buffer. This allows you to efficiently read individual pixels on the client side.
If the drawable src
has no colormap (See Gdk::Drawable::get_colormap()), then a suitable colormap must be specified. Otherwise, you may use the constructor that takes no colormap argument. Typically a Gdk::Window or a pixmap created by passing a Gdk:Window to the Gdk::Pixbuf constructor will already have a colormap associated with it. If the drawable is a bitmap (1 bit per pixel pixmap), then a colormap is not required; pixels with a value of 1 are assumed to be white, and pixels with a value of 0 are assumed to be black. For taking screenshots, Gdk::Colormap::get_system() returns the correct colormap to use.
This will create an RGB pixbuf with 8 bits per channel and no alpha, with the same size specified by the width and height arguments.
If the specified drawable is a pixmap, then the requested source rectangle must be completely contained within the pixmap, otherwise the constructor will fail. For pixmaps only (not for windows) passing -1 for width or height is allowed to mean the full width or height of the pixmap.
If the specified drawable is a window, and the window is off the screen, then there is no image data in the obscured/offscreen regions to be placed in the pixbuf. The contents of portions of the pixbuf corresponding to the offscreen region are undefined.
If the window you're obtaining data from is partially obscured by other windows, then the contents of the pixbuf areas corresponding to the obscured regions are undefined.
See alo Gdk::Drawable::get_image().
- Parameters
-
src | Source drawable. |
cmap | A colormap. |
src_x | Source X coordinate within drawable. |
src_y | Source Y coordinate within drawable. |
width | Width in pixels of region to get. |
height | Height in pixels of region to get. |
static Glib::RefPtr<Pixbuf> Gdk::Pixbuf::create_from_inline |
( |
int |
data_length, |
|
|
const guint8 * |
data, |
|
|
bool |
copy_pixels = false |
|
) |
| |
|
static |
Create a Gdk::Pixbuf from a flat representation that is suitable for storing as inline data in a program. This is useful if you want to ship a program with images, but don't want to depend on any external files.
GTK+ ships with a program called gdk-pixbuf-csource
which allows for conversion of GdkPixbufs into such a inline representation. In almost all cases, you should pass the –raw
flag to gdk-pixbuf-csource
. A sample invocation would be:
gdk-pixbuf-csource –raw –name=myimage_inline myimage.png
For the typical case where the inline pixbuf is read-only static data, you don't need to copy the pixel data unless you intend to write to it, so you can pass false
for copy_pixels. (If you pass –rle
to gdk-pixbuf-csource
, a copy will be made even if copy_pixels is false
, so using this option is generally a bad idea.)
If you create a pixbuf from const inline data compiled into your program, it's probably safe to ignore errors, since things will always succeed. For non-const inline data, you could get out of memory. For untrusted inline data located at runtime, you could have corrupt inline data in addition.
- Parameters
-
data_length | Length in bytes of the data argument. |
data | Byte data containing a serialized GdkPixdata structure. |
copy_pixels | Whether to copy the pixel data, or use direct pointers to data for the resulting pixbuf. |
- Exceptions
-
void Gdk::Pixbuf::save |
( |
const std::string & |
filename, |
|
|
const Glib::ustring & |
type, |
|
|
const Glib::StringArrayHandle & |
option_keys, |
|
|
const Glib::StringArrayHandle & |
option_values |
|
) |
| |
Saves pixbuf to a file in format type. By default, "jpeg", "png", "ico" and "bmp" are possible file formats to save in, but more formats may be installed. TThe list of all writable formats can be determined by using get_formats() with Gdk::PixbufFormat::is_writable().
The option_keys and option_values
, if not empty, should contain pairs of strings that modify the save parameters. For example, "quality", "100".
Currently only a few parameters exist. JPEG images can be saved with a "quality" parameter; its value should be in the range [0,100]. Text chunks can be attached to PNG images by specifying parameters of the form "tEXt::key", where key is an ASCII string of length 1-79. The values are UTF-8 encoded strings. ICO images can be saved in depth 16, 24, or 32, by using the "depth" parameter. When the ICO saver is given "x_hot" and "y_hot" parameters, it produces a CUR instead of an ICO.
- Parameters
-
filename | The path of the file to be created. |
type | The file type. |
option_keys | |
option_values | |
- Exceptions
-