Commit 97e7217
committed
Fixed colorspace for ImageIO loading
albert
Test case: https://gist.github.com/1551241
It should output:
Code:
$ ./sdlimagetest
PixelFormat: BitsPerPixel: 32, BytesPerPixel: 4
R/G/B/A mask: ff0000/ff00/ff/ff000000
R/G/B/A loss: 0/0/0/0
Colorkey: 0, Alpha: 255
FF0000FF
FF0000FF
FF0000FF
FF0000FF
FF0000FF
FF0000FF
FF0000FF
FF0000FF
FF0000FF
FF0000FF
Output with bad SDL_image:
Code:
$ ./sdlimagetest
PixelFormat:
BitsPerPixel: 32, BytesPerPixel: 4
R/G/B/A mask: ff0000/ff00/ff/ff000000
R/G/B/A loss: 0/0/0/0
Colorkey: 0, Alpha: 255
FF1514F4
FF1514F4
FF1514F4
FF1514F4
FF1514F4
FF1514F4
FF1514F4
FF1514F4
FF1514F4
FF1514F4
And I searched a bit around and I found a fix in the Allegro code (http://codesearch.google.com/#w3aXj_apqFs/allegro/tags/5.0.0/addons/image/macosx.m&ct=rc&cd=3&q=CGColorSpaceCreateCalibratedRGB).
So I wrote a patch for SDL_image: https://gist.github.com/15514041 parent d98a4dc commit 97e7217
1 file changed
Lines changed: 19 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
212 | 212 | | |
213 | 213 | | |
214 | 214 | | |
215 | | - | |
216 | | - | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
217 | 234 | | |
218 | 235 | | |
219 | 236 | | |
| |||
0 commit comments