include/SDL_pixels.h
branchSDL-1.3
changeset 1675 d33dcfc3fde7
parent 1668 4da1ee79c9af
child 1676 e136f3ffdc1b
equal deleted inserted replaced
1674:7688a73b25b1 1675:d33dcfc3fde7
    92     SDL_PackedLayout_565,
    92     SDL_PackedLayout_565,
    93     SDL_PackedLayout_8888,
    93     SDL_PackedLayout_8888,
    94     SDL_PackedLayout_2101010,
    94     SDL_PackedLayout_2101010,
    95     SDL_PackedLayout_1010102,
    95     SDL_PackedLayout_1010102,
    96 };
    96 };
       
    97 
       
    98 #define SDL_DEFINE_PIXELFOURCC(A, B, C, D) \
       
    99     ((A) | ((B) << 8) | ((C) << 16) | ((D) << 24))
    97 
   100 
    98 #define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
   101 #define SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes) \
    99     ((1 << 31) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
   102     ((1 << 31) | ((type) << 24) | ((order) << 20) | ((layout) << 16) | \
   100      ((bits) << 8) | ((bytes) << 0))
   103      ((bits) << 8) | ((bytes) << 0))
   101 
   104 
   165         SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed32, SDL_PackedOrder_BGRA,
   168         SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed32, SDL_PackedOrder_BGRA,
   166                                SDL_PackedLayout_8888, 32, 4),
   169                                SDL_PackedLayout_8888, 32, 4),
   167     SDL_PixelFormat_ARGB2101010 =
   170     SDL_PixelFormat_ARGB2101010 =
   168         SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed32, SDL_PackedOrder_ARGB,
   171         SDL_DEFINE_PIXELFORMAT(SDL_PixelType_Packed32, SDL_PackedOrder_ARGB,
   169                                SDL_PackedLayout_2101010, 32, 4),
   172                                SDL_PackedLayout_2101010, 32, 4),
       
   173 
       
   174     SDL_PixelFormat_YV12 = SDL_DEFINE_PIXELFOURCC('Y', 'V', '1', '2'),
       
   175     SDL_PixelFormat_IYUV = SDL_DEFINE_PIXELFOURCC('I', 'Y', 'U', 'V'),
       
   176     SDL_PixelFormat_YUY2 = SDL_DEFINE_PIXELFOURCC('Y', 'U', 'Y', '2'),
       
   177     SDL_PixelFormat_UYVY = SDL_DEFINE_PIXELFOURCC('U', 'Y', 'V', 'Y'),
       
   178     SDL_PixelFormat_YVYU = SDL_DEFINE_PIXELFOURCC('Y', 'V', 'Y', 'U'),
   170 };
   179 };
   171 
   180 
   172 typedef struct SDL_Color
   181 typedef struct SDL_Color
   173 {
   182 {
   174     Uint8 r;
   183     Uint8 r;