Ardour  9.0-pre0-582-g084a23a80d
Gdk::Pixbuf Class Reference

#include <pixbuf.h>

Inheritance diagram for Gdk::Pixbuf:
[legend]

Public Types

typedef sigc::slot< void, const guint8 * > SlotDestroyData
 
typedef Glib::SListHandle< Glib::RefPtr< PixbufFormat >, PixbufFormatTraits > SListHandle_PixbufFormat
 

Public Member Functions

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< Pixbufcopy () 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::Pixbufadd_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::Pixbufscale_simple (int dest_width, int dest_height, InterpType interp_type) const
 
Glib::RefPtr< Gdk::Pixbufcomposite_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::Pixbufrotate_simple (PixbufRotation angle) const
 
Glib::RefPtr< Gdk::Pixbufflip (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 Public Member Functions

static GType get_type () G_GNUC_CONST
 
static Glib::RefPtr< Gdk::Pixbufcreate (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::Pixbufcreate (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< Pixbufcreate (const Glib::RefPtr< Drawable > &src, const Glib::RefPtr< Colormap > &cmap, int src_x, int src_y, int width, int height)
 
static Glib::RefPtr< Pixbufcreate (const Glib::RefPtr< Drawable > &src, int src_x, int src_y, int width, int height)
 
static Glib::RefPtr< Pixbufcreate (const Glib::RefPtr< Image > &src, const Glib::RefPtr< Colormap > &cmap, int src_x, int src_y, int width, int height)
 
static Glib::RefPtr< Pixbufcreate (const Glib::RefPtr< Image > &src, int src_x, int src_y, int width, int height)
 
static Glib::RefPtr< Pixbufcreate (Colorspace colorspace, bool has_alpha, int bits_per_sample, int width, int height)
 
static Glib::RefPtr< Pixbufcreate_subpixbuf (const Glib::RefPtr< Pixbuf > &src_pixbuf, int src_x, int src_y, int width, int height)
 
static Glib::RefPtr< Pixbufcreate_from_file (const std::string &filename)
 
static Glib::RefPtr< Pixbufcreate_from_file (const std::string &filename, int width, int height, bool preserve_aspect_ratio=true)
 
static Glib::RefPtr< Pixbufcreate_from_data (const guint8 *data, Colorspace colorspace, bool has_alpha, int bits_per_sample, int width, int height, int rowstride)
 
static Glib::RefPtr< Pixbufcreate_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< Pixbufcreate_from_xpm_data (const char *const *data)
 
static Glib::RefPtr< Pixbufcreate_from_inline (int data_length, const guint8 *data, bool copy_pixels=false)
 
static Glib::RefPtr< Pixbufcreate_from_stream (const Glib::RefPtr< Gio::InputStream > &stream, const Glib::RefPtr< Gio::Cancellable > &cancelable)
 
static Glib::RefPtr< Pixbufcreate_from_stream (const Glib::RefPtr< Gio::InputStream > &stream)
 
static Glib::RefPtr< Pixbufcreate_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< Pixbufcreate_from_stream_at_scale (const Glib::RefPtr< Gio::InputStream > &stream, int width, int height, bool preserve_aspect_ratio)
 
static SListHandle_PixbufFormat get_formats ()
 

Protected Member Functions

 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)
 

Related Functions

(Note that these are not member functions.)

Glib::RefPtr< Gdk::Pixbufwrap (GdkPixbuf *object, bool take_copy=false)
 

Detailed Description

Definition at line 254 of file tk/ydkmm/ydkmm/gdkmm/pixbuf.h.

Member Typedef Documentation

◆ SListHandle_PixbufFormat

typedef Glib::SListHandle< Glib::RefPtr<PixbufFormat>, PixbufFormatTraits > Gdk::Pixbuf::SListHandle_PixbufFormat

Definition at line 870 of file tk/ydkmm/ydkmm/gdkmm/pixbuf.h.

◆ SlotDestroyData

typedef sigc::slot<void, const guint8*> Gdk::Pixbuf::SlotDestroyData

Definition at line 407 of file tk/ydkmm/ydkmm/gdkmm/pixbuf.h.

Constructor & Destructor Documentation

◆ ~Pixbuf()

virtual Gdk::Pixbuf::~Pixbuf ( )
virtual

◆ Pixbuf() [1/6]

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
srcSource drawable.
cmapA colormap.
src_xSource X coordinate within drawable.
src_ySource Y coordinate within drawable.
widthWidth in pixels of region to get.
heightHeight in pixels of region to get.

◆ Pixbuf() [2/6]

Gdk::Pixbuf::Pixbuf ( const Glib::RefPtr< Drawable > &  src,
int  src_x,
int  src_y,
int  width,
int  height 
)
protected

Creates a pixbuf object from a drawable, using the colormap from the drawable.

Parameters
srcSource drawable.
src_xSource X coordinate within drawable.
src_ySource Y coordinate within drawable.
widthWidth in pixels of region to get.
heightHeight in pixels of region to get.

◆ Pixbuf() [3/6]

Gdk::Pixbuf::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 
)
protected

◆ Pixbuf() [4/6]

Gdk::Pixbuf::Pixbuf ( const Glib::RefPtr< Image > &  src,
const Glib::RefPtr< Colormap > &  cmap,
int  src_x,
int  src_y,
int  width,
int  height 
)
protected

Creates a pixbuf object from an image.

Parameters
srcSource Image.
cmapA colormap.
src_xSource X coordinate within the image.
src_ySource Y coordinate within the image.
widthWidth in pixels of region to get.
heightHeight in pixels of region to get.

◆ Pixbuf() [5/6]

Gdk::Pixbuf::Pixbuf ( const Glib::RefPtr< Image > &  src,
int  src_x,
int  src_y,
int  width,
int  height 
)
protected

Creates a pixbuf object from an image, using the colormap from the image.

Parameters
srcSource Image.
src_xSource X coordinate within the image.
src_ySource Y coordinate within the image.
widthWidth in pixels of region to get.
heightHeight in pixels of region to get.

◆ Pixbuf() [6/6]

Gdk::Pixbuf::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 
)
protected

