#pragma once /// @file PixelFormatDetails.hpp /// For complete documentation, see src/pixels/PixelFormatDetails.cpp #include #include namespace hdk::sdl { class PixelFormatDetails : public hdk::grid::PrimitiveWrapper { public: using hdk::grid::PrimitiveWrapper::PrimitiveWrapper; static PixelFormatDetails Get(SDL_PixelFormat format) { return PixelFormatDetails(SDL_GetPixelFormatDetails(format)); } void GetRGB(Uint32 pixel, SDL_Palette* palette, Uint8* r, Uint8* g, Uint8* b) const { SDL_GetRGB(pixel, *this, palette, r, g, b); } void GetRGBA(Uint32 pixel, SDL_Palette* palette, Uint8* r, Uint8* g, Uint8* b, Uint8* a) const { SDL_GetRGBA(pixel, *this, palette, r, g, b, a); } Uint32 MapRGB(SDL_Palette* palette, Uint8 r, Uint8 g, Uint8 b) const { return SDL_MapRGB(*this, palette, r, g, b); } Uint32 MapRGBA(SDL_Palette* palette, Uint8 r, Uint8 g, Uint8 b, Uint8 a) const { return SDL_MapRGBA(*this, palette, r, g, b, a); } }; }