* Boston, MA 02111-1307, USA.
*/
-#include <config.h>
+#include "config.h"
#include <stdio.h>
#include <string.h>
#include "gdkcolor.h"
#include "gdkpixmap.h"
#include "gdk-pixbuf-private.h"
#include "gdkinternals.h"
+#include "gdkalias.h"
/* Some convenient names
*/
\f
-static guint32 mask_table[] = {
+static const guint32 mask_table[] = {
0x00000000, 0x00000001, 0x00000003, 0x00000007,
0x0000000f, 0x0000001f, 0x0000003f, 0x0000007f,
0x000000ff, 0x000001ff, 0x000003ff, 0x000007ff,
* RGBA8888: RGBA, 32-bit native endian
*/
#define R8fromRGB565(d) ((((d) >> 8) & 0xf8) | (((d) >> 13) & 0x7))
-#define B8fromRGB565(d) ((((d) >> 3) & 0xfc) | (((d) >> 9) & 0x3))
-#define G8fromRGB565(d) ((((d) << 3) & 0xf8) | (((d) >> 2) & 0x7))
+#define G8fromRGB565(d) ((((d) >> 3) & 0xfc) | (((d) >> 9) & 0x3))
+#define B8fromRGB565(d) ((((d) << 3) & 0xf8) | (((d) >> 2) & 0x7))
#define ABGR8888fromRGB565(d) ( ((d) & 0xf800) >> 8 | ((d) & 0xe000) >> 13 \
| ((d) & 0x07e0) << 5 | ((d) & 0x0600) >> 1 \
| 0xff)
#define R8fromRGB555(d) (((d) & 0x7c00) >> 7 | ((d) & 0x7000) >> 12)
-#define B8fromRGB555(d) (((d) & 0x03e0) >> 2 | ((d) & 0x0380) >> 7)
-#define G8fromRGB555(d) (((d) & 0x001f) << 3 | ((d) & 0x001c) >> 2)
+#define G8fromRGB555(d) (((d) & 0x03e0) >> 2 | ((d) & 0x0380) >> 7)
+#define B8fromRGB555(d) (((d) & 0x001f) << 3 | ((d) & 0x001c) >> 2)
#define ABGR8888fromRGB555(d) ( ((d) & 0x7c00) >> 7 | ((d) & 0x7000) >> 12 \
| ((d) & 0x03e0) << 6 | ((d) & 0x0380) << 1 \
gboolean alpha)
{
int xx, yy;
- int bpl;
guint8 *orow = pixels;
guint8 *o;
guint32 pixel;
guint8 component;
int i;
- bpl = image->bpl;
- v = gdk_colormap_get_visual(cmap);
+ v = gdk_colormap_get_visual (cmap);
if (image->depth != v->depth)
{
o = orow;
for (xx = x1; xx < x2; xx++)
{
- pixel = gdk_image_get_pixel(image, xx, yy);
+ pixel = gdk_image_get_pixel (image, xx, yy);
switch (v->type)
{
/* I assume this is right for static & greyscale's too? */
int y2,
GdkColormap *cmap);
-static cfunc convert_map[] = {
+static const cfunc convert_map[] = {
rgb1,rgb1,rgb1a,rgb1a,
rgb8,rgb8,rgb8a,rgb8a,
rgb555lsb,rgb555msb,rgb555alsb,rgb555amsb,
image = _gdk_image_get_scratch (gdk_drawable_get_screen (src),
width1, height1, depth, &xs0, &ys0);
- _gdk_drawable_copy_to_image (src, image,
- src_x + x0, src_y + y0,
+ gdk_drawable_copy_to_image (src, image,
+ src_x + x0, src_y + y0,
xs0, ys0, width1, height1);
gdk_pixbuf_get_from_image (dest, image, cmap,
return dest;
}
+
+#define __GDK_PIXBUF_DRAWABLE_C__
+#include "gdkaliasdef.c"