Member Function Documentation

◆ add_alpha()

Glib::RefPtr<Gdk::Pixbuf> Gdk::Pixbuf::add_alpha ( bool  substitute_color,
guint8  r,
guint8  g,
guint8  b 
) const

◆ composite()

void Gdk::Pixbuf::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

◆ composite_color()

void Gdk::Pixbuf::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

◆ composite_color_simple()

Glib::RefPtr<Gdk::Pixbuf> 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

◆ copy()

Glib::RefPtr<Pixbuf> Gdk::Pixbuf::copy ( ) const

◆ copy_area()

void Gdk::Pixbuf::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

◆ create() [1/7]

static Glib::RefPtr<Pixbuf> Gdk::Pixbuf::create ( Colorspace  colorspace,
bool  has_alpha,
int  bits_per_sample,
int  width,
int  height 
)
static

◆ create() [2/7]

static Glib::RefPtr<Gdk::Pixbuf> 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

◆ create() [3/7]

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
srcSource drawable.
cmapA colormap.
src_xSource X coordinate within drawable.
src_ySource Y coordinate within drawable.
widthWidth in pixels of region to get.
heightHeight in pixels of region to get.

◆ create() [4/7]

static Glib::RefPtr<Pixbuf> Gdk::Pixbuf::create ( const Glib::RefPtr< Drawable > &  src,
int  src_x,
int  src_y,
int  width,
int  height 
)
static

Creates a pixbuf object from a drawable, using the colormap from the drawable.

Parameters
srcSource drawable.
src_xSource X coordinate within drawable.
src_ySource Y coordinate within drawable.
widthWidth in pixels of region to get.
heightHeight in pixels of region to get.

◆ create() [5/7]

static Glib::RefPtr<Gdk::Pixbuf> 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

◆ create() [6/7]

