1#ifndef _HAVE_MBPIXBUF_H
2#define _HAVE_MBPIXBUF_H
23#include <libmb/mbconfig.h>
44#include <X11/extensions/XShm.h>
118 MBPIXBUF_TRANS_ROTATE_90,
119 MBPIXBUF_TRANS_ROTATE_180,
120 MBPIXBUF_TRANS_ROTATE_270,
121 MBPIXBUF_TRANS_FLIP_VERT,
122 MBPIXBUF_TRANS_FLIP_HORIZ
126typedef struct _mb_pixbuf_col {
147 MBPixbufColor *palette;
150 int internal_bytespp;
168 int internal_bytespp;
179#define mb_pixbuf_img_set_pixel(i, x, y, r, g, b) { \
180 (i)->rgba[(((y)*(i)->width*4)+((x)*4))] = r; \
181 (i)->rgba[(((y)*(i)->width*4)+((x)*4))+1] = g; \
182 (i)->rgba[(((y)*(i)->width*4)+((x)*4))+2] = b; \
183 (i)->rgba[(((y)*(i)->width*4)+((x)*4))+3] = 0; \
191#define mb_pixbuf_img_set_pixel_alpha(i, x, y, a) { \
192 if ((i)->has_alpha) (i)->rgba[(((y)*(i)->width*(i->internal_bytespp+1))+((x)*(i->internal_bytespp+1)))+i->internal_bytespp] = a; \
202#define mb_pixbuf_img_get_width(image) (image)->width
209#define mb_pixbuf_img_get_height(image) (image)->height
216#define mb_pixbuf_get_depth(pb) (pb)->depth
223#define mb_pixbuf_img_has_alpha(image) (image)->has_alpha
357 const char *filename);
371 const unsigned char *data,
408 const unsigned long *data,
420 MBPixbufImage *image);
432 MBPixbufImage *image,
450 MBPixbufImage *image,
467 MBPixbufImage *image,
480 MBPixbufImage *image);
494 MBPixbufImage *image,
514 MBPixbufImage *image,
536 MBPixbufImage *image,
554 MBPixbufImage *image);
572 MBPixbufImage *image,
670 MBPixbufImage *image,
676 MBPixbufImage *image,
682 MBPixbufImage *image,
696 MBPixbufImage *image,
MBPixbufImage * mb_pixbuf_img_new(MBPixbuf *pb, int width, int height)
DEPRECIATED.
MBPixbufImage * mb_pixbuf_img_new_from_long_data(MBPixbuf *pixbuf, const unsigned long *data, int width, int height)
Creates an mbpixbuf image from arbituary supplied long ARGB data.
MBPixbufImage * mb_pixbuf_img_rgba_new(MBPixbuf *pixbuf, int width, int height)
Constructs a new blank mbpixbuf image with an alpha channel.
void mb_pixbuf_img_copy_composite_with_alpha(MBPixbuf *pixbuf, MBPixbufImage *dest, MBPixbufImage *src, int sx, int sy, int sw, int sh, int dx, int dy, int overall_alpha)
Like mb_pixbuf_img_copy_composite but sets an overall alpha value.
MBPixbufImage * mb_pixbuf_img_clone(MBPixbuf *pixbuf, MBPixbufImage *image)
Clones a exisiting mbpixbuf image.
void mb_pixbuf_img_free(MBPixbuf *pixbuf, MBPixbufImage *image)
Frees up a mbpixbuf image.
MBPixbufImage * mb_pixbuf_img_scale(MBPixbuf *pixbuf, MBPixbufImage *image, int new_width, int new_height)
Scales an image arbitually.
void mb_pixbuf_img_render_to_drawable_with_gc(MBPixbuf *pixbuf, MBPixbufImage *image, Drawable drw, int drw_x, int drw_y, GC gc)
Renders a mbpixbuf image to an X Drawable with a specified.
void mb_pixbuf_img_get_pixel(MBPixbuf *pixbuf, MBPixbufImage *image, int x, int y, unsigned char *r, unsigned char *g, unsigned char *b, unsigned char *a)
Gets the component values for a specified pixel.
void mb_pixbuf_img_composite(MBPixbuf *pb, MBPixbufImage *dest, MBPixbufImage *src, int dx, int dy)
DEPRECATED.
MBPixbufImage * mb_pixbuf_img_new_from_file(MBPixbuf *pixbuf, const char *filename)
Creates an mbpixbuf image from a file on disk.
void mb_pixbuf_img_render_to_drawable(MBPixbuf *pixbuf, MBPixbufImage *image, Drawable drw, int drw_x, int drw_y)
Renders a mbpixbuf image to an X Drawable.
void mb_pixbuf_img_copy(MBPixbuf *pixbuf, MBPixbufImage *dest, MBPixbufImage *src, int sx, int sy, int sw, int sh, int dx, int dy)
Copys an specified area of an image to another.
MBPixbufImage * mb_pixbuf_img_new_from_data(MBPixbuf *pixbuf, const unsigned char *data, int width, int height, Bool has_alpha)
Creates an mbpixbuf image from arbituary supplied rgb(a) data.
void mb_pixbuf_destroy(MBPixbuf *pixbuf)
Destroys a new MBPixbuf instance.
void mb_pixbuf_img_render_to_mask(MBPixbuf *pixbuf, MBPixbufImage *image, Drawable mask, int mask_x, int mask_y)
Renders alpha component mbpixbuf image to an X Bitmap.
void mb_pixbuf_img_fill(MBPixbuf *pixbuf, MBPixbufImage *image, int r, int g, int b, int a)
Fills an image with specified color / alpha level.
MBPixbufImage * mb_pixbuf_img_transform(MBPixbuf *pixbuf, MBPixbufImage *image, MBPixbufTransform transform)
Performs a basic transform on an image.
unsigned char * mb_pixbuf_img_data(MBPixbuf *pixbuf, MBPixbufImage *image)
Gets rgb(a) internal data representation of an image.
MBPixbufImage * mb_pixbuf_img_new_from_x_drawable(MBPixbuf *pixbuf, Drawable drawable, Drawable mask, int source_x, int source_y, int source_w, int source_h, Bool want_alpha)
Constructs a new blank mbpixbuf image with/without an alpha channel.
void mb_pixbuf_img_plot_pixel_with_alpha(MBPixbuf *pixbuf, MBPixbufImage *image, int x, int y, unsigned char r, unsigned char g, unsigned char b, unsigned char a)
Plots a pixel on specified image with alpha channel value.
MBPixbuf * mb_pixbuf_new(Display *display, int screen)
Constructs a new MBPixbuf instance.
MBPixbufTransform
enumerated types for mb_pixbuf_img_transform
void mb_pixbuf_img_copy_composite(MBPixbuf *pixbuf, MBPixbufImage *dest, MBPixbufImage *src, int sx, int sy, int sw, int sh, int dx, int dy)
Alpha composites an specified area of an image with another.
struct MBPixbufImage MBPixbufImage
Type for representing an mbpixbuf image.
unsigned long mb_pixbuf_lookup_x_pixel(MBPixbuf *pixbuf, int r, int g, int b, int a)
Get the X pixel representation for a given color.
MBPixbufImage * mb_pixbuf_img_rgb_new(MBPixbuf *pixbuf, int width, int height)
Constructs a new blank mbpixbuf image without an alpha channel.
MBPixbufImage * mb_pixbuf_img_new_from_int_data(MBPixbuf *pixbuf, const int *data, int width, int height)
Creates an mbpixbuf image from arbituary supplied INT ARGB data.
MBPixbufImage * mb_pixbuf_img_new_from_drawable(MBPixbuf *pixbuf, Drawable drawable, Drawable mask, int source_x, int source_y, int source_w, int source_h)
Depreicated.
void mb_pixbuf_img_plot_pixel(MBPixbuf *pixbuf, MBPixbufImage *image, int x, int y, unsigned char r, unsigned char g, unsigned char b)
Plots a pixel on specified image.
struct MBPixbuf MBPixbuf
Opaque structure used for all operations.
MBPixbuf * mb_pixbuf_new_extended(Display *dpy, int scr, Visual *vis, int depth)
Constructs a new MBPixbuf instance with non default depth and visual.