![]() |
![]() |
Public Types | |
typedef SigC::Slot1< void, const guint8* > | SlotDestroyData |
Public Member Functions | |
virtual | ~Pixbuf () |
GdkPixbuf* | gobj () |
Provides access to the underlying C GObject. | |
const GdkPixbuf* | gobj () const |
Provides access to the underlying C GObject. | |
GdkPixbuf* | gobj_copy () |
Glib::RefPtr<Pixbuf> | copy () const |
Creates a new Gdk::Pixbuf with a copy of the information in the specified pixbuf . | |
Colorspace | get_colorspace () const |
Queries the color space of a pixbuf. | |
int | get_n_channels () const |
Queries the number of channels of a pixbuf. | |
bool | get_has_alpha () const |
Queries whether a pixbuf has an alpha channel (opacity information). | |
int | get_bits_per_sample () const |
Queries the number of bits per color sample in a pixbuf. | |
guint8* | get_pixels () const |
Queries a pointer to the pixel data of a pixbuf. | |
int | get_width () const |
Queries the width of a pixbuf. | |
int | get_height () const |
Queries the height of a pixbuf. | |
int | get_rowstride () const |
Queries the rowstride of a pixbuf, which is the number of bytes between rows. | |
void | fill (guint32 pixel) |
Clears a pixbuf to the given RGBA value, converting the RGBA value into the pixbuf's pixel format. | |
void | save (const std::string& filename, const Glib::ustring& type) |
Save an image file. | |
void | save (const std::string& filename, const Glib::ustring& type, const Glib::StringArrayHandle& option_keys, const Glib::StringArrayHandle& option_values) |
Save an image file. | |
Glib::RefPtr<Gdk::Pixbuf> | add_alpha (bool substitute_color, guint8 r, guint8 g, guint8 b) const |
Takes an existing pixbuf and adds an alpha channel to it. | |
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 |
Copies a rectangular area from src_pixbuf to dest_pixbuf . | |
void | saturate_and_pixelate (const Glib::RefPtr<Gdk::Pixbuf>& dest, float saturation, bool pixelate) const |
Modifies saturation and optionally pixelates src , placing the result in dest . | |
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 |
Creates a transformation of the source image src by scaling by scale_x and scale_y then translating by offset_x and offset_y , then renders the rectangle ( dest_x , dest_y , dest_width , dest_height ) of the resulting image onto the destination image replacing the previous contents. | |
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 |
Creates a transformation of the source image src by scaling by scale_x and scale_y then translating by offset_x and offset_y , then composites the rectangle ( dest_x , dest_y , dest_width , dest_height ) of the resulting image onto the destination image. | |
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 |
Creates a transformation of the source image src by scaling by scale_x and scale_y then translating by offset_x and offset_y , then composites the rectangle ( dest_x , dest_y , dest_width , dest_height ) of the resulting image with a checkboard of the colors and and renders it onto the destination image. | |
Glib::RefPtr<Gdk::Pixbuf> | scale_simple (int dest_width, int dest_height, InterpType interp_type) const |
Create a new Gdk::Pixbuf containing a copy of src scaled to dest_width x dest_height . | |
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 |
Creates a new Gdk::Pixbuf by scaling src to dest_width x dest_height and compositing the result with a checkboard of colors and . | |
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) |
Takes the opacity values in a rectangular portion of a pixbuf and thresholds them to produce a bi-level alpha mask that can be used as a clipping mask for a drawable. | |
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) |
Renders a rectangular portion of a pixbuf to a drawable while using the specified GC. | |
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) |
Renders a rectangular portion of a pixbuf to a drawable. | |
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 |
Looks up key in the list of options that may have been attached to the pixbuf when it was loaded. | |
Static Public Member Functions | |
Glib::RefPtr<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) |
Glib::RefPtr<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) |
Glib::RefPtr<Pixbuf> | create (Colorspace colorspace, bool has_alpha, int bits_per_sample, int width, int height) |
Creates a new Gdk::Pixbuf structure and allocates a buffer for it. | |
Glib::RefPtr<Pixbuf> | create_subpixbuf (const Glib::RefPtr<Pixbuf>& pixbuf, int src_x, int src_y, int width, int height) |
Creates a new pixbuf which represents a sub-region of src_pixbuf . | |
Glib::RefPtr<Pixbuf> | create_from_file (const std::string& filename) |
Load an image file. | |
Glib::RefPtr<Pixbuf> | create_from_data (const guint8* data, Colorspace colorspace, bool has_alpha, int bits_per_sample, int width, int height, int rowstride) |
Creates a new Gdk::Pixbuf out of in-memory image data. | |
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) |
Creates a new Gdk::Pixbuf out of in-memory image data. | |
Glib::RefPtr<Pixbuf> | create_from_xpm_data (const char* const* data) |
Creates a new pixbuf by parsing XPM data in memory. | |
Glib::RefPtr<Pixbuf> | create_from_inline (int data_length, const guint8* data, bool copy_pixels=false) |
Create a Gdk::Pixbuf from a flat representation that is suitable for storing as inline data in a program. | |
Protected Member Functions | |
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 dest_x, int dest_y, int width, int height) | |
Related Functions | |
(Note that these are not member functions.) | |
Glib::RefPtr<Gdk::Pixbuf> | wrap (GdkPixbuf* object, bool take_copy=false) |
|
|
|
|
|
|
|
|
|
Takes an existing pixbuf and adds an alpha channel to it. If the existing pixbuf already had an alpha channel, the channel values are copied from the original; otherwise, the alpha channel is initialized to 255 (full opacity).
If substitute_color is
|
|
Creates a transformation of the source image src by scaling by scale_x and scale_y then translating by offset_x and offset_y , then composites the rectangle ( dest_x , dest_y , dest_width , dest_height ) of the resulting image onto the destination image.
|
|
Creates a transformation of the source image src by scaling by scale_x and scale_y then translating by offset_x and offset_y , then composites the rectangle ( dest_x , dest_y , dest_width , dest_height ) of the resulting image with a checkboard of the colors and and renders it onto the destination image. See composite_color_simple() for a simpler variant of this function suitable for many tasks.
|
|
Creates a new Gdk::Pixbuf by scaling src to dest_width x dest_height and compositing the result with a checkboard of colors and .
|
|
Creates a new Gdk::Pixbuf with a copy of the information in the specified pixbuf .
|
|
Copies a rectangular area from src_pixbuf to dest_pixbuf . Conversion of pixbuf formats is done automatically.
|
|
Creates a new Gdk::Pixbuf structure and allocates a buffer for it. The buffer has an optimal rowstride. Note that the buffer is not cleared; you will have to fill it completely yourself.
|
|
|
|
|
|
Creates a new Gdk::Pixbuf out of in-memory image data. Currently only RGB images with 8 bits per sample are supported.
|
|
Creates a new Gdk::Pixbuf out of in-memory image data. Currently only RGB images with 8 bits per sample are supported.
|
|
Load an image file.
|
|
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
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 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.
|
|
Creates a new pixbuf by parsing XPM data in memory. This data is commonly the result of including an XPM file into a program's C source.
|
|
Creates a new pixbuf which represents a sub-region of src_pixbuf . The new pixbuf shares its pixels with the original pixbuf, so writing to one affects both. The new pixbuf holds a reference to src_pixbuf , so src_pixbuf will not be finalized until the new pixbuf is finalized.
|
|
Clears a pixbuf to the given RGBA value, converting the RGBA value into the pixbuf's pixel format. The alpha will be ignored if the pixbuf doesn't have an alpha channel.
|
|
Queries the number of bits per color sample in a pixbuf.
|
|
Queries the color space of a pixbuf.
|
|
Queries whether a pixbuf has an alpha channel (opacity information).
|
|
Queries the height of a pixbuf.
|
|
Queries the number of channels of a pixbuf.
|
|
Looks up key in the list of options that may have been attached to the pixbuf when it was loaded.
|
|
Queries a pointer to the pixel data of a pixbuf.
|
|
Queries the rowstride of a pixbuf, which is the number of bytes between rows.
|
|
Queries the width of a pixbuf.
|
|
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase. |
|
Provides access to the underlying C GObject.
Reimplemented from Glib::ObjectBase. |
|
|
|
|
|
|
|
Takes the opacity values in a rectangular portion of a pixbuf and thresholds them to produce a bi-level alpha mask that can be used as a clipping mask for a drawable.
|
|
Renders a rectangular portion of a pixbuf to a drawable while using the specified GC. This is done using GdkRGB, so the specified drawable must have the GdkRGB visual and colormap. Note that this function will ignore the opacity information for images with an alpha channel; the GC must already have the clipping mask set if you want transparent regions to show through. For an explanation of dither offsets, see the GdkRGB documentation. In brief, the dither offset is important when re-rendering partial regions of an image to a rendered version of the full image, or for when the offsets to a base position change, as in scrolling. The dither matrix has to be shifted for consistent visual results. If you do not have any of these cases, the dither offsets can be both zero. This function is obsolete. Use gdk_draw_pixbuf() instead.
|
|
Renders a rectangular portion of a pixbuf to a drawable.
The destination drawable must have a colormap. All windows have a colormap, however, pixmaps only have colormap by default if they were created with a non- On older X servers, rendering pixbufs with an alpha channel involves round trips to the X server, and may be somewhat slow. This function is obsolete. Use gdk_draw_pixbuf() instead.
|
|
Modifies saturation and optionally pixelates src , placing the result in dest .
src and dest may be the same pixbuf with no ill effects. If saturation is 1.0 then saturation is not changed. If it's less than 1.0, saturation is reduced (the image is darkened); if greater than 1.0, saturation is increased (the image is brightened). If pixelate is
|
|
Save an image file.
|
|
Save an image file.
|
|
Creates a transformation of the source image src by scaling by scale_x and scale_y then translating by offset_x and offset_y , then renders the rectangle ( dest_x , dest_y , dest_width , dest_height ) of the resulting image onto the destination image replacing the previous contents. Try to use scale_simple() first, this function is the industrial-strength power tool you can fall back to if scale_simple() isn't powerful enough.
|
|
Create a new Gdk::Pixbuf containing a copy of src scaled to dest_width x dest_height . Leaves src unaffected. interp_type should be Gdk::INTERP_NEAREST if you want maximum speed (but when scaling down Gdk::INTERP_NEAREST is usually unusably ugly). The default interp_type should be Gdk::INTERP_BILINEAR which offers reasonable quality and speed. You can scale a sub-portion of src by creating a sub-pixbuf pointing into src ; see new_subpixbuf(). For more complicated scaling/compositing see scale() and composite().
|
|
|