static Glib::RefPtr<Pixbuf> Gdk::Pixbuf::create ( const Glib::RefPtr< Image > &  src,
const Glib::RefPtr< Colormap > &  cmap,
int  src_x,
int  src_y,
int  width,
int  height 
)
static

Creates a pixbuf object from an image.

Parameters
srcSource Image.
cmapA colormap.
src_xSource X coordinate within the image.
src_ySource Y coordinate within the image.
widthWidth in pixels of region to get.
heightHeight in pixels of region to get.

◆ create() [7/7]

static Glib::RefPtr<Pixbuf> Gdk::Pixbuf::create ( const Glib::RefPtr< Image > &  src,
int  src_x,
int  src_y,
int  width,
int  height 
)
static

Creates a pixbuf object from an image, using the colormap from the image.

Parameters
srcSource Image.
src_xSource X coordinate within the image.
src_ySource Y coordinate within the image.
widthWidth in pixels of region to get.
heightHeight in pixels of region to get.

◆ create_from_data() [1/2]

static Glib::RefPtr<Pixbuf> Gdk::Pixbuf::create_from_data ( const guint8 *  data,
Colorspace  colorspace,
bool  has_alpha,
int  bits_per_sample,
int  width,
int  height,
int  rowstride 
)
static

Creates a new Gdk::Pixbuf out of in-memory image data. Currently only RGB images with 8 bits per sample are supported.

Parameters
dataImage data in 8-bit/sample packed format.
colorspaceColorspace for the image data.
has_alphaWhether the data has an opacity channel.
bits_per_sampleNumber of bits per sample.
widthWidth of the image in pixels.
heightHeight of the image in pixels.
rowstrideDistance in bytes between rows.
Returns
A newly-created Gdk::Pixbuf object.

◆ create_from_data() [2/2]

static Glib::RefPtr<Pixbuf> Gdk::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

Creates a new Gdk::Pixbuf out of in-memory image data. Currently only RGB images with 8 bits per sample are supported.

Parameters
dataImage data in 8-bit/sample packed format.
colorspaceColorspace for the image data.
has_alphaWhether the data has an opacity channel.
bits_per_sampleNumber of bits per sample.
widthWidth of the image in pixels.
heightHeight of the image in pixels.
rowstrideDistance in bytes between rows.
destroy_slotSlot used to free the data when the pixbuf's reference count drops to zero.
Returns
A newly-created Gdk::Pixbuf object.

◆ create_from_file() [1/2]

static Glib::RefPtr<Pixbuf> Gdk::Pixbuf::create_from_file ( const std::string &  filename)
static

Creates a new pixbuf by loading an image from a file. The file format is detected automatically.

Parameters
filenameThe path to the pixbuf file.
Exceptions
Glib::FileError
Gdk::PixbufError

◆ create_from_file() [2/2]

static Glib::RefPtr<Pixbuf> Gdk::Pixbuf::create_from_file ( const std::string &  filename,
int  width,
int  height,
bool  preserve_aspect_ratio = true 
)
static

Creates a new pixbuf by loading an image from a file. The file format is detected automatically. The image will be scaled to fit in the requested size.

Parameters
filenameThe path to the pixbuf file.
widthThe desired width
heightThe desired height
preserve_aspect_ratioWhether the image's aspect ratio will be preserved when scaling.
Exceptions
Glib::FileError
Gdk::PixbufError

◆ create_from_inline()

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_lengthLength in bytes of the data argument.
dataByte data containing a serialized GdkPixdata structure.
copy_pixelsWhether to copy the pixel data, or use direct pointers to data for the resulting pixbuf.
Exceptions
Gdk::PixbufError

◆ create_from_stream() [1/2]

static Glib::RefPtr<Pixbuf> Gdk::Pixbuf::create_from_stream ( const Glib::RefPtr< Gio::InputStream > &  stream)
static

◆ create_from_stream() [2/2]

static Glib::RefPtr<Pixbuf> Gdk::Pixbuf::create_from_stream ( const Glib::RefPtr< Gio::InputStream > &  stream,
const Glib::RefPtr< Gio::Cancellable > &  cancelable 
)
static

