mutter/pixbuf.h

81 lines
1.5 KiB
C
Raw Normal View History

2005-03-22 09:53:51 -05:00
#ifndef _HAVE_PIXBUF_H
#define _HAVE_PIXBUF_H
typedef struct Pixbuf Pixbuf;
typedef struct PixbufPixel PixbufPixel;
typedef enum PixbufFormat
{
PB_FMT_RGBA
}
PixbufFormat;
struct PixbufPixel
{
unsigned char r,g,b,a;
};
struct Pixbuf
{
int *data;
int bytes_per_pixel; /* bits per pixel = bpp << 3 */
int channels; /* 4 with alpha */
int width, height;
int bytes_per_line; /* ( width * bpp ) */
int refcnt; /* starts at 0 */
void *meta; /* for jpeg meta text ? to a hash ? */
/* Possibles */
int rmask, gmask, bmask, amask; /* Masks - good for packed formats > */
int has_alpha; /* Rather than channels ? */
/* PixbufFormat format; like GL format */
};
Pixbuf*
pixbuf_new_from_file(const char *filename);
Pixbuf*
pixbuf_new(int width, int height);
void
pixbuf_unref(Pixbuf *pixb);
2005-03-29 18:26:36 -05:00
void
pixbuf_ref(Pixbuf *pixb);
2005-03-22 09:53:51 -05:00
void
pixbuf_set_pixel(Pixbuf *pixb, int x, int y, PixbufPixel *p);
void
pixbuf_get_pixel(Pixbuf *pixbuf, int x, int y, PixbufPixel *p);
void
pixel_set_vals(PixbufPixel *p,
const unsigned char r,
const unsigned char g,
const unsigned char b,
const unsigned char a);
2005-03-27 15:12:19 -05:00
void
pixbuf_copy(Pixbuf *src_pixb,
Pixbuf *dst_pixb,
int srcx,
int srcy,
int srcw,
int srch,
int dstx,
int dsty);
2005-03-22 09:53:51 -05:00
Pixbuf*
pixbuf_scale_down(Pixbuf *pixb,
int new_width,
int new_height);
#endif