2
// Generated by gtkmmproc -- DO NOT MODIFY!
9
/* $Id: image.hg,v 1.5 2006/04/12 11:11:24 murrayc Exp $ */
13
* Copyright (C) 1998-2002 The gtkmm Development Team
15
* This library is free software; you can redistribute it and/or
16
* modify it under the terms of the GNU Lesser General Public
17
* License as published by the Free Software Foundation; either
18
* version 2.1 of the License, or (at your option) any later version.
20
* This library is distributed in the hope that it will be useful,
21
* but WITHOUT ANY WARRANTY; without even the implied warranty of
22
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
23
* Lesser General Public License for more details.
25
* You should have received a copy of the GNU Lesser General Public
26
* License along with this library; if not, write to the Free
27
* Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
30
#include <glibmm/object.h>
31
#include <gdkmm/visual.h>
32
#include <gdkmm/colormap.h>
33
#include <gdkmm/types.h> //For ByteOrder.
36
#ifndef DOXYGEN_SHOULD_SKIP_THIS
37
typedef struct _GdkImage GdkImage;
38
typedef struct _GdkImageClass GdkImageClass;
39
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
43
{ class Image_Class; } // namespace Gdk
47
/** @addtogroup gdkmmEnums gdkmm Enums and Flags */
62
#ifndef DOXYGEN_SHOULD_SKIP_THIS
67
class Value<Gdk::ImageType> : public Glib::Value_Enum<Gdk::ImageType>
70
static GType value_type() G_GNUC_CONST;
74
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
81
/** This represents an area for drawing graphics. It has now been superceded to a large extent by the much more flexible
82
* Gdk::Drawable RGB functions.
83
* To create an image from part of a Gdk::Window use Gdk::Drawable::get_image().
85
* The image can be manipulated with get_pixel() and put_pixel(), or alternatively by changing the actual pixel data, though
86
* manipulating the pixel data requires complicated code to cope with the different formats that may be used.
87
* To draw a Gdk::Image in a Gdk::Window or Gdk::Pixmap use Gdk::Drawable::draw_image().
90
class Image : public Glib::Object
93
#ifndef DOXYGEN_SHOULD_SKIP_THIS
96
typedef Image CppObjectType;
97
typedef Image_Class CppClassType;
98
typedef GdkImage BaseObjectType;
99
typedef GdkImageClass BaseClassType;
101
private: friend class Image_Class;
102
static CppClassType image_class_;
107
Image& operator=(const Image&);
110
explicit Image(const Glib::ConstructParams& construct_params);
111
explicit Image(GdkImage* castitem);
113
#endif /* DOXYGEN_SHOULD_SKIP_THIS */
118
#ifndef DOXYGEN_SHOULD_SKIP_THIS
119
static GType get_type() G_GNUC_CONST;
122
static GType get_base_type() G_GNUC_CONST;
125
///Provides access to the underlying C GObject.
126
GdkImage* gobj() { return reinterpret_cast<GdkImage*>(gobject_); }
128
///Provides access to the underlying C GObject.
129
const GdkImage* gobj() const { return reinterpret_cast<GdkImage*>(gobject_); }
131
///Provides access to the underlying C instance. The caller is responsible for unrefing it. Use when directly setting fields in structs.
132
GdkImage* gobj_copy();
139
/** Instantiate a new Gdk::Image.
141
* @param type The type of the Gdk::Image. Gdk::IMAGE_FASTEST is probably the best choice, since it will try to create a Gdk::IMAGE_SHARED image first and if that fails it will then use Gdk::IMAGE_NORMAL.
142
* @param visual The Gdk::Visual to use for the image.
143
* @param width The width of the image in pixels.
144
* @param height The height of the image in pixels.
146
Image(ImageType type, const Glib::RefPtr<Visual>& visual, int width, int height);
151
static Glib::RefPtr<Image> create(ImageType type, const Glib::RefPtr<Visual>& visual, int width, int height);
154
//We ignore gdk_image_new_bitmap() because the documentation says that it is deprecated.
157
void put_pixel(int x, int y, guint32 pixel);
159
guint32 get_pixel(int x, int y) const;
161
/** Sets the colormap for the image to the given colormap. Normally
162
* there's no need to use this function, images are created with the
163
* correct colormap if you get the image from a drawable. If you
164
* create the image from scratch, use the colormap of the drawable you
165
* intend to render the image to.
167
* Deprecated: 2.22: Gdk::Image should not be used anymore.
168
* @param colormap A Gdk::Colormap.
170
void set_colormap(const Glib::RefPtr<Colormap>& colormap);
172
/** Retrieves the colormap for a given image, if it exists. An image
173
* will have a colormap if the drawable from which it was created has
174
* a colormap, or if a colormap was set explicitely with
177
* Deprecated: 2.22: Gdk::Image should not be used anymore.
178
* @return Colormap for the image.
180
Glib::RefPtr<Colormap> get_colormap();
182
/** Retrieves the colormap for a given image, if it exists. An image
183
* will have a colormap if the drawable from which it was created has
184
* a colormap, or if a colormap was set explicitely with
187
* Deprecated: 2.22: Gdk::Image should not be used anymore.
188
* @return Colormap for the image.
190
Glib::RefPtr<const Colormap> get_colormap() const;
193
/** Determines the type of a given image.
197
* Deprecated: 2.22: Gdk::Image should not be used anymore.
198
* @return The Gdk::ImageType of the image.
200
ImageType get_image_type() const;
202
/** Determines the visual that was used to create the image.
206
* Deprecated: 2.22: Gdk::Image should not be used anymore.
207
* @return A Gdk::Visual.
209
Glib::RefPtr<Visual> get_visual();
211
/** Determines the visual that was used to create the image.
215
* Deprecated: 2.22: Gdk::Image should not be used anymore.
216
* @return A Gdk::Visual.
218
Glib::RefPtr<const Visual> get_visual() const;
220
/** Determines the byte order of the image.
224
* Deprecated: 2.22: Gdk::Image should not be used anymore.
225
* @return A Gdk::Visual.
227
ByteOrder get_byte_order() const;
229
/** Determines the width of the image.
233
* Deprecated: 2.22: Gdk::Image should not be used anymore.
236
int get_width() const;
238
/** Determines the height of the image.
242
* Deprecated: 2.22: Gdk::Image should not be used anymore.
243
* @return The height.
245
int get_height() const;
247
/** Determines the depth of the image.
251
* Deprecated: 2.22: Gdk::Image should not be used anymore.
254
guint16 get_depth() const;
257
#ifndef GDKMM_DISABLE_DEPRECATED
259
/** Determines the number of bytes per pixel of the image.
263
* Deprecated: 2.22: Gdk::Image should not be used anymore.
264
* @deprecated Use get_bytes_per_pixel()
265
* @return The bytes per pixel.
267
guint16 get_bpp() const;
268
#endif // GDKMM_DISABLE_DEPRECATED
271
/** Determines the number of bytes per pixel of the image.
275
* Deprecated: 2.22: Gdk::Image should not be used anymore.
276
* @return The bytes per pixel.
278
guint16 get_bytes_per_pixel() const;
281
#ifndef GDKMM_DISABLE_DEPRECATED
283
/** Determines the number of bytes per line of the image.
287
* Deprecated: 2.22: Gdk::Image should not be used anymore.
288
* @deprecated Use get_bytes_per_line()
289
* @return The bytes per line.
291
guint16 get_bpl() const;
292
#endif // GDKMM_DISABLE_DEPRECATED
295
/** Determines the number of bytes per line of the image.
299
* Deprecated: 2.22: Gdk::Image should not be used anymore.
300
* @return The bytes per line.
302
guint16 get_bytes_per_line() const;
305
/** Determines the number of bits per pixel of the image.
309
* Deprecated: 2.22: Gdk::Image should not be used anymore.
310
* @return The bits per pixel.
312
guint16 get_bits_per_pixel() const;
315
/** Returns a pointer to the pixel data of the image.
319
* Deprecated: 2.22: Gdk::Image should not be used anymore.
320
* @return The pixel data of the image.
324
/** Returns a pointer to the pixel data of the image.
328
* Deprecated: 2.22: Gdk::Image should not be used anymore.
329
* @return The pixel data of the image.
331
const void* get_pixels() const;
333
#ifndef GDKMM_DISABLE_DEPRECATED
335
//This memory block is not read-only, apparently:
336
/** @deprecated Use get_pixels().
339
const void* get_mem() const;
340
#endif // GDKMM_DISABLE_DEPRECATED
343
//TODO: This should be const really.
344
void* get_windowing_data() const;
350
//C++ methods used to invoke GTK+ virtual functions:
353
//GTK+ Virtual Functions (override these to change behaviour):
355
//Default Signal Handlers::
360
} /* namespace Gdk */
365
/** A Glib::wrap() method for this object.
367
* @param object The C instance.
368
* @param take_copy False if the result should take ownership of the C instance. True if it should take a new copy or ref.
369
* @result A C++ instance that wraps this C instance.
371
* @relates Gdk::Image
373
Glib::RefPtr<Gdk::Image> wrap(GdkImage* object, bool take_copy = false);
377
#endif /* _GDKMM_IMAGE_H */