There's Host endianness for the channel order.
authorSam Lantinga <slouken@libsdl.org>
Tue, 10 Nov 2009 06:16:45 +0000
changeset 238ffe1f112ca0c
parent 237 d1a4fae44bd0
child 239 950b63dc92d6
There's Host endianness for the channel order.
IMG_ImageIO.c
IMG_UIImage.m
     1.1 --- a/IMG_ImageIO.c	Tue Nov 10 06:00:59 2009 +0000
     1.2 +++ b/IMG_ImageIO.c	Tue Nov 10 06:16:45 2009 +0000
     1.3 @@ -249,13 +249,9 @@
     1.4  		case 32:
     1.5  		{
     1.6  			color_space = CGColorSpaceCreateDeviceRGB();
     1.7 -#if __BIG_ENDIAN__
     1.8 -			//bitmap_info = kCGImageAlphaFirst | kCGBitmapByteOrder32Big; /* ARGB Big Endian */
     1.9 -			bitmap_info = kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Big; /* ARGB Big Endian */
    1.10 -#else
    1.11 -			//bitmap_info = kCGImageAlphaFirst | kCGBitmapByteOrder32Little; /* ARGB Little Endian */
    1.12 -			bitmap_info = kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little; /* ARGB Little Endian */
    1.13 -#endif 
    1.14 +			//bitmap_info = kCGImageAlphaFirst | kCGBitmapByteOrder32Host; /* ARGB */
    1.15 +			bitmap_info = kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host; /* ARGB */
    1.16 +
    1.17  			Amask = 0xFF000000;
    1.18  			Rmask = 0x00FF0000;
    1.19  			Gmask = 0x0000FF00;
    1.20 @@ -267,11 +263,7 @@
    1.21  		default:
    1.22  		{
    1.23  			color_space = CGColorSpaceCreateDeviceRGB();
    1.24 -#if __BIG_ENDIAN__
    1.25 -			bitmap_info = kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Big; /* XRGB Big Endian */
    1.26 -#else
    1.27 -			bitmap_info = kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Little; /* XRGB Little Endian */
    1.28 -#endif
    1.29 +			bitmap_info = kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Host; /* XRGB */
    1.30  			Amask = 0x00000000;
    1.31  			Rmask = 0x00FF0000;
    1.32  			Gmask = 0x0000FF00;
     2.1 --- a/IMG_UIImage.m	Tue Nov 10 06:00:59 2009 +0000
     2.2 +++ b/IMG_UIImage.m	Tue Nov 10 06:16:45 2009 +0000
     2.3 @@ -44,13 +44,9 @@
     2.4  		case 32:
     2.5  		{
     2.6  			color_space = CGColorSpaceCreateDeviceRGB();
     2.7 -#if __BIG_ENDIAN__
     2.8 -			//bitmap_info = kCGImageAlphaFirst | kCGBitmapByteOrder32Big; /* ARGB Big Endian */
     2.9 -			bitmap_info = kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Big; /* ARGB Big Endian */
    2.10 -#else
    2.11 -			//bitmap_info = kCGImageAlphaFirst | kCGBitmapByteOrder32Little; /* ARGB Little Endian */
    2.12 -			bitmap_info = kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Little; /* ARGB Little Endian */
    2.13 -#endif 
    2.14 +			//bitmap_info = kCGImageAlphaFirst | kCGBitmapByteOrder32Host; /* ARGB */
    2.15 +			bitmap_info = kCGImageAlphaPremultipliedFirst | kCGBitmapByteOrder32Host; /* ARGB */
    2.16 +
    2.17  			Amask = 0xFF000000;
    2.18  			Rmask = 0x00FF0000;
    2.19  			Gmask = 0x0000FF00;
    2.20 @@ -62,11 +58,7 @@
    2.21  		default:
    2.22  		{
    2.23  			color_space = CGColorSpaceCreateDeviceRGB();
    2.24 -#if __BIG_ENDIAN__
    2.25 -			bitmap_info = kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Big; /* XRGB Big Endian */
    2.26 -#else
    2.27 -			bitmap_info = kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Little; /* XRGB Little Endian */
    2.28 -#endif
    2.29 +			bitmap_info = kCGImageAlphaNoneSkipFirst | kCGBitmapByteOrder32Host; /* XRGB */
    2.30  			Amask = 0x00000000;
    2.31  			Rmask = 0x00FF0000;
    2.32  			Gmask = 0x0000FF00;