Author: spouliot
Date: 2007-06-21 08:10:35 -0400 (Thu, 21 Jun 2007)
New Revision: 80442

Modified:
   trunk/libgdiplus/src/ChangeLog
   trunk/libgdiplus/src/bitmap.c
   trunk/libgdiplus/src/bmpcodec.c
   trunk/libgdiplus/src/gdipenums.h
   trunk/libgdiplus/src/icocodec.c
   trunk/libgdiplus/src/image.c
   trunk/libgdiplus/src/imageattributes.c
   trunk/libgdiplus/src/jpegcodec.c
   trunk/libgdiplus/src/pngcodec.c
   trunk/libgdiplus/src/tiffcodec.c
Log:
2007-06-21  Sebastien Pouliot  <[EMAIL PROTECTED]>

        * bitmap.c, bmpcodec.c, icocodec.c, imageattributes.c, image.c,
        jpegcodec.c, pngcodec.c, tiffcodec.c, gdipenums.h: Fix PixelFormat*Rgb
        (and Argb) to PixelFormat*RGB (and ARGB) to match MS GDI+ definitions.
        Patch by Yves Bastide.



Modified: trunk/libgdiplus/src/ChangeLog
===================================================================
--- trunk/libgdiplus/src/ChangeLog      2007-06-21 12:08:24 UTC (rev 80441)
+++ trunk/libgdiplus/src/ChangeLog      2007-06-21 12:10:35 UTC (rev 80442)
@@ -1,3 +1,10 @@
+2007-06-21  Sebastien Pouliot  <[EMAIL PROTECTED]>
+
+       * bitmap.c, bmpcodec.c, icocodec.c, imageattributes.c, image.c,
+       jpegcodec.c, pngcodec.c, tiffcodec.c, gdipenums.h: Fix PixelFormat*Rgb
+       (and Argb) to PixelFormat*RGB (and ARGB) to match MS GDI+ definitions.
+       Patch by Yves Bastide.
+
 2007-06-05  Sebastien Pouliot  <[EMAIL PROTECTED]> 
 
        * emfcodec.c, metafile-private.h, wmfcodec.c, wmfcodec.h: ++ is unsafe

Modified: trunk/libgdiplus/src/bitmap.c
===================================================================
--- trunk/libgdiplus/src/bitmap.c       2007-06-21 12:08:24 UTC (rev 80441)
+++ trunk/libgdiplus/src/bitmap.c       2007-06-21 12:10:35 UTC (rev 80442)
@@ -75,10 +75,10 @@
        case PixelFormat1bppIndexed:
        case PixelFormat4bppIndexed:
        case PixelFormat8bppIndexed:
-       case PixelFormat24bppRgb:
-       case PixelFormat32bppArgb:
-       case PixelFormat32bppPArgb:
-       case PixelFormat32bppRgb:
+       case PixelFormat24bppRGB:
+       case PixelFormat32bppARGB:
+       case PixelFormat32bppPARGB:
+       case PixelFormat32bppRGB:
                return TRUE;
        default:
                return FALSE;
