src/video/SDL_blit.h
changeset 7373 5e6efd29b461
parent 7364 e21bd6987b86
child 7502 6ff02ff3cf06
equal deleted inserted replaced
7372:f90f720b9e56 7373:5e6efd29b461
   247 }
   247 }
   248 #define BGRA8888_FROM_RGBA(Pixel, r, g, b, a)                           \
   248 #define BGRA8888_FROM_RGBA(Pixel, r, g, b, a)                           \
   249 {                                                                       \
   249 {                                                                       \
   250     Pixel = (b<<24)|(g<<16)|(r<<8)|a;                                   \
   250     Pixel = (b<<24)|(g<<16)|(r<<8)|a;                                   \
   251 }
   251 }
       
   252 #define ARGB2101010_FROM_RGBA(Pixel, r, g, b, a)                        \
       
   253 {                                                                       \
       
   254     r = r ? ((r << 2) | 0x3) : 0;                                       \
       
   255     g = g ? ((g << 2) | 0x3) : 0;                                       \
       
   256     b = b ? ((b << 2) | 0x3) : 0;                                       \
       
   257     a = (a * 3) / 255;                                                  \
       
   258     Pixel = (a<<30)|(r<<20)|(g<<10)|b;                                  \
       
   259 }
   252 #define ASSEMBLE_RGB(buf, bpp, fmt, r, g, b)                            \
   260 #define ASSEMBLE_RGB(buf, bpp, fmt, r, g, b)                            \
   253 {                                                                       \
   261 {                                                                       \
   254     switch (bpp) {                                                      \
   262     switch (bpp) {                                                      \
   255         case 1: {                                                       \
   263         case 1: {                                                       \
   256             Uint8 Pixel;                                                \
   264             Uint8 Pixel;                                                \
   331 {                                                                       \
   339 {                                                                       \
   332     r = ((Pixel>>8)&0xFF);                                              \
   340     r = ((Pixel>>8)&0xFF);                                              \
   333     g = ((Pixel>>16)&0xFF);                                             \
   341     g = ((Pixel>>16)&0xFF);                                             \
   334     b = (Pixel>>24);                                                    \
   342     b = (Pixel>>24);                                                    \
   335     a = (Pixel&0xFF);                                                   \
   343     a = (Pixel&0xFF);                                                   \
       
   344 }
       
   345 #define RGBA_FROM_ARGB2101010(Pixel, r, g, b, a)                        \
       
   346 {                                                                       \
       
   347     r = ((Pixel>>22)&0xFF);                                             \
       
   348     g = ((Pixel>>12)&0xFF);                                             \
       
   349     b = ((Pixel>>2)&0xFF);                                              \
       
   350     a = SDL_expand_byte[6][(Pixel>>30)];                                \
   336 }
   351 }
   337 #define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a)                 \
   352 #define DISEMBLE_RGBA(buf, bpp, fmt, Pixel, r, g, b, a)                 \
   338 do {                                                                    \
   353 do {                                                                    \
   339     switch (bpp) {                                                      \
   354     switch (bpp) {                                                      \
   340         case 1:                                                         \
   355         case 1:                                                         \