[cairo-commit] cairomm/cairomm surface.cc, 1.13, 1.14 surface.h,
1.11, 1.12
Jonathon Jongsma
commit at pdx.freedesktop.org
Mon Jun 26 06:18:47 PDT 2006
Committed by: jjongsma
Update of /cvs/cairo/cairomm/cairomm
In directory kemper:/tmp/cvs-serv20664/cairomm
Modified Files:
surface.cc surface.h
Log Message:
2006-06-26 Jonathon Jongsma <jonathon.jongsma at gmail.com>
* cairomm/surface.cc:
* cairomm/surface.h: Added new Surface and ImageSurface API from 1.1.x
snapshots
Index: surface.cc
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/surface.cc,v
retrieving revision 1.13
retrieving revision 1.14
diff -u -d -r1.13 -r1.14
--- surface.cc 13 Jun 2006 02:08:23 -0000 1.13
+++ surface.cc 26 Jun 2006 13:18:45 -0000 1.14
@@ -76,6 +76,11 @@
check_object_status_and_throw_exception(*this);
}
+void Surface::get_device_offset(double& x_offset, double& y_offset)
+{
+ cairo_surface_get_device_offset(m_cobject, &x_offset, &y_offset);
+}
+
void Surface::set_fallback_resolution(double x_pixels_per_inch, double y_pixels_per_inch)
{
cairo_surface_set_fallback_resolution(m_cobject, x_pixels_per_inch, y_pixels_per_inch);
@@ -170,6 +175,25 @@
return result;
}
+unsigned char* ImageSurface::get_data()
+{
+ return cairo_image_surface_get_data(m_cobject);
+}
+
+const unsigned char* ImageSurface::get_data() const
+{
+ return cairo_image_surface_get_data(m_cobject);
+}
+
+Format ImageSurface::get_format() const
+{
+ return static_cast<Format>(cairo_image_surface_get_format(m_cobject));
+}
+
+int ImageSurface::get_stride() const
+{
+ return cairo_image_surface_get_stride(m_cobject);
+}
/*******************************************************************************
Index: surface.h
===================================================================
RCS file: /cvs/cairo/cairomm/cairomm/surface.h,v
retrieving revision 1.11
retrieving revision 1.12
diff -u -d -r1.11 -r1.12
--- surface.h 13 Jun 2006 02:08:23 -0000 1.11
+++ surface.h 26 Jun 2006 13:18:45 -0000 1.12
@@ -137,6 +137,10 @@
*/
void set_device_offset(double x_offset, double y_offset);
+ /** Returns a previous device offset set by set_device_offset().
+ */
+ void get_device_offset(double& x_offset, double& y_offset);
+
/** Sets the fallback resolution of the image in dots per inch
*
* @param x_pixels_per_inch Pixels per inch in the x direction
@@ -250,6 +254,29 @@
*/
int get_height() const;
+ /**
+ * Get a pointer to the data of the image surface, for direct
+ * inspection or modification.
+ *
+ * Return value: a pointer to the image data of this surface or NULL
+ * if @surface is not an image surface.
+ */
+ unsigned char* get_data();
+ const unsigned char* get_data() const;
+
+ /** gets the format of the surface
+ */
+ Format get_format() const;
+
+ /**
+ * Return value: the stride of the image surface in bytes (or 0 if
+ * @surface is not an image surface). The stride is the distance in
+ * bytes from the beginning of one row of the image data to the
+ * beginning of the next row.
+ */
+ int get_stride() const;
+
+
/** Creates an image surface of the specified format and dimensions. The
* initial contents of the surface is undefined; you must explicitely clear
* the buffer, using, for example, Cairo::Context::rectangle() and
More information about the cairo-commit
mailing list