@@ -775,24 +775,24 @@
        }
        
        switch (format) {
-               case PixelFormat24bppRgb: {
+               case PixelFormat24bppRGB: {
                        cairo_format = CAIRO_FORMAT_RGB24;  
                        break;
                }
 
-               case PixelFormat32bppArgb:
-               case PixelFormat32bppPArgb:
+               case PixelFormat32bppARGB:
+               case PixelFormat32bppPARGB:
                        flags = ImageFlagsHasAlpha;
                        /* fall through */
-               case PixelFormat32bppRgb:
+               case PixelFormat32bppRGB:
                        cairo_format = CAIRO_FORMAT_ARGB32;
                        break;
 
-               case PixelFormat16bppRgb555:
-               case PixelFormat16bppRgb565:
+               case PixelFormat16bppRGB555:
+               case PixelFormat16bppRGB565:
                        /* fake them as 32bpp RGB as Cairo deprecated 
CAIRO_FORMAT_RGB16_565 support */
                        /* why 32bpp ? because that's the result of MS GDI+ 
when loading them, even if the bitmap is empty */
-                       format = PixelFormat32bppRgb;
+                       format = PixelFormat32bppRGB;
                        stride *= 2;
                        cairo_format = CAIRO_FORMAT_ARGB32;
                        break;
@@ -868,7 +868,7 @@
                        memset (scan0, 0, stride * height);
                } else {
                        /* Since the pixel format is not an alpha pixel format 
(i.e., it is
-                        * either PixelFormat24bppRgb or PixelFormat32bppRgb), 
the image should be
+                        * either PixelFormat24bppRGB or PixelFormat32bppRGB), 
the image should be
                         * initially black, not initially transparent. Thus, we 
need to set
                         * the alpha channel, which the user code doesn't think 
exists but
                         * Cairo is still paying attention to, to 0xFF.
@@ -982,7 +982,7 @@
        bitmap_data->width = width;
        bitmap_data->height = height;
        bitmap_data->stride = stride;
-       bitmap_data->pixel_format = PixelFormat32bppArgb;
+       bitmap_data->pixel_format = PixelFormat32bppARGB;
        bitmap_data->reserved = GBD_OWN_SCAN0;
        bitmap_data->scan0 = GdipAlloc(stride * height);
        if (bitmap_data->scan0 == NULL) {
@@ -1303,7 +1303,7 @@
 }
 
 #if FALSE
-/* PixelFormat24bppRgb is internally stored by Cairo as a four bytes. Convert 
it to 3-byte (RGB) */    
+/* PixelFormat24bppRGB is internally stored by Cairo as a four bytes. Convert 
it to 3-byte (RGB) */    
 int
 gdip_from_ARGB_to_RGB (BYTE *src, int width, int height, int stride, BYTE 
**dest, int* dest_stride)
 {
@@ -1339,7 +1339,7 @@
 }
 
 
-/* PixelFormat24bppRgb is internally stored by Cairo as a three bytes. Convert 
it to 4-byte (ARGB) */  
+/* PixelFormat24bppRGB is internally stored by Cairo as a three bytes. Convert 
it to 4-byte (ARGB) */  
 int
 gdip_from_RGB_to_ARGB (BYTE *src, int width, int height, int stride, BYTE 
**dest, int* dest_stride)
 {
@@ -1424,7 +1424,7 @@
                state->pixels_per_byte = 1;
                state->scan += x;                       /* x * 8 / 8 */
                break;
-       case PixelFormat24bppRgb:
+       case PixelFormat24bppRGB:
                /* GDI+ use 3 bytes for 24 bpp while Cairo use 4 bytes */
                if (data->reserved & GBD_TRUE24BPP) {
                        state->pixels_per_byte = -3;
@@ -1432,7 +1432,7 @@
                        break;
                }
                /* else continue (don't break) */
-       case PixelFormat32bppRgb:
+       case PixelFormat32bppRGB:
        default:
                /* indicate full RGB processing */
                state->pixels_per_byte = -(gdip_get_pixel_format_bpp 
(data->pixel_format) >> 3); 
@@ -1678,9 +1678,9 @@
                        state->scan [0] = (pixel_value >> 24);
                        state->scan [1] = (pixel_value >> 16);
                        state->scan [2] = (pixel_value >> 8);
-                       state->scan [3] = (state->data->pixel_format == 
PixelFormat32bppRgb) ? 0xFF : pixel_value;
+                       state->scan [3] = (state->data->pixel_format == 
PixelFormat32bppRGB) ? 0xFF : pixel_value;
 #else
-                       if (state->data->pixel_format == PixelFormat32bppRgb)
+                       if (state->data->pixel_format == PixelFormat32bppRGB)
                                pixel_value |= 0xFF000000;
                        *(unsigned int *)state->scan = pixel_value;
 #endif
@@ -1797,9 +1797,9 @@
 gdip_is_a_32bit_pixelformat (PixelFormat format)
 {
        switch (format) {
-               case PixelFormat32bppRgb:
-               case PixelFormat32bppArgb:
-               case PixelFormat32bppPArgb: /* all of these use 
CAIRO_FORMAT_ARGB, which is 4 bytes wide */
+               case PixelFormat32bppRGB:
+               case PixelFormat32bppARGB:
+               case PixelFormat32bppPARGB: /* all of these use 
CAIRO_FORMAT_ARGB, which is 4 bytes wide */
                        return TRUE;
                default:
                        return FALSE;
@@ -1856,7 +1856,7 @@
        int             f;
 
        /* sanity check; make sure we aren't mangling any image data */
-       if ((data->pixel_format != PixelFormat32bppArgb) && (data->pixel_format 
!= PixelFormat32bppRgb)) {
+       if ((data->pixel_format != PixelFormat32bppARGB) && (data->pixel_format 
!= PixelFormat32bppRGB)) {
                return;
        }
 
@@ -1931,7 +1931,7 @@
        root_data->reserved |= GBD_LOCKED;
 
        switch (format) {
-       case PixelFormat24bppRgb:
+       case PixelFormat24bppRGB:
                /* workaround a hack we have (because Cairo use 32bits in this 
case) */
                dest_pixel_format_bpp = 24;
                locked_data->reserved |= GBD_TRUE24BPP;
@@ -2049,12 +2049,12 @@
 
        v = (BYTE*)(data->scan0) + y * data->stride;
        switch (data->pixel_format) {
-       case PixelFormat24bppRgb:
-       case PixelFormat32bppRgb:
+       case PixelFormat24bppRGB:
+       case PixelFormat32bppRGB:
                color |= 0xFF000000; /* force the alpha for Cairo */
                /* fall through */
-       case PixelFormat32bppArgb:
-       case PixelFormat32bppPArgb: {
+       case PixelFormat32bppARGB:
+       case PixelFormat32bppPARGB: {
                ARGB *scan = (ARGB *)v;
                scan[x] = color;
                break;
@@ -2111,10 +2111,10 @@
                switch (data->pixel_format) {
                case PixelFormat16bppGrayScale:
                        return InvalidParameter;
-               case PixelFormat24bppRgb:
-               case PixelFormat32bppArgb:
-               case PixelFormat32bppPArgb:
-               case PixelFormat32bppRgb: {
+               case PixelFormat24bppRGB:
+               case PixelFormat32bppARGB:
+               case PixelFormat32bppPARGB:
+               case PixelFormat32bppRGB: {
                        ARGB *scan = (ARGB *)v;
                        *color = scan[x];
                        break;
@@ -2151,7 +2151,7 @@
 
        if ((bitmap->surface == NULL) && (data != NULL) && (data->scan0 != 
NULL)) {
                switch (data->pixel_format) {
-                       case PixelFormat24bppRgb: {
+                       case PixelFormat24bppRGB: {
                                bitmap->surface = 
cairo_image_surface_create_for_data(
                                                        (BYTE*)data->scan0,
                                                        CAIRO_FORMAT_RGB24, 
@@ -2161,9 +2161,9 @@
                                break;
                        }
 
-                       case PixelFormat32bppArgb:
-                       case PixelFormat32bppRgb:
-                       case PixelFormat32bppPArgb: {
+                       case PixelFormat32bppARGB:
+                       case PixelFormat32bppRGB:
+                       case PixelFormat32bppPARGB: {
                                bitmap->surface = 
cairo_image_surface_create_for_data(
                                                        (BYTE*)data->scan0,
                                                        CAIRO_FORMAT_ARGB32,
@@ -2240,10 +2240,10 @@
        }
 
        if ((palette->Flags & PaletteFlagsHasAlpha) == 0) {
-               format = PixelFormat32bppRgb;
+               format = PixelFormat32bppRGB;
                set_pixel_bgra (&force_alpha, 0, 0, 0, 0, 0xFF); /* full alpha 
bits set */
        } else {
-               format = PixelFormat32bppArgb;
+               format = PixelFormat32bppARGB;
                force_alpha = 0;
        }
 

Modified: trunk/libgdiplus/src/bmpcodec.c
===================================================================
--- trunk/libgdiplus/src/bmpcodec.c     2007-06-21 12:08:24 UTC (rev 80441)
+++ trunk/libgdiplus/src/bmpcodec.c     2007-06-21 12:10:35 UTC (rev 80442)
@@ -95,19 +95,19 @@
                if (bitCount != 16)
                        return InvalidParameter;
                /* note: incomplete at this stage */
-               *dest = PixelFormat16bppRgb565;
+               *dest = PixelFormat16bppRGB565;
                break;
        default:
                switch (bitCount) {
                case 32:
-                       *dest = PixelFormat32bppRgb;
+                       *dest = PixelFormat32bppRGB;
                        break;
                case 24:
-                       *dest = PixelFormat24bppRgb;
+                       *dest = PixelFormat24bppRGB;
                        break;
                case 16:
                        /* MS produce such files (i.e. bad header) for storing 
ImageList bitmaps, see bug #80797 */
-                       *dest = PixelFormat16bppRgb565;
+                       *dest = PixelFormat16bppRGB565;
                        break;
                case 8:
                        *dest = PixelFormat8bppIndexed;
@@ -138,7 +138,7 @@
        bmi->biWidth = GULONG_FROM_LE (bitmap->active_bitmap->width);
        bmi->biHeight = GULONG_FROM_LE (bitmap->active_bitmap->height);
        bmi->biPlanes = GUINT16_FROM_LE (1);
-       if (format != PixelFormat24bppRgb)
+       if (format != PixelFormat24bppRGB)
                bmi->biBitCount = GUINT16_FROM_LE (gdip_get_pixel_format_bpp 
(bitmap->active_bitmap->pixel_format));
        else
                bmi->biBitCount = GUINT16_FROM_LE (24);
@@ -151,7 +151,7 @@
        bmi->biWidth = bitmap->active_bitmap->width;
        bmi->biHeight = bitmap->active_bitmap->height;
        bmi->biPlanes = 1;
-       if (format != PixelFormat24bppRgb)
+       if (format != PixelFormat24bppRGB)
                bmi->biBitCount = gdip_get_pixel_format_bpp 
(bitmap->active_bitmap->pixel_format);
        else
                bmi->biBitCount = 24;
@@ -808,7 +808,7 @@
        }
 
        /* for 16bbp images we need to be more precise */
-       if (format == PixelFormat16bppRgb565) {
+       if (format == PixelFormat16bppRGB565) {
                /* check if we're dealing with a BITMAPV4HEADER (or later) 
structure */
                if (bmi.biSize >= sizeof (BITMAPV4HEADER)) {
                        /* the new structure contains the ARGB masks */
@@ -848,7 +848,7 @@
 
                /* note: CAIRO_FORMAT_RGB16_565 is deprecated so we're 
promoting the bitmap to 32RGB */
                /* why 32bpp when 24 would be enough ? because MS GDI+ loads 
them as such, but can't display them (empty) */
-               format = PixelFormat32bppRgb;
+               format = PixelFormat32bppRGB;
                /* 16bbp bitmap don't seems reversed like their height 
indicates */
                upsidedown = FALSE;
        }
@@ -870,12 +870,12 @@
        case PixelFormat8bppIndexed:
                result->active_bitmap->stride =  result->active_bitmap->width;
                break;
-       case PixelFormat24bppRgb:
+       case PixelFormat24bppRGB:
                result->active_bitmap->stride = result->active_bitmap->width * 
4;
                break;
        default:
                /* For other types, we assume 32 bit and translate into 32 bit 
from source format */
-               result->active_bitmap->pixel_format = PixelFormat32bppRgb;
+               result->active_bitmap->pixel_format = PixelFormat32bppRGB;
                result->active_bitmap->stride = result->active_bitmap->width * 
4;
                break;
        }
@@ -1181,7 +1181,7 @@
        BYTE                    *scan0;
 
        activebmp = image->active_bitmap;
-       if (activebmp->pixel_format != PixelFormat24bppRgb) {
+       if (activebmp->pixel_format != PixelFormat24bppRGB) {
                bitmapLen = activebmp->stride * activebmp->height;
        } else {
                bitmapLen = activebmp->width * 3;
@@ -1241,7 +1241,7 @@
        }
 
        scan0 = activebmp->scan0;
-       if (activebmp->pixel_format == PixelFormat24bppRgb) {
+       if (activebmp->pixel_format == PixelFormat24bppRGB) {
                int width = activebmp->width;
                int height = activebmp->height;
                int mystride;

Modified: trunk/libgdiplus/src/gdipenums.h
===================================================================
--- trunk/libgdiplus/src/gdipenums.h    2007-06-21 12:08:24 UTC (rev 80441)
+++ trunk/libgdiplus/src/gdipenums.h    2007-06-21 12:10:35 UTC (rev 80442)
@@ -336,19 +336,19 @@
        PixelFormatIndexed              = 0x00010000,   /* flag: is 
palette-indexed */
        PixelFormatPAlpha               = 0x00080000,   /* flag: alpha is 
pre-multiplied */
 
-       PixelFormat16bppArgb1555        = 0x00061007,
+       PixelFormat16bppARGB1555        = 0x00061007,
        PixelFormat16bppGrayScale       = 0x00101004,
-       PixelFormat16bppRgb555          = 0x00021005,
-       PixelFormat16bppRgb565          = 0x00021006,
+       PixelFormat16bppRGB555          = 0x00021005,
+       PixelFormat16bppRGB565          = 0x00021006,
        PixelFormat1bppIndexed          = 0x00030101,
-       PixelFormat24bppRgb             = 0x00021808,
-       PixelFormat32bppArgb            = 0x0026200a,
-       PixelFormat32bppPArgb           = 0x000e200b,
-       PixelFormat32bppRgb             = 0x00022009,
-       PixelFormat48bppRgb             = 0x0010300c,
+       PixelFormat24bppRGB             = 0x00021808,
+       PixelFormat32bppARGB            = 0x0026200a,
+       PixelFormat32bppPARGB           = 0x000e200b,
+       PixelFormat32bppRGB             = 0x00022009,
+       PixelFormat48bppRGB             = 0x0010300c,
        PixelFormat4bppIndexed          = 0x00030402,
-       PixelFormat64bppArgb            = 0x0034400d,
-       PixelFormat64bppPArgb           = 0x001c400e,
+       PixelFormat64bppARGB            = 0x0034400d,
+       PixelFormat64bppPARGB           = 0x001c400e,
        PixelFormat8bppIndexed          = 0x00030803,
 
        PixelFormatUndefined            = 0,

Modified: trunk/libgdiplus/src/icocodec.c
===================================================================
--- trunk/libgdiplus/src/icocodec.c     2007-06-21 12:08:24 UTC (rev 80441)
+++ trunk/libgdiplus/src/icocodec.c     2007-06-21 12:10:35 UTC (rev 80442)
@@ -170,7 +170,7 @@
        result = gdip_bitmap_new_with_frame (NULL, TRUE);
        result->type = ImageTypeBitmap;
        result->image_format = ICON;
-       result->active_bitmap->pixel_format = PixelFormat32bppArgb; /* icons 
are always promoted to 32 bbp */
+       result->active_bitmap->pixel_format = PixelFormat32bppARGB; /* icons 
are always promoted to 32 bbp */
        result->active_bitmap->width = entry.bWidth;
        result->active_bitmap->height = entry.bHeight;
        result->active_bitmap->stride = result->active_bitmap->width * 4;

Modified: trunk/libgdiplus/src/image.c
===================================================================
--- trunk/libgdiplus/src/image.c        2007-06-21 12:08:24 UTC (rev 80441)
+++ trunk/libgdiplus/src/image.c        2007-06-21 12:10:35 UTC (rev 80442)
@@ -295,15 +295,15 @@
                return InvalidParameter;
 
        /*
-        * Microsoft GDI+ only supports these pixel formats Format24bppRgb, 
Format32bppArgb, 
-        * Format32bppPArgb, Format32bppRgb, Format48bppRgb, Format64bppArgb, 
Format64bppPArgb
+        * Microsoft GDI+ only supports these pixel formats Format24bppRGB, 
Format32bppARGB, 
+        * Format32bppPARGB, Format32bppRGB, Format48bppRGB, Format64bppARGB, 
Format64bppPARGB
         * but we're limited to 24/32 inside libgdiplus
         */
        switch (image->active_bitmap->pixel_format) {
-       case PixelFormat24bppRgb:
-       case PixelFormat32bppArgb:
-       case PixelFormat32bppPArgb:
-       case PixelFormat32bppRgb:
+       case PixelFormat24bppRGB:
+       case PixelFormat32bppARGB:
+       case PixelFormat32bppPARGB:
+       case PixelFormat32bppRGB:
                break;
        default:
                return OutOfMemory;
@@ -1263,7 +1263,7 @@
                *format = image->active_bitmap->pixel_format;
                break;
        case ImageTypeMetafile:
-               *format = PixelFormat32bppRgb;
+               *format = PixelFormat32bppRGB;
                break;
        default:
                return InvalidParameter;
@@ -2026,19 +2026,19 @@
 gdip_get_pixel_format_depth(PixelFormat pixfmt)
 {
        switch (pixfmt) {
-               case PixelFormat16bppArgb1555:
+               case PixelFormat16bppARGB1555:
                case PixelFormat16bppGrayScale:
-               case PixelFormat16bppRgb555:
-               case PixelFormat16bppRgb565:
-               case PixelFormat24bppRgb:
-               case PixelFormat32bppArgb:
-               case PixelFormat32bppPArgb:
-               case PixelFormat32bppRgb:
+               case PixelFormat16bppRGB555:
+               case PixelFormat16bppRGB565:
+               case PixelFormat24bppRGB:
+               case PixelFormat32bppARGB:
+               case PixelFormat32bppPARGB:
+               case PixelFormat32bppRGB:
                        return 8;               /* FIXME - shouldn't this be 
32? - pdb */
 
-               case PixelFormat48bppRgb:
-               case PixelFormat64bppArgb:
-               case PixelFormat64bppPArgb:
+               case PixelFormat48bppRGB:
+               case PixelFormat64bppARGB:
+               case PixelFormat64bppPARGB:
                        return 16;
 
                case PixelFormat8bppIndexed:
@@ -2061,18 +2061,18 @@
 gdip_get_pixel_format_components(PixelFormat pixfmt)
 {
        switch (pixfmt) {
-               case PixelFormat16bppArgb1555:
-               case PixelFormat32bppArgb:
-               case PixelFormat32bppPArgb:
-               case PixelFormat64bppArgb:
-               case PixelFormat64bppPArgb:
-               case PixelFormat32bppRgb:       /* Cairo uses four bytes for 
32BPP*/
-               case PixelFormat24bppRgb:
+               case PixelFormat16bppARGB1555:
+               case PixelFormat32bppARGB:
+               case PixelFormat32bppPARGB:
+               case PixelFormat64bppARGB:
+               case PixelFormat64bppPARGB:
+               case PixelFormat32bppRGB:       /* Cairo uses four bytes for 
32BPP*/
+               case PixelFormat24bppRGB:
                        return 4;
 
-               case PixelFormat16bppRgb555:
-               case PixelFormat16bppRgb565: 
-               case PixelFormat48bppRgb:
+               case PixelFormat16bppRGB555:
+               case PixelFormat16bppRGB565: 
+               case PixelFormat48bppRGB:
                        return 3;
 
                case PixelFormat16bppGrayScale:

Modified: trunk/libgdiplus/src/imageattributes.c
===================================================================
--- trunk/libgdiplus/src/imageattributes.c      2007-06-21 12:08:24 UTC (rev 
80441)
+++ trunk/libgdiplus/src/imageattributes.c      2007-06-21 12:10:35 UTC (rev 
80442)
@@ -127,7 +127,7 @@
 
        if (colormap->colormap_elem || gamma->gamma_correction || 
trans->key_enabled || 
            (cmatrix->colormatrix_enabled && cmatrix->colormatrix != NULL)) {
-               bitmap->active_bitmap->pixel_format = PixelFormat32bppArgb;
+               bitmap->active_bitmap->pixel_format = PixelFormat32bppARGB;
                bmpdest = gdip_bitmap_new_with_frame(NULL, FALSE);
                gdip_bitmapdata_clone(bitmap->active_bitmap, 
&bmpdest->frames[0].bitmap, 1);
                bmpdest->frames[0].count = 1;

Modified: trunk/libgdiplus/src/jpegcodec.c
===================================================================
--- trunk/libgdiplus/src/jpegcodec.c    2007-06-21 12:08:24 UTC (rev 80441)
+++ trunk/libgdiplus/src/jpegcodec.c    2007-06-21 12:10:35 UTC (rev 80442)
@@ -331,11 +331,11 @@
                 * does not support alpha (transparency). */
                result->cairo_format = CAIRO_FORMAT_ARGB32;
                result->active_bitmap->stride = 4 * cinfo.image_width;
-               result->active_bitmap->pixel_format = PixelFormat24bppRgb;
+               result->active_bitmap->pixel_format = PixelFormat24bppRGB;
        } else if (cinfo.num_components == 4) {
                result->cairo_format = CAIRO_FORMAT_ARGB32;
                result->active_bitmap->stride = 4 * cinfo.image_width;
-               result->active_bitmap->pixel_format = PixelFormat32bppRgb;
+               result->active_bitmap->pixel_format = PixelFormat32bppRGB;
        }
 
        switch (cinfo.jpeg_color_space) {
@@ -651,10 +651,10 @@
 
        /* Verify that we can support this pixel format */
        switch (image->active_bitmap->pixel_format) {
-               case PixelFormat32bppArgb:
-               case PixelFormat32bppPArgb:
-               case PixelFormat32bppRgb:
-               case PixelFormat24bppRgb:
+               case PixelFormat32bppARGB:
+               case PixelFormat32bppPARGB:
+               case PixelFormat32bppRGB:
+               case PixelFormat24bppRGB:
                        break;
 
                case PixelFormat1bppIndexed:
@@ -704,7 +704,7 @@
        if (gdip_get_pixel_format_components 
(image->active_bitmap->pixel_format) == 3) {
                cinfo.in_color_space = JCS_RGB;
                cinfo.input_components = 3;
-               if (image->active_bitmap->pixel_format == PixelFormat24bppRgb) {
+               if (image->active_bitmap->pixel_format == PixelFormat24bppRGB) {
                        need_argb_conversion = 1;
                } else {
                        need_argb_conversion = 0;

Modified: trunk/libgdiplus/src/pngcodec.c
===================================================================
--- trunk/libgdiplus/src/pngcodec.c     2007-06-21 12:08:24 UTC (rev 80441)
+++ trunk/libgdiplus/src/pngcodec.c     2007-06-21 12:10:35 UTC (rev 80442)
@@ -359,7 +359,7 @@
                        result->active_bitmap->pixel_format = 
PixelFormat1bppIndexed;
                        result->cairo_format = CAIRO_FORMAT_A1;
                        break;
-               // note: 2bpp is a special case as the format is "promoted" to 
PixelFormat32bppArgb / CAIRO_FORMAT_ARGB32
+               // note: 2bpp is a special case as the format is "promoted" to 
PixelFormat32bppARGB / CAIRO_FORMAT_ARGB32
                //       we deal with this later...
                case 4:
                        result->active_bitmap->pixel_format = 
PixelFormat4bppIndexed;
@@ -517,7 +517,7 @@
 
                result->cairo_format = CAIRO_FORMAT_ARGB32;
                result->active_bitmap->stride = stride;
-               result->active_bitmap->pixel_format = PixelFormat32bppArgb;
+               result->active_bitmap->pixel_format = PixelFormat32bppARGB;
                result->active_bitmap->width = width;
                result->active_bitmap->height = height;
                result->active_bitmap->scan0 = rawdata;
@@ -530,10 +530,10 @@
                        result->active_bitmap->stride);
 
                if (channels == 3) {
-                       result->active_bitmap->pixel_format = 
PixelFormat24bppRgb;
+                       result->active_bitmap->pixel_format = 
PixelFormat24bppRGB;
                        result->active_bitmap->image_flags = 
ImageFlagsColorSpaceRGB;
                } else if (channels == 4) {
-                       result->active_bitmap->pixel_format = 
PixelFormat32bppArgb;
+                       result->active_bitmap->pixel_format = 
PixelFormat32bppARGB;
                        result->active_bitmap->image_flags = 
ImageFlagsColorSpaceRGB;
                } else if ((channels == 1) && (color_type == 
PNG_COLOR_TYPE_GRAY)) {
                        // doesn't apply to 2bpp images
@@ -614,14 +614,14 @@
        }
 
        switch (image->active_bitmap->pixel_format) {
-               case PixelFormat32bppArgb:
-               case PixelFormat32bppPArgb:
-               case PixelFormat32bppRgb:
+               case PixelFormat32bppARGB:
+               case PixelFormat32bppPARGB:
+               case PixelFormat32bppRGB:
                        color_type = PNG_COLOR_TYPE_RGB_ALPHA;
                        bit_depth = 8;
                        break;
 
-               case PixelFormat24bppRgb:
+               case PixelFormat24bppRGB:
                        color_type = PNG_COLOR_TYPE_RGB; /* FIXME - we should 
be able to write grayscale PNGs */
                        bit_depth = 8;
                        break;
@@ -642,13 +642,13 @@
                        break;
 
                /* We're not going to even try to save these images, for now */
-               case PixelFormat64bppArgb:
-               case PixelFormat64bppPArgb:
-               case PixelFormat48bppRgb:
-               case PixelFormat16bppArgb1555:
+               case PixelFormat64bppARGB:
+               case PixelFormat64bppPARGB:
+               case PixelFormat48bppRGB:
+               case PixelFormat16bppARGB1555:
                case PixelFormat16bppGrayScale:
-               case PixelFormat16bppRgb555:
-               case PixelFormat16bppRgb565:
+               case PixelFormat16bppRGB555:
+               case PixelFormat16bppRGB565:
                default:
                        color_type = -1;
                        bit_depth = -1;
@@ -686,7 +686,7 @@
        png_write_info (png_ptr, info_ptr);
 
 #if 0
-       if ((image->active_bitmap->pixel_format == Format24bppRgb) || 
(image->active_bitmap->pixel_format == Format32bppRgb)) {
+       if ((image->active_bitmap->pixel_format == Format24bppRGB) || 
(image->active_bitmap->pixel_format == Format32bppRGB)) {
                png_set_filler (png_ptr, 0, PNG_FILLER_AFTER);
        } else if (image->active_bitmap->pixel_format == Format8bppIndexed) {
                png_set_filler (png_ptr, 0, PNG_FILLER_AFTER);
@@ -699,7 +699,7 @@
                for (i = 0; i < image->active_bitmap->height; i++) {
                        png_write_row (png_ptr, image->active_bitmap->scan0 + i 
* image->active_bitmap->stride);
                }
-       } else if (image->active_bitmap->pixel_format == PixelFormat24bppRgb) {
+       } else if (image->active_bitmap->pixel_format == PixelFormat24bppRGB) {
                int j;
                BYTE *row_pointer = GdipAlloc (image->active_bitmap->width * 3);
                for (i = 0; i < image->active_bitmap->height; i++) {

Modified: trunk/libgdiplus/src/tiffcodec.c
===================================================================
--- trunk/libgdiplus/src/tiffcodec.c    2007-06-21 12:08:24 UTC (rev 80441)
+++ trunk/libgdiplus/src/tiffcodec.c    2007-06-21 12:10:35 UTC (rev 80442)
@@ -997,7 +997,7 @@
                                TIFFSetField (tiff, TIFFTAG_PAGENUMBER, page, 
num_of_pages);
                        }
 
-                       if (((bitmap_data->pixel_format & PixelFormatAlpha) != 
0) || (bitmap_data->pixel_format == PixelFormat32bppRgb)) {
+                       if (((bitmap_data->pixel_format & PixelFormatAlpha) != 
0) || (bitmap_data->pixel_format == PixelFormat32bppRGB)) {
                                samples_per_pixel = 4;
                                bits_per_sample = 8;
                        } else {
@@ -1122,9 +1122,9 @@
 
                if (TIFFGetField(tiff, TIFFTAG_SAMPLESPERPIXEL, 
&samples_per_pixel)) {
                        if (samples_per_pixel != 4) {
-                               bitmap_data->pixel_format = PixelFormat24bppRgb;
+                               bitmap_data->pixel_format = PixelFormat24bppRGB;
                        } else {
-                               bitmap_data->pixel_format = 
PixelFormat32bppArgb;
+                               bitmap_data->pixel_format = 
PixelFormat32bppARGB;
                                bitmap_data->image_flags |= ImageFlagsHasAlpha;
                        }
                }

_______________________________________________
Mono-patches maillist  -  [email protected]
http://lists.ximian.com/mailman/listinfo/mono-patches

Reply via email to