logo top
Main Page   Widgets   Namespaces   Book  

Gdk::Pixbuf Class Reference

Inheritance diagram for Gdk::Pixbuf:

Inheritance graph
[legend]
List of all members.

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<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)
 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::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
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

Glib::RefPtr<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)
Glib::RefPtr<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)
Glib::RefPtr<Pixbufcreate (Colorspace colorspace, bool has_alpha, int bits_per_sample, int width, int height)
Glib::RefPtr<Pixbufcreate_subpixbuf (const Glib::RefPtr<Pixbuf>& pixbuf, int src_x, int src_y, int width, int height)
Glib::RefPtr<Pixbufcreate_from_file (const std::string& filename)
 Load an image file.

Glib::RefPtr<Pixbufcreate_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<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)
 Creates a new Gdk::Pixbuf out of in-memory image data.

Glib::RefPtr<Pixbufcreate_from_xpm_data (const char* const* data)
Glib::RefPtr<Pixbufcreate_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::Pixbufwrap (GdkPixbuf* object, bool take_copy=false)

Member Typedef Documentation

typedef SigC::Slot1<void,const guint8*> Gdk::Pixbuf::SlotDestroyData
 


Constructor & Destructor Documentation

virtual Gdk::Pixbuf::~Pixbuf (  )  [virtual]
 

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]
 

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

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

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
 

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
 

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
 

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

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
 

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

Glib::RefPtr<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]
 

Glib::RefPtr<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]
 

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:
data Image data in 8-bit/sample packed format.
colorspace Colorspace for the image data.
has_alpha Whether the data has an opacity channel.
bits_per_sample Number of bits per sample.
width Width of the image in pixels.
height Height of the image in pixels.
rowstride Distance in bytes between rows.
destroy_slot Slot used to free the data when the pixbuf's reference count drops to zero.
Returns:
A newly-created Gdk::Pixbuf object.

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:
data Image data in 8-bit/sample packed format.
colorspace Colorspace for the image data.
has_alpha Whether the data has an opacity channel.
bits_per_sample Number of bits per sample.
width Width of the image in pixels.
height Height of the image in pixels.
rowstride Distance in bytes between rows.
Returns:
A newly-created Gdk::Pixbuf object.

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

Load an image file.

Exceptions:
Glib::FileError 
Gdk::PixbufError 

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:
Gdk::PixbufError 

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

Glib::RefPtr<Pixbuf> Gdk::Pixbuf::create_subpixbuf ( const Glib::RefPtr<Pixbuf>&  pixbuf,
int  src_x,
int  src_y,
int  width,
int  height
[static]
 

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

int Gdk::Pixbuf::get_bits_per_sample (  )  const
 

Colorspace Gdk::Pixbuf::get_colorspace (  )  const
 

bool Gdk::Pixbuf::get_has_alpha (  )  const
 

int Gdk::Pixbuf::get_height (  )  const
 

int Gdk::Pixbuf::get_n_channels (  )  const
 

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

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

int Gdk::Pixbuf::get_rowstride (  )  const
 

int Gdk::Pixbuf::get_width (  )  const
 

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

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

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

Provides access to the underlying C GObject.

Reimplemented from Glib::ObjectBase.

GdkPixbuf* Gdk::Pixbuf::gobj_copy (  ) 
 

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

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
 

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
 

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
 

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
 

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

void Gdk::Pixbuf::save ( const std::string&  filename,
const Glib::ustring type,
const Glib::StringArrayHandle option_keys,
const Glib::StringArrayHandle option_values
 

Save an image file.

Exceptions:
Glib::FileError 
Gdk::PixbufError 

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

Save an image file.

Exceptions:
Glib::FileError 
Gdk::PixbufError 

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
 

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


Friends And Related Function Documentation

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


The documentation for this class was generated from the following file:
Generated for gtkmm 2.2 by Doxygen 1.3.4 © 1997-2001