* Lesser General Public License for more details.
*
* You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
+ * License along with this library. If not, see <http://www.gnu.org/licenses/>.
*/
#include "config.h"
/**
* SECTION:pixbufs
- * @Short_description: Functions for rendering pixbufs on drawables
+ * @Short_description: Functions for obtaining pixbufs
* @Title: Pixbufs
*
- * These functions allow to render pixbufs on drawables. Pixbufs are
- * client-side images. For details on how to create and manipulate
- * pixbufs, see the #GdkPixbuf API documentation.
+ * Pixbufs are client-side images. For details on how to create
+ * and manipulate pixbufs, see the #GdkPixbuf API documentation.
+ *
+ * The functions described here allow to obtain pixbufs from
+ * #GdkWindows and cairo surfaces.
*/
* representation inside a #GdkPixbuf. 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.
- *
+ *
* This function will create an RGB pixbuf with 8 bits per channel with
* the same size specified by the @width and @height arguments. The pixbuf
* will contain an alpha channel if the @window contains one.
* it returns %NULL; so check the return value.)
*
* Return value: (transfer full): A newly-created pixbuf with a reference
- * count of 1, or %NULL on error
- **/
+ * count of 1, or %NULL on error
+ */
GdkPixbuf *
-gdk_pixbuf_get_from_window (GdkWindow *src,
- int src_x, int src_y,
- int width, int height)
+gdk_pixbuf_get_from_window (GdkWindow *src,
+ gint src_x,
+ gint src_y,
+ gint width,
+ gint height)
{
cairo_surface_t *surface;
GdkPixbuf *dest;
-
+
g_return_val_if_fail (GDK_IS_WINDOW (src), NULL);
g_return_val_if_fail (gdk_window_is_viewable (src), NULL);
return dest;
}
-
+
static cairo_format_t
gdk_cairo_format_for_content (cairo_content_t content)
{
static cairo_surface_t *
gdk_cairo_surface_coerce_to_image (cairo_surface_t *surface,
- cairo_content_t content,
- int src_x,
- int src_y,
- int width,
- int height)
+ cairo_content_t content,
+ int src_x,
+ int src_y,
+ int width,
+ int height)
{
cairo_surface_t *copy;
cairo_t *cr;
}
static void
-convert_alpha (guchar *dest_data,
- int dest_stride,
- guchar *src_data,
- int src_stride,
- int src_x,
- int src_y,
- int width,
- int height)
+convert_alpha (guchar *dest_data,
+ int dest_stride,
+ guchar *src_data,
+ int src_stride,
+ int src_x,
+ int src_y,
+ int width,
+ int height)
{
int x, y;
}
static void
-convert_no_alpha (guchar *dest_data,
- int dest_stride,
- guchar *src_data,
- int src_stride,
- int src_x,
- int src_y,
- int width,
- int height)
+convert_no_alpha (guchar *dest_data,
+ int dest_stride,
+ guchar *src_data,
+ int src_stride,
+ int src_x,
+ int src_y,
+ int width,
+ int height)
{
int x, y;
* individual pixels from cairo surfaces. For #GdkWindows, use
* gdk_pixbuf_get_from_window() instead.
*
- * This function will create an RGB pixbuf with 8 bits per channel. The pixbuf
- * will contain an alpha channel if the @surface contains one.
+ * This function will create an RGB pixbuf with 8 bits per channel.
+ * The pixbuf will contain an alpha channel if the @surface contains one.
*
- * Return value: (transfer full): A newly-created pixbuf with a reference count
- * of 1, or %NULL on error
- **/
+ * Return value: (transfer full): A newly-created pixbuf with a reference
+ * count of 1, or %NULL on error
+ */
GdkPixbuf *
gdk_pixbuf_get_from_surface (cairo_surface_t *surface,
- int src_x,
- int src_y,
- int width,
- int height)
+ gint src_x,
+ gint src_y,
+ gint width,
+ gint height)
{
cairo_content_t content;
GdkPixbuf *dest;
-
+
/* General sanity checks */
g_return_val_if_fail (surface != NULL, NULL);
g_return_val_if_fail (width > 0 && height > 0, NULL);
8,
width, height);
- surface = gdk_cairo_surface_coerce_to_image (surface, content, src_x, src_y,
+ surface = gdk_cairo_surface_coerce_to_image (surface, content,
+ src_x, src_y,
width, height);
cairo_surface_flush (surface);
if (cairo_surface_status (surface) || dest == NULL)
cairo_surface_destroy (surface);
return dest;
}
-