~ubuntu-branches/ubuntu/lucid/libxpm/lucid

« back to all changes in this revision

Viewing changes to src/scan.c

  • Committer: Bazaar Package Importer
  • Author(s): Julien Cristau
  • Date: 2009-11-25 19:31:08 UTC
  • mto: (1.1.5 upstream) (3.1.3 sid)
  • mto: This revision was merged to the branch mainline in revision 10.
  • Revision ID: james.westby@ubuntu.com-20091125193108-idq2c4e299mmh3q2
ImportĀ upstreamĀ versionĀ 3.5.8

Show diffs side-by-side

added added

removed removed

Lines of Context:
122
122
 * if not large enough.
123
123
 */
124
124
static int
125
 
storePixel(pixel, pmap, index_return)
126
 
    Pixel pixel;
127
 
    PixelsMap *pmap;
128
 
    unsigned int *index_return;
 
125
storePixel(
 
126
    Pixel                pixel,
 
127
    PixelsMap           *pmap,
 
128
    unsigned int        *index_return)
129
129
{
130
130
    unsigned int i;
131
131
    Pixel *p;
157
157
}
158
158
 
159
159
static int
160
 
storeMaskPixel(pixel, pmap, index_return)
161
 
    Pixel pixel;
162
 
    PixelsMap *pmap;
163
 
    unsigned int *index_return;
 
160
storeMaskPixel(
 
161
    Pixel                pixel,
 
162
    PixelsMap           *pmap,
 
163
    unsigned int        *index_return)