◆ create_from_stream_at_scale() [1/2]

static Glib::RefPtr<Pixbuf> Gdk::Pixbuf::create_from_stream_at_scale ( const Glib::RefPtr< Gio::InputStream > &  stream,
int  width,
int  height,
bool  preserve_aspect_ratio 
)
static

◆ create_from_stream_at_scale() [2/2]

static Glib::RefPtr<Pixbuf> Gdk::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

◆ create_from_xpm_data()

static Glib::RefPtr<Pixbuf> Gdk::Pixbuf::create_from_xpm_data ( const char *const *  data)
static

◆ create_subpixbuf()

static Glib::RefPtr<Pixbuf> Gdk::Pixbuf::create_subpixbuf ( const Glib::RefPtr< Pixbuf > &  src_pixbuf,
int  src_x,
int  src_y,
int  width,
int  height 
)
static
Parameters
src_pixbufA Gdk::Pixbuf.
src_xX coord in src_pixbuf.
src_yY coord in src_pixbuf.
widthWidth of region in src_pixbuf.
heightHeight of region in src_pixbuf.

◆ fill()

void Gdk::Pixbuf::fill ( guint32  pixel)

◆ flip()

Glib::RefPtr<Gdk::Pixbuf> Gdk::Pixbuf::flip ( bool  horizontal = true) const

◆ get_bits_per_sample()

int Gdk::Pixbuf::get_bits_per_sample ( ) const

◆ get_colorspace()

Colorspace Gdk::Pixbuf::get_colorspace ( ) const

◆ get_formats()

static SListHandle_PixbufFormat Gdk::Pixbuf::get_formats ( )
static

Obtains the available information about the image formats supported by GdkPixbuf.

Returns
A list of PixbufFormats describing the supported image formats.

◆ get_has_alpha()

bool Gdk::Pixbuf::get_has_alpha ( ) const

◆ get_height()

int Gdk::Pixbuf::get_height ( ) const

◆ get_n_channels()

int Gdk::Pixbuf::get_n_channels ( ) const

◆ get_option()

Glib::ustring Gdk::Pixbuf::get_option ( const Glib::ustring &  key) const

◆ get_pixels()

guint8* Gdk::Pixbuf::get_pixels ( ) const

◆ get_rowstride()

int Gdk::Pixbuf::get_rowstride ( ) const

◆ get_type()

static GType Gdk::Pixbuf::get_type ( )
static

Get the GType for this class, for use with the underlying GObject type system.

◆ get_width()

int Gdk::Pixbuf::get_width ( ) const

◆ gobj() [1/2]

GdkPixbuf* Gdk::Pixbuf::gobj ( )
inline

Provides access to the underlying C GObject.

Definition at line 293 of file tk/ydkmm/ydkmm/gdkmm/pixbuf.h.

◆ gobj() [2/2]

const GdkPixbuf* Gdk::Pixbuf::gobj ( ) const
inline

Provides access to the underlying C GObject.

Definition at line 296 of file tk/ydkmm/ydkmm/gdkmm/pixbuf.h.

◆ gobj_copy()

GdkPixbuf* Gdk::Pixbuf::gobj_copy ( )

Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.

◆ render_pixmap_and_mask()

void Gdk::Pixbuf::render_pixmap_and_mask ( Glib::RefPtr< Pixmap > &  pixmap_return,
Glib::RefPtr< Bitmap > &  mask_return,
int  alpha_threshold 
)

◆ render_pixmap_and_mask_for_colormap()

void Gdk::Pixbuf::render_pixmap_and_mask_for_colormap ( const Glib::RefPtr< Colormap > &  colormap,
Glib::RefPtr< Pixmap > &  pixmap_return,
Glib::RefPtr< Bitmap > &  mask_return,
int  alpha_threshold 
)

◆ render_threshold_alpha()

void Gdk::Pixbuf::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.

