Defines | |
| #define | mb_pixbuf_img_set_pixel(i, x, y, r, g, b) |
| DEPRICIATED. | |
| #define | mb_pixbuf_img_set_pixel_alpha(i, x, y, a) |
| sets a pixels alpha value | |
| #define | mb_pixbuf_img_get_width(image) (image)->width |
| returns image width | |
| #define | mb_pixbuf_img_get_height(image) (image)->height |
| returns image height | |
| #define | mb_pixbuf_get_depth(pb) (pb)->depth |
| returns pixbuf instance depth | |
| #define | mb_pixbuf_img_has_alpha(image) (image)->has_alpha |
| Returns True if image has an alpha channel. | |
Typedefs | |
| typedef MBPixbuf | MBPixbuf |
| Opaque structure used for all operations. | |
| typedef MBPixbufImage | MBPixbufImage |
| Type for representing an mbpixbuf image. | |
Enumerations | |
| enum | MBPixbufTransform |
| enumerated types for mb_pixbuf_img_transform | |
Functions | |
| MBPixbuf * | mb_pixbuf_new (Display *display, int screen) |
| Constructs a new MBPixbuf instance. | |
| MBPixbuf * | mb_pixbuf_new_extended (Display *dpy, int scr, Visual *vis, int depth) |
| Constructs a new MBPixbuf instance with non default depth and visual. | |
| void | mb_pixbuf_destroy (MBPixbuf *pixbuf) |
| Destroys a new MBPixbuf instance. | |
| MBPixbufImage * | mb_pixbuf_img_new (MBPixbuf *pb, int width, int height) |
| DEPRECIATED. | |
| MBPixbufImage * | mb_pixbuf_img_rgba_new (MBPixbuf *pixbuf, int width, int height) |
| Constructs a new blank mbpixbuf image with an alpha channel. | |
| 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_drawable (MBPixbuf *pixbuf, Drawable drawable, Drawable mask, int source_x, int source_y, int source_w, int source_h) |
| Depreicated. | |
| 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. | |
| MBPixbufImage * | mb_pixbuf_img_new_from_file (MBPixbuf *pixbuf, const char *filename) |
| Creates an mbpixbuf image from a file on disk. | |
| 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. | |
| 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. | |
| void | mb_pixbuf_img_free (MBPixbuf *pixbuf, MBPixbufImage *image) |
| Frees up a mbpixbuf image. | |
| 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_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_render_to_mask (MBPixbuf *pixbuf, MBPixbufImage *image, Drawable mask, int mask_x, int mask_y) |
| Renders alpha component mbpixbuf image to an X Bitmap. | |
| MBPixbufImage * | mb_pixbuf_img_clone (MBPixbuf *pixbuf, MBPixbufImage *image) |
| Clones a exisiting mbpixbuf image. | |
| 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. | |
| 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. | |
| 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. | |
| unsigned char * | mb_pixbuf_img_data (MBPixbuf *pixbuf, MBPixbufImage *image) |
| Gets rgb(a) internal data representation of an image. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| void | mb_pixbuf_img_composite (MBPixbuf *pb, MBPixbufImage *dest, MBPixbufImage *src, int dx, int dy) |
| DEPRECIATED. | |
| MBPixbufImage * | mb_pixbuf_img_scale (MBPixbuf *pixbuf, MBPixbufImage *image, int new_width, int new_height) |
| Scales an image arbitually. | |
| MBPixbufImage * | mb_pixbuf_img_transform (MBPixbuf *pixbuf, MBPixbufImage *image, MBPixbufTransform transform) |
| Performs a basic transform on an image. | |
Example: Simple example to load an image and display it on root window.
#include <libmb/mb.h>
int
main(int argc, char **argv)
{
Display *dpy;
Window win_root;
XEvent xevent;
MBPixbufImage *img, *img_scaled;
MBPixbuf *pb;
if (argc < 2)
{ fprintf(stderr, "usage: %s image file\\n", argv[0]); exit(1); }
dpy = XOpenDisplay(NULL);
pb = mb_pixbuf_new(dpy, DefaultScreen(dpy));
img = mb_pixbuf_img_new_from_file(pb, argv[1]);
if (!img) { fprintf(stderr, "image load failed\\n"); exit(1); }
img_scaled = mb_pixbuf_img_scale(pb, img,
DisplayWidth(dpy), DisplayHeight(dpy));
if (!img_scaled) { fprintf(stderr, "image scale failed\\n"); exit(1); }
mb_pixbuf_img_free(pb, img);
mb_pixbuf_img_render_to_drawable(pb, img_scaled,
RootWindow(dpy, DefaultScreen(dpy))
0, 0);
for (;;)
XNextEvent(dpy, &xevent);
exit(0); }
Notes: if the enviromental varible 'MBPIXBUF_NO_SHM' is set, the MIT-SHM extension will not be used.
|
|
Value: { \
(i)->rgba[(((y)*(i)->width*4)+((x)*4))] = r; \
(i)->rgba[(((y)*(i)->width*4)+((x)*4))+1] = g; \
(i)->rgba[(((y)*(i)->width*4)+((x)*4))+2] = b; \
(i)->rgba[(((y)*(i)->width*4)+((x)*4))+3] = 0; \
}
Use mb_pixbuf_img_plot_pixel instead. Definition at line 179 of file mbpixbuf.h. |
|
|
Type for representing an mbpixbuf image. Its not recommended you touch this directly. |
|
|
Destroys a new MBPixbuf instance.
|
|
||||||||||||
|
Clones a exisiting mbpixbuf image.
|
|
||||||||||||||||||||||||
|
DEPRECIATED. Use mb_pixbuf_img_copy_composite instead. |
|
||||||||||||||||||||||||||||||||||||||||
|
Copys an specified area of an image to another. No Alpha composition is performed.
|
|
||||||||||||||||||||||||||||||||||||||||
|
Alpha composites an specified area of an image with another.
|
|
||||||||||||||||||||||||||||||||||||||||||||
|
Like mb_pixbuf_img_copy_composite but sets an overall alpha value.
|
|
||||||||||||
|
Gets rgb(a) internal data representation of an image.
|
|
||||||||||||||||||||||||||||
|
Fills an image with specified color / alpha level.
|
|
||||||||||||
|
Frees up a mbpixbuf image.
|
|
||||||||||||||||||||||||||||||||||||
|
Gets the component values for a specified pixel.
|
|
||||||||||||||||
|
DEPRECIATED. Use mb_pixbuf_img_rgb_new, mb_pixbuf_img_rgba_new instead. |
|
||||||||||||||||||||||||
|
Creates an mbpixbuf image from arbituary supplied rgb(a) data.
|
|
||||||||||||||||||||||||||||||||
|
Depreicated. use mb_pixbuf_img_new_from_x_drawable instead. |
|
||||||||||||
|
Creates an mbpixbuf image from a file on disk. Supports PNG, JPEGS and XPMS.
|
|
||||||||||||||||||||
|
Creates an mbpixbuf image from arbituary supplied INT ARGB data.
|
|
||||||||||||||||||||||||||||||||||||
|
Constructs a new blank mbpixbuf image with/without an alpha channel.
|
|
||||||||||||||||||||||||||||||||
|
Plots a pixel on specified image.
|
|
||||||||||||||||||||||||||||||||||||
|
Plots a pixel on specified image with alpha channel value.
|
|
||||||||||||||||||||||||
|
Renders a mbpixbuf image to an X Drawable.
|
|
||||||||||||||||||||||||||||
|
Renders a mbpixbuf image to an X Drawable with a specified. X Graphics Context ( GC ).
|
|
||||||||||||||||||||||||
|
Renders alpha component mbpixbuf image to an X Bitmap.
|
|
||||||||||||||||
|
Constructs a new blank mbpixbuf image without an alpha channel.
|
|
||||||||||||||||
|
Constructs a new blank mbpixbuf image with an alpha channel.
|
|
||||||||||||||||||||
|
Scales an image arbitually.
|
|
||||||||||||||||
|
Performs a basic transform on an image.
|
|
||||||||||||
|
Constructs a new MBPixbuf instance.
|
|
||||||||||||||||||||
|
Constructs a new MBPixbuf instance with non default depth and visual.
|
1.4.0