164
164
{
165
165
    if (!pixel) {
166
166
        if (!pmap->ncolors) {
187
187
 * the given XpmImage structure.
188
188
 */
189
189
int
190
 
XpmCreateXpmImageFromImage(display, image, shapeimage,
191
 
                           xpmimage, attributes)
192
 
    Display *display;
193
 
    XImage *image;
194
 
    XImage *shapeimage;
195
 
    XpmImage *xpmimage;
196
 
    XpmAttributes *attributes;
 
190
XpmCreateXpmImageFromImage(
 
191
    Display             *display,
 
192
    XImage              *image,
 
193
    XImage              *shapeimage,
 
194
    XpmImage            *xpmimage,
 
195
    XpmAttributes       *attributes)
197
196
{
198
197
    /* variables stored in the XpmAttributes structure */
199
198
    unsigned int cpp;
363
362
}
364
363
 
365
364
static int
366
 
ScanTransparentColor(color, cpp, attributes)
367
 
    XpmColor *color;
368
 
    unsigned int cpp;
369
 
    XpmAttributes *attributes;
 
365
ScanTransparentColor(
 
366
    XpmColor            *color,
 
367
    unsigned int         cpp,
 
368
    XpmAttributes       *attributes)
370
369
{
371
370
    char *s;
372
371
    unsigned int a, b, c;
419
418
}
420
419
 
421
420
static int
422
 
ScanOtherColors(display, colors, ncolors, pixels, mask, cpp, attributes)
423
 
    Display *display;
424
 
    XpmColor *colors;
425
 
    unsigned int ncolors;
426
 
    Pixel *pixels;
427
 
    unsigned int mask;
428
 
    unsigned int cpp;
429
 
    XpmAttributes *attributes;
 
421
ScanOtherColors(
 
422
    Display             *display,
 
423
    XpmColor            *colors,
 
424
    unsigned int         ncolors,
 
425
    Pixel               *pixels,
 
426
    unsigned int         mask,
 
427
    unsigned int         cpp,
 
428
    XpmAttributes       *attributes)
430
429
{
431
430
    /* variables stored in the XpmAttributes structure */
432
431
    Colormap colormap;
614
613
 */
615
614
 
616
615
static int
617
 
GetImagePixels(image, width, height, pmap)
618
 
    XImage *image;
619
 
    unsigned int width;
620
 
    unsigned int height;
621
 
    PixelsMap *pmap;
 
616
GetImagePixels(
 
617
    XImage              *image,
 
618
    unsigned int         width,
 
619
    unsigned int         height,
 
620
    PixelsMap           *pmap)
622
621
{
623
622
    char *src;
624
623
    char *dst;
720
719
#endif
721
720
 
722
721
static int
723
 
GetImagePixels32(image, width, height, pmap)
724
 
    XImage *image;
725
 
    unsigned int width;
726
 
    unsigned int height;
727
 
    PixelsMap *pmap;
 
722
GetImagePixels32(
 
723
    XImage               *image,
 
724
    unsigned int         width,
 
725
    unsigned int         height,
 
726
    PixelsMap           *pmap)
728
727
{
729
728
    unsigned char *addr;
730
729
    unsigned char *data;
785
784
 */
786
785
 
787
786
static int
788
 
GetImagePixels16(image, width, height, pmap)
789
 
    XImage *image;
790
 
    unsigned int width;
791
 
    unsigned int height;
792
 
    PixelsMap *pmap;
 
787
GetImagePixels16(
 
788
    XImage              *image,
 
789
    unsigned int         width,
 
790
    unsigned int         height,
 
791
    PixelsMap           *pmap)
793
792
{
794
793
    unsigned char *addr;
795
794
    unsigned char *data;
831
830
 */
832
831
 
833
832
static int
834
 
GetImagePixels8(image, width, height, pmap)
835
 
    XImage *image;
836
 
    unsigned int width;
837
 
    unsigned int height;
838
 
    PixelsMap *pmap;
 
833
GetImagePixels8(
 
834
    XImage              *image,
 
835
    unsigned int         width,
 
836
    unsigned int         height,
 
837
    PixelsMap           *pmap)
839
838
{
840
839
    unsigned int *iptr;
841
840
    unsigned char *data;
864
863
 */
865
864
 
866
865
static int
867
 
GetImagePixels1(image, width, height, pmap, storeFunc)
868
 
    XImage *image;
869
 
    unsigned int width;
870
 
    unsigned int height;
871
 
    PixelsMap *pmap;
872
 
    storeFuncPtr storeFunc;
 
866
GetImagePixels1(
 
867
    XImage              *image,
 
868
    unsigned int         width,
 
869
    unsigned int         height,
 
870
    PixelsMap            *pmap,
 
871
    storeFuncPtr         storeFunc)
873
872
{
874
873
    unsigned int *iptr;
875
874
    unsigned int x, y;
920
919
    unsigned int   width,
921
920
    unsigned int   height,
922
921
    PixelsMap     *pmap,
923
 
    int          (*storeFunc) ())
 
922
    int          (*storeFunc) (Pixel, PixelsMap *, unsigned int *))
924
923
{
925
924
    unsigned int   *iptr;
926
925
    unsigned int    x, y;
954
953
# endif/* AMIGA */
955
954
#else  /* ndef FOR_MSW */
956
955
static int
957
 
MSWGetImagePixels(display, image, width, height, pmap, storeFunc)
958
 
    Display *display;
959
 
    XImage *image;
960
 
    unsigned int width;
961
 
    unsigned int height;
962
 
    PixelsMap *pmap;
963
 
    int (*storeFunc) ();
 
956
MSWGetImagePixels(
 
957
    Display      *display,
 
958
    XImage       *image,
 
959
    unsigned int  width,
 
960
    unsigned int  height,
 
961
    PixelsMap    *pmap,
 
962
    int         (*storeFunc) (Pixel, PixelsMap*, unsigned int *))
964
963
{
965
964
    unsigned int *iptr;
966
965
    unsigned int x, y;
984
983
#ifndef FOR_MSW
985
984
# ifndef AMIGA
986
985
int
987
 
XpmCreateXpmImageFromPixmap(display, pixmap, shapemask,
988
 
                            xpmimage, attributes)
989
 
    Display *display;
990
 
    Pixmap pixmap;
991
 
    Pixmap shapemask;
992
 
    XpmImage *xpmimage;
993
 
    XpmAttributes *attributes;
 
986
XpmCreateXpmImageFromPixmap(
 
987
    Display             *display,
 
988
    Pixmap               pixmap,
 
989
    Pixmap               shapemask,
 
990
    XpmImage            *xpmimage,
 
991
    XpmAttributes       *attributes)
994
992
{
995
993
    XImage *ximage = NULL;
996
994
    XImage *shapeimage = NULL;