Parameters
bitmapBitmap where the bilevel mask will be painted to.
src_xSource X coordinate.
src_ySource Y coordinate.
dest_xDestination X coordinate.
dest_yDestination Y coordinate.
widthWidth of region to threshold, or -1 to use pixbuf width.
heightHeight of region to threshold, or -1 to use pixbuf height.
alpha_thresholdOpacity values below this will be painted as zero; all other values will be painted as one.

◆ render_to_drawable()

void Gdk::Pixbuf::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. 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.

Deprecated: 2.4: This function is obsolete. Use gdk_draw_pixbuf() instead.

Parameters
drawableDestination drawable.
gcGC used for rendering.
src_xSource X coordinate within pixbuf.
src_ySource Y coordinate within pixbuf.
dest_xDestination X coordinate within drawable.
dest_yDestination Y coordinate within drawable.
widthWidth of region to render, in pixels, or -1 to use pixbuf width.
heightHeight of region to render, in pixels, or -1 to use pixbuf height.
ditherDithering mode for GdkRGB.
x_ditherX offset for dither.
y_ditherY offset for dither.

◆ render_to_drawable_alpha()

void Gdk::Pixbuf::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. 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-0 window argument. Otherwise a colormap must be set on them with gdk_drawable_set_colormap.

On older X servers, rendering pixbufs with an alpha channel involves round trips to the X server, and may be somewhat slow.

Deprecated: 2.4: This function is obsolete. Use gdk_draw_pixbuf() instead.

Parameters
drawableDestination drawable.
src_xSource X coordinate within pixbuf.
src_ySource Y coordinates within pixbuf.
dest_xDestination X coordinate within drawable.
dest_yDestination Y coordinate within drawable.
widthWidth of region to render, in pixels, or -1 to use pixbuf width.
heightHeight of region to render, in pixels, or -1 to use pixbuf height.
alpha_modeIgnored. Present for backwards compatibility.
alpha_thresholdIgnored. Present for backwards compatibility.
ditherDithering mode for GdkRGB.
x_ditherX offset for dither.
y_ditherY offset for dither.

◆ rotate_simple()

Glib::RefPtr<Gdk::Pixbuf> Gdk::Pixbuf::rotate_simple ( PixbufRotation  angle) const

◆ saturate_and_pixelate()

void Gdk::Pixbuf::saturate_and_pixelate ( const Glib::RefPtr< Gdk::Pixbuf > &  dest,
float  saturation,
bool  pixelate 
) const

◆ save() [1/2]

void Gdk::Pixbuf::save ( const std::string &  filename,
const Glib::ustring &  type 
)

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. The list of all writable formats can be determined by using get_formats() with is_writable().

Parameters
filenameThe path of the file to be created.
typeThe file type.
Exceptions
Glib::FileError
Gdk::PixbufError

◆ save() [2/2]

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
filenameThe path of the file to be created.
typeThe file type.
option_keys
option_values
Exceptions
Glib::FileError
Gdk::PixbufError

◆ save_to_buffer() [1/2]

void Gdk::Pixbuf::save_to_buffer ( gchar *&  buffer,
gsize &  buffer_size,
const Glib::ustring &  type,
const Glib::StringArrayHandle &  option_keys,
const Glib::StringArrayHandle &  option_values 
)

◆ save_to_buffer() [2/2]

void Gdk::Pixbuf::save_to_buffer ( gchar *&  buffer,
gsize &  buffer_size,
const Glib::ustring &  type = "png" 
)

◆ scale()

void Gdk::Pixbuf::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

◆ scale_simple()

Glib::RefPtr<Gdk::Pixbuf> Gdk::Pixbuf::scale_simple ( int  dest_width,
int  dest_height,
InterpType  interp_type 
) const

Friends And Related Function Documentation

◆ wrap()

Glib::RefPtr< Gdk::Pixbuf > wrap ( GdkPixbuf *  object,
bool  take_copy = false 
)
related

A Glib::wrap() method for this object.

Parameters
objectThe C instance.
take_copyFalse if the result should take ownership of the C instance. True if it should take a new copy or ref.
Returns
A C++ instance that wraps this C instance.

The documentation for this class was generated from the following file: