pike.git / src / post_modules / GTK2 / source / encode_truecolor.c

version» Context lines:

pike.git/src/post_modules/GTK2/source/encode_truecolor.c:1:   /*   || This file is part of Pike. For copyright information see COPYRIGHT.   || Pike is distributed under GPL, LGPL and MPL. See the file COPYING   || for more information. - || $Id: encode_truecolor.c,v 1.2 2005/11/03 13:49:45 ldillon Exp $ + || $Id: encode_truecolor.c,v 1.3 2006/02/27 12:23:16 mast Exp $   */      static unsigned char swap_bits[256] =   { 0,128,64,192,32,160,96,224,16,144,80,208,48,176,112,    240,8,136,72,200,40,168,104,232,24,152,88,216,56,184,    120,248,4,132,68,196,36,164,100,228,20,148,84,212,52,    180,116,244,12,140,76,204,44,172,108,236,28,156,92,220,    60,188,124,252,2,130,66,194,34,162,98,226,18,146,82,    210,50,178,114,242,10,138,74,202,42,170,106,234,26,154,    90,218,58,186,122,250,6,134,70,198,38,166,102,230,22,
pike.git/src/post_modules/GTK2/source/encode_truecolor.c:365:      static INLINE void examine_mask(unsigned int x, int *bits,int *shift)   {    *bits=0;    *shift=0;    if (!x) return;    while (!(x&1)) x>>=1,(*shift)++;    while (x&1) x>>=1,(*bits)++;   }    - void pgtk_encode_grey(struct image *i, unsigned char *dest, int bpp, int bpl ) + void pgtk2_encode_grey(struct image *i, unsigned char *dest, int bpp, int bpl )   {    int x, y;    rgb_group *s = i->img;    switch(bpp)    {    case 1:    for(y=0; y<i->ysize; y++)    {    unsigned char *d = dest+y*bpl;    for(x=0; x<i->xsize; x++,s++)
pike.git/src/post_modules/GTK2/source/encode_truecolor.c:392:    unsigned short *d = (unsigned short *)(dest+y*bpl);    for(x=0; x<i->xsize; x++,s++)    *d = (s->r + (s->g<<1) + s->b)<<6;    }    return;    default:    Pike_error("This greyscale is to wide for me!\n");    }   }    - void pgtk_encode_truecolor_masks(struct image *i, + void pgtk2_encode_truecolor_masks(struct image *i,    int bitspp,    int pad,    int byteorder,    unsigned int red_mask,    unsigned int green_mask,    unsigned int blue_mask,    unsigned char *buffer,    int debug_len)   {    int rbits,rshift,gbits,gshift,bbits,bshift;       examine_mask(red_mask,&rbits,&rshift);    examine_mask(green_mask,&gbits,&gshift);    examine_mask(blue_mask,&bbits,&bshift);    encode_truecolor_generic( rbits, rshift, gbits, gshift, bbits, bshift,    bitspp, pad, byteorder, i, buffer, debug_len );      }