1#ifndef SDL3PP_PIXELS_H_
2#define SDL3PP_PIXELS_H_
4#include <SDL3/SDL_pixels.h>
5#include "SDL3pp_error.h"
6#include "SDL3pp_spanRef.h"
7#include "SDL3pp_version.h"
107 constexpr explicit operator bool()
const {
return !!
value; }
140 constexpr explicit operator bool()
const {
return !!
value; }
344 SDL_PACKEDLAYOUT_2101010;
347 SDL_PACKEDLAYOUT_1010102;
442 SDL_DEFINE_PIXELFORMAT(type, order, layout, bits, bytes)))
572 constexpr bool IsArray()
const;
583 constexpr bool Is10Bit()
const;
594 constexpr bool IsFloat()
const;
605 constexpr bool IsAlpha()
const;
758 SDL_PIXELFORMAT_UNKNOWN;
761 SDL_PIXELFORMAT_INDEX1LSB;
764 SDL_PIXELFORMAT_INDEX1MSB;
767 SDL_PIXELFORMAT_INDEX2LSB;
770 SDL_PIXELFORMAT_INDEX2MSB;
773 SDL_PIXELFORMAT_INDEX4LSB;
776 SDL_PIXELFORMAT_INDEX4MSB;
783 SDL_PIXELFORMAT_XRGB4444;
786 SDL_PIXELFORMAT_XBGR4444;
789 SDL_PIXELFORMAT_XRGB1555;
792 SDL_PIXELFORMAT_XBGR1555;
795 SDL_PIXELFORMAT_ARGB4444;
798 SDL_PIXELFORMAT_RGBA4444;
801 SDL_PIXELFORMAT_ABGR4444;
804 SDL_PIXELFORMAT_BGRA4444;
807 SDL_PIXELFORMAT_ARGB1555;
810 SDL_PIXELFORMAT_RGBA5551;
813 SDL_PIXELFORMAT_ABGR1555;
816 SDL_PIXELFORMAT_BGRA5551;
827 SDL_PIXELFORMAT_XRGB8888;
830 SDL_PIXELFORMAT_RGBX8888;
833 SDL_PIXELFORMAT_XBGR8888;
836 SDL_PIXELFORMAT_BGRX8888;
839 SDL_PIXELFORMAT_ARGB8888;
842 SDL_PIXELFORMAT_RGBA8888;
845 SDL_PIXELFORMAT_ABGR8888;
848 SDL_PIXELFORMAT_BGRA8888;
851 SDL_PIXELFORMAT_XRGB2101010;
854 SDL_PIXELFORMAT_XBGR2101010;
857 SDL_PIXELFORMAT_ARGB2101010;
860 SDL_PIXELFORMAT_ABGR2101010;
875 SDL_PIXELFORMAT_RGB48_FLOAT;
878 SDL_PIXELFORMAT_BGR48_FLOAT;
881 SDL_PIXELFORMAT_RGBA64_FLOAT;
884 SDL_PIXELFORMAT_ARGB64_FLOAT;
887 SDL_PIXELFORMAT_BGRA64_FLOAT;
890 SDL_PIXELFORMAT_ABGR64_FLOAT;
893 SDL_PIXELFORMAT_RGB96_FLOAT;
896 SDL_PIXELFORMAT_BGR96_FLOAT;
899 SDL_PIXELFORMAT_RGBA128_FLOAT;
902 SDL_PIXELFORMAT_ARGB128_FLOAT;
905 SDL_PIXELFORMAT_BGRA128_FLOAT;
908 SDL_PIXELFORMAT_ABGR128_FLOAT;
911 SDL_PIXELFORMAT_YV12;
914 SDL_PIXELFORMAT_IYUV;
917 SDL_PIXELFORMAT_YUY2;
920 SDL_PIXELFORMAT_UYVY;
923 SDL_PIXELFORMAT_YVYU;
926 SDL_PIXELFORMAT_NV12;
929 SDL_PIXELFORMAT_NV21;
932 SDL_PIXELFORMAT_P010;
935 SDL_PIXELFORMAT_EXTERNAL_OES;
937#if SDL_VERSION_ATLEAST(3, 2, 10)
982 return SDL_DEFINE_PIXELFOURCC(A, B, C, D);
1014 return PixelFormat(type, order, layout, bits, bytes);
1032 return SDL_PIXELFLAG(format);
1054 return PixelType(SDL_PIXELTYPE(format));
1077 return SDL_PIXELORDER(format);
1128 return SDL_BITSPERPIXEL(format);
1156 return SDL_BYTESPERPIXEL(format);
1179 return SDL_ISPIXELFORMAT_INDEXED(format);
1202 return SDL_ISPIXELFORMAT_PACKED(format);
1225 return SDL_ISPIXELFORMAT_ARRAY(format);
1248 return SDL_ISPIXELFORMAT_10BIT(format);
1271 return SDL_ISPIXELFORMAT_FLOAT(format);
1299 return SDL_ISPIXELFORMAT_ALPHA(format);
1324 return SDL_ISPIXELFORMAT_FOURCC(format);
1340 SDL_COLOR_TYPE_UNKNOWN;
1345 SDL_COLOR_TYPE_YCBCR;
1363 SDL_COLOR_RANGE_UNKNOWN;
1389 SDL_COLOR_PRIMARIES_UNKNOWN;
1392 SDL_COLOR_PRIMARIES_BT709;
1395 SDL_COLOR_PRIMARIES_UNSPECIFIED;
1398 SDL_COLOR_PRIMARIES_BT470M;
1401 SDL_COLOR_PRIMARIES_BT470BG;
1405 SDL_COLOR_PRIMARIES_BT601;
1409 SDL_COLOR_PRIMARIES_SMPTE240;
1412 SDL_COLOR_PRIMARIES_GENERIC_FILM;
1416 SDL_COLOR_PRIMARIES_BT2020;
1419 SDL_COLOR_PRIMARIES_XYZ;
1422 SDL_COLOR_PRIMARIES_SMPTE431;
1425 SDL_COLOR_PRIMARIES_SMPTE432;
1428 SDL_COLOR_PRIMARIES_EBU3213;
1431 SDL_COLOR_PRIMARIES_CUSTOM;
1450 SDL_TRANSFER_CHARACTERISTICS_UNKNOWN;
1453 SDL_TRANSFER_CHARACTERISTICS_BT709;
1456 SDL_TRANSFER_CHARACTERISTICS_UNSPECIFIED;
1460 SDL_TRANSFER_CHARACTERISTICS_GAMMA22;
1463 SDL_TRANSFER_CHARACTERISTICS_GAMMA28;
1466 SDL_TRANSFER_CHARACTERISTICS_BT601;
1470 SDL_TRANSFER_CHARACTERISTICS_SMPTE240;
1473 SDL_TRANSFER_CHARACTERISTICS_LINEAR;
1476 SDL_TRANSFER_CHARACTERISTICS_LOG100;
1479 SDL_TRANSFER_CHARACTERISTICS_LOG100_SQRT10;
1482 SDL_TRANSFER_CHARACTERISTICS_IEC61966;
1485 SDL_TRANSFER_CHARACTERISTICS_BT1361;
1488 SDL_TRANSFER_CHARACTERISTICS_SRGB;
1491 SDL_TRANSFER_CHARACTERISTICS_BT2020_10BIT;
1495 SDL_TRANSFER_CHARACTERISTICS_BT2020_12BIT;
1500 SDL_TRANSFER_CHARACTERISTICS_PQ;
1503 SDL_TRANSFER_CHARACTERISTICS_SMPTE428;
1506 SDL_TRANSFER_CHARACTERISTICS_HLG;
1510 SDL_TRANSFER_CHARACTERISTICS_CUSTOM;
1529 SDL_MATRIX_COEFFICIENTS_IDENTITY;
1532 SDL_MATRIX_COEFFICIENTS_BT709;
1535 SDL_MATRIX_COEFFICIENTS_UNSPECIFIED;
1538 SDL_MATRIX_COEFFICIENTS_FCC;
1545 SDL_MATRIX_COEFFICIENTS_BT470BG;
1548 SDL_MATRIX_COEFFICIENTS_BT601;
1551 SDL_MATRIX_COEFFICIENTS_SMPTE240;
1554 SDL_MATRIX_COEFFICIENTS_YCGCO;
1557 SDL_MATRIX_COEFFICIENTS_BT2020_NCL;
1561 SDL_MATRIX_COEFFICIENTS_BT2020_CL;
1564 SDL_MATRIX_COEFFICIENTS_SMPTE2085;
1567 SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL;
1570 SDL_MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL;
1573 SDL_MATRIX_COEFFICIENTS_ICTCP;
1576 SDL_MATRIX_COEFFICIENTS_CUSTOM;
1593 SDL_CHROMA_LOCATION_NONE;
1836 SDL_COLORSPACE_SRGB_LINEAR;
1839 SDL_COLORSPACE_HDR10;
1907 return Colorspace(type, range, primaries, transfer, matrix, chroma);
1922 return SDL_COLORSPACETYPE(cspace);
1942 return SDL_COLORSPACERANGE(cspace);
1962 return SDL_COLORSPACECHROMA(cspace);
1982 return SDL_COLORSPACEPRIMARIES(cspace);
2002 return SDL_COLORSPACETRANSFER(cspace);
2022 return SDL_COLORSPACEMATRIX(cspace);
2046 return SDL_ISCOLORSPACE_MATRIX_BT601(cspace);
2066 return SDL_ISCOLORSPACE_MATRIX_BT709(cspace);
2087 return SDL_ISCOLORSPACE_MATRIX_BT2020_NCL(cspace);
2107 return SDL_ISCOLORSPACE_LIMITED_RANGE(cspace);
2127 return SDL_ISCOLORSPACE_FULL_RANGE(cspace);
2138 return lhs.r == rhs.r && lhs.g == rhs.g && lhs.b == rhs.b && lhs.a == rhs.a;
2144 return lhs.r == rhs.r && lhs.g == rhs.g && lhs.b == rhs.b && lhs.a == rhs.a;
2150 if (lhs.r != rhs.r)
return lhs.r <=> rhs.r;
2151 if (lhs.g != rhs.g)
return lhs.g <=> rhs.g;
2152 if (lhs.b != rhs.b)
return lhs.b <=> rhs.b;
2153 return lhs.a <=> rhs.a;
2159 if (lhs.r != rhs.r)
return lhs.r <=> rhs.r;
2160 if (lhs.g != rhs.g)
return lhs.g <=> rhs.g;
2161 if (lhs.b != rhs.b)
return lhs.b <=> rhs.b;
2162 return lhs.a <=> rhs.a;
2371 constexpr FColor(
float r,
float g,
float b,
float a = 1)
2381 constexpr float GetR()
const {
return r; }
2401 constexpr float GetG()
const {
return g; }
2421 constexpr float GetB()
const {
return b; }
2441 constexpr float GetA()
const {
return a; }
2481 : m_resource(resource)
2512 : m_resource(
CheckError(SDL_CreatePalette(ncolors)))
2526 ++resource.
value->refcount;
2538 std::swap(m_resource, other.m_resource);
2548 auto r = m_resource;
2549 m_resource =
nullptr;
2557 constexpr bool operator==(std::nullptr_t _)
const {
return !m_resource; }
2560 constexpr explicit operator bool()
const {
return !!m_resource; }
2579 constexpr int GetSize()
const {
return m_resource->ncolors; }
2584 return m_resource->colors[index];
2617 return SDL_GetPixelFormatName(format);
2650 SDL_GetMasksForPixelFormat(format, bpp, Rmask, Gmask, Bmask, Amask));
2688 return SDL_GetPixelFormatForMasks(bpp, Rmask, Gmask, Bmask, Amask);
2717 return *SDL_GetPixelFormatDetails(format);
2762 SDL_SetPaletteColors(palette, colors.
data(), firstcolor, colors.
size()));
2828 return SDL_MapRGB(&format, palette, r, g, b);
2869 return SDL_MapRGBA(&format, palette, c.r, c.g, c.b, c.a);
2905 SDL_GetRGB(pixel, &format, palette, r, g, b);
2946 SDL_GetRGBA(pixel, &format, palette, r, g, b, a);
2954 return MapRGBA(format, palette, {r, g, b, a});
2962 GetRGBA(pixel, format, palette, &c.r, &c.g, &c.b, &c.a);
Colorspace definitions.
Definition: SDL3pp_pixels.h:1642
constexpr Colorspace(ColorType type, ColorRange range, ColorPrimaries primaries, TransferCharacteristics transfer, MatrixCoefficients matrix, ChromaLocation chroma)
Define custom Colorspace formats.
Definition: SDL3pp_pixels.h:1686
constexpr Colorspace(ColorspaceRaw cspace={})
Wraps Colorspace.
Definition: SDL3pp_pixels.h:1651
A set of indexed colors representing a palette.
Definition: SDL3pp_pixels.h:2466
static constexpr Palette Borrow(PaletteParam resource)
Safely borrows the from PaletteParam.
Definition: SDL3pp_pixels.h:2523
constexpr Palette(Palette &&other)
Move constructor.
Definition: SDL3pp_pixels.h:2489
Palette & operator=(Palette other)
Assignment operator.
Definition: SDL3pp_pixels.h:2536
constexpr Palette(const PaletteRaw resource)
Constructs from PaletteParam.
Definition: SDL3pp_pixels.h:2480
constexpr bool operator==(std::nullptr_t _) const
Comparison.
Definition: SDL3pp_pixels.h:2557
constexpr PaletteRaw get() const
Retrieves underlying PaletteRaw.
Definition: SDL3pp_pixels.h:2543
constexpr PaletteRaw release()
Retrieves underlying PaletteRaw and clear this.
Definition: SDL3pp_pixels.h:2546
constexpr Palette(const Palette &other)
Copy constructor.
Definition: SDL3pp_pixels.h:2486
constexpr Color operator[](int index) const
Access specific pallete index.
Definition: SDL3pp_pixels.h:2582
~Palette()
Destructor.
Definition: SDL3pp_pixels.h:2533
constexpr int GetSize() const
Returns number of colors in the palette.
Definition: SDL3pp_pixels.h:2579
constexpr auto operator<=>(const Palette &other) const =default
Comparison.
Palette(int ncolors)
Create a palette structure with the specified number of color entries.
Definition: SDL3pp_pixels.h:2511
constexpr Palette()=default
Default ctor.
span-like for empty-derived structs
Definition: SDL3pp_spanRef.h:24
constexpr T * data() const
Retrieves contained data.
Definition: SDL3pp_spanRef.h:75
constexpr size_t size() const
Retrieves contained size.
Definition: SDL3pp_spanRef.h:69
constexpr void CheckError(bool result)
Check and throw if returned value from SDL is an error.
Definition: SDL3pp_error.h:198
constexpr PixelFormat PIXELFORMAT_ABGR1555
ABGR1555.
Definition: SDL3pp_pixels.h:812
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_FCC
US FCC Title 47.
Definition: SDL3pp_pixels.h:1537
constexpr bool IsMatrixBT709() const
Determine if an Colorspace uses BT709 matrix coefficients.
Definition: SDL3pp_pixels.h:2069
constexpr PixelFormat PIXELFORMAT_IYUV
Planar mode: Y + U + V (3 planes)
Definition: SDL3pp_pixels.h:913
constexpr bool IsPixelFormatArray(PixelFormatRaw format)
A macro to determine if an PixelFormat is an array format.
Definition: SDL3pp_pixels.h:1223
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_SMPTE240
SMPTE 240M.
Definition: SDL3pp_pixels.h:1550
constexpr ColorPrimaries COLOR_PRIMARIES_UNSPECIFIED
COLOR_PRIMARIES_UNSPECIFIED.
Definition: SDL3pp_pixels.h:1394
constexpr ColorPrimaries COLOR_PRIMARIES_BT709
ITU-R BT.709-6.
Definition: SDL3pp_pixels.h:1391
constexpr PixelFormat PIXELFORMAT_BGRA64
BGRA64.
Definition: SDL3pp_pixels.h:870
constexpr PixelType PIXELTYPE_PACKED8
PACKED8.
Definition: SDL3pp_pixels.h:217
void DestroyPalette(PaletteRaw palette)
Free a palette created with Palette.Palette().
Definition: SDL3pp_pixels.h:2782
constexpr PackedLayout PACKEDLAYOUT_1555
1555
Definition: SDL3pp_pixels.h:335
constexpr PixelFormat PIXELFORMAT_RGB96_FLOAT
RGB96_FLOAT.
Definition: SDL3pp_pixels.h:892
constexpr ChromaLocation ColorspaceChroma(ColorspaceRaw cspace)
A macro to retrieve the chroma sample location of an Colorspace.
Definition: SDL3pp_pixels.h:1960
constexpr PixelFormat PIXELFORMAT_P010
Planar mode: Y + U/V interleaved (2 planes)
Definition: SDL3pp_pixels.h:931
constexpr int PixelFormatOrder(PixelFormatRaw format)
A macro to retrieve the order of an PixelFormat.
Definition: SDL3pp_pixels.h:1075
const char * GetName() const
Get the human readable name of a pixel format.
Definition: SDL3pp_pixels.h:2620
constexpr PixelFormat PIXELFORMAT_XRGB32
XRGB32.
Definition: SDL3pp_pixels.h:953
constexpr ColorPrimaries ColorspacePrimaries(ColorspaceRaw cspace)
A macro to retrieve the primaries of an Colorspace.
Definition: SDL3pp_pixels.h:1980
constexpr ColorType GetType() const
Retrieve the type of a Colorspace.
Definition: SDL3pp_pixels.h:1925
constexpr PixelType PIXELTYPE_ARRAYF32
ARRAYF32.
Definition: SDL3pp_pixels.h:231
constexpr Uint8 GetFlags() const
Retrieve the flags of an PixelFormat.
Definition: SDL3pp_pixels.h:1035
constexpr bool IsPixelFormat10Bit(PixelFormatRaw format)
A macro to determine if an PixelFormat is a 10-bit format.
Definition: SDL3pp_pixels.h:1246
constexpr PixelFormat PIXELFORMAT_MJPG
Motion JPEG.
Definition: SDL3pp_pixels.h:939
constexpr ColorRange COLOR_RANGE_LIMITED
Narrow range, e.g.
Definition: SDL3pp_pixels.h:1368
constexpr ColorType ColorspaceType(ColorspaceRaw cspace)
A macro to retrieve the type of an Colorspace.
Definition: SDL3pp_pixels.h:1920
constexpr bool IsColorspaceLimitedRange(ColorspaceRaw cspace)
A macro to determine if an Colorspace has a limited range.
Definition: SDL3pp_pixels.h:2105
constexpr PixelFormat PIXELFORMAT_XRGB1555
XRGB1555.
Definition: SDL3pp_pixels.h:788
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_SMPTE240
SMPTE ST 240M.
Definition: SDL3pp_pixels.h:1469
constexpr PackedLayout PACKEDLAYOUT_1010102
1010102
Definition: SDL3pp_pixels.h:346
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_BT2020_12BIT
ITU-R BT2020 for 12-bit system.
Definition: SDL3pp_pixels.h:1494
constexpr ArrayOrder ARRAYORDER_RGB
RGB.
Definition: SDL3pp_pixels.h:303
SDL_PackedLayout PackedLayout
Packed component layout.
Definition: SDL3pp_pixels.h:327
SDL_ArrayOrder ArrayOrder
Array component order, low byte -> high byte.
Definition: SDL3pp_pixels.h:299
constexpr PixelFormat PIXELFORMAT_EXTERNAL_OES
Android video texture format.
Definition: SDL3pp_pixels.h:934
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_UNSPECIFIED
MATRIX_COEFFICIENTS_UNSPECIFIED.
Definition: SDL3pp_pixels.h:1534
constexpr Uint8 PixelFormatFlags(PixelFormatRaw format)
Retrieve the flags of an PixelFormat.
Definition: SDL3pp_pixels.h:1030
constexpr PixelFormat PIXELFORMAT_INDEX1MSB
INDEX1MSB.
Definition: SDL3pp_pixels.h:763
constexpr PixelType PIXELTYPE_PACKED32
PACKED32.
Definition: SDL3pp_pixels.h:221
constexpr PixelType PIXELTYPE_ARRAYF16
ARRAYF16.
Definition: SDL3pp_pixels.h:229
constexpr PixelFormat PIXELFORMAT_ABGR8888
ABGR8888.
Definition: SDL3pp_pixels.h:844
SDL_ColorPrimaries ColorPrimaries
Colorspace color primaries, as described by https://www.itu.int/rec/T-REC-H.273-201612-S/en.
Definition: SDL3pp_pixels.h:1386
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_SMPTE2085
SMPTE ST 2085.
Definition: SDL3pp_pixels.h:1563
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_ICTCP
ITU-R BT.2100-0 ICTCP.
Definition: SDL3pp_pixels.h:1572
void Destroy()
Free a palette created with Palette.Palette().
Definition: SDL3pp_pixels.h:2784
constexpr PixelFormat PIXELFORMAT_NV21
Planar mode: Y + V/U interleaved (2 planes)
Definition: SDL3pp_pixels.h:928
SDL_ChromaLocation ChromaLocation
Colorspace chroma sample location.
Definition: SDL3pp_pixels.h:1590
constexpr bool IsPixelFormatPacked(PixelFormatRaw format)
A macro to determine if an PixelFormat is a packed format.
Definition: SDL3pp_pixels.h:1200
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_LOG100
TRANSFER_CHARACTERISTICS_LOG100.
Definition: SDL3pp_pixels.h:1475
constexpr ColorType COLOR_TYPE_YCBCR
COLOR_TYPE_YCBCR.
Definition: SDL3pp_pixels.h:1344
constexpr PixelFormat PIXELFORMAT_ARGB2101010
ARGB2101010.
Definition: SDL3pp_pixels.h:856
constexpr bool IsPixelFormatAlpha(PixelFormatRaw format)
A macro to determine if an PixelFormat has an alpha channel.
Definition: SDL3pp_pixels.h:1297
constexpr PixelFormat PIXELFORMAT_INDEX4MSB
INDEX4MSB.
Definition: SDL3pp_pixels.h:775
constexpr int PixelFormatBytesPerPixel(PixelFormatRaw format)
A macro to determine an PixelFormat's bytes per pixel.
Definition: SDL3pp_pixels.h:1154
constexpr PixelFormat PIXELFORMAT_UNKNOWN
UNKNOWN.
Definition: SDL3pp_pixels.h:757
constexpr ColorPrimaries COLOR_PRIMARIES_UNKNOWN
COLOR_PRIMARIES_UNKNOWN.
Definition: SDL3pp_pixels.h:1388
constexpr PixelFormat PIXELFORMAT_ABGR4444
ABGR4444.
Definition: SDL3pp_pixels.h:800
constexpr PixelFormat PIXELFORMAT_BGRA64_FLOAT
BGRA64_FLOAT.
Definition: SDL3pp_pixels.h:886
constexpr BitmapOrder BITMAPORDER_1234
1234
Definition: SDL3pp_pixels.h:253
constexpr PixelFormat PIXELFORMAT_ABGR32
ABGR32.
Definition: SDL3pp_pixels.h:949
constexpr PixelFormat PIXELFORMAT_BGRA128_FLOAT
BGRA128_FLOAT.
Definition: SDL3pp_pixels.h:904
constexpr PixelFormat PIXELFORMAT_XBGR2101010
XBGR2101010.
Definition: SDL3pp_pixels.h:853
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_BT601
SMPTE ST 170M / ITU-R BT.601-7 525 or.
Definition: SDL3pp_pixels.h:1465
constexpr ColorRange ColorspaceRange(ColorspaceRaw cspace)
A macro to retrieve the range of an Colorspace.
Definition: SDL3pp_pixels.h:1940
constexpr bool IsColorspaceFullRange(ColorspaceRaw cspace)
A macro to determine if an Colorspace has a full range.
Definition: SDL3pp_pixels.h:2125
constexpr PackedLayout PACKEDLAYOUT_565
565
Definition: SDL3pp_pixels.h:339
const char * GetPixelFormatName(PixelFormatRaw format)
Get the human readable name of a pixel format.
Definition: SDL3pp_pixels.h:2615
constexpr PackedOrder PACKEDORDER_BGRA
BGRA.
Definition: SDL3pp_pixels.h:285
constexpr PixelFormat PIXELFORMAT_XRGB8888
XRGB8888.
Definition: SDL3pp_pixels.h:826
constexpr PixelFormat PIXELFORMAT_BGR96_FLOAT
BGR96_FLOAT.
Definition: SDL3pp_pixels.h:895
constexpr bool Is10Bit() const
Determine if this is a 10-bit format.
Definition: SDL3pp_pixels.h:1251
SDL_Colorspace ColorspaceRaw
Alias to raw representation for Colorspace.
Definition: SDL3pp_pixels.h:75
constexpr bool IsIndexed() const
Determine if this is an indexed format.
Definition: SDL3pp_pixels.h:1182
constexpr PixelFormat PIXELFORMAT_INDEX8
INDEX8.
Definition: SDL3pp_pixels.h:778
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL
MATRIX_COEFFICIENTS_CHROMA_DERIVED_CL.
Definition: SDL3pp_pixels.h:1569
constexpr MatrixCoefficients ColorspaceMatrix(ColorspaceRaw cspace)
A macro to retrieve the matrix coefficients of an Colorspace.
Definition: SDL3pp_pixels.h:2020
constexpr PixelFormat PIXELFORMAT_INDEX1LSB
INDEX1LSB.
Definition: SDL3pp_pixels.h:760
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_SMPTE428
SMPTE ST 428-1.
Definition: SDL3pp_pixels.h:1502
constexpr TransferCharacteristics GetTransfer() const
Retrieve the transfer characteristics of an Colorspace.
Definition: SDL3pp_pixels.h:2005
constexpr ChromaLocation CHROMA_LOCATION_TOPLEFT
In HEVC for BT.2020 and BT.2100 content (in particular on Blu-rays), Cb and Cr are sampled at the sam...
Definition: SDL3pp_pixels.h:1614
constexpr ChromaLocation GetChroma() const
Retrieve the chroma sample location of an Colorspace.
Definition: SDL3pp_pixels.h:1965
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_GAMMA22
ITU-R BT.470-6 System M / ITU-R BT1700 625 PAL & SECAM.
Definition: SDL3pp_pixels.h:1459
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_BT2020_NCL
ITU-R BT.2020-2 non-constant luminance.
Definition: SDL3pp_pixels.h:1556
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_BT470BG
ITU-R BT.470-6 System B, G / ITU-R BT.601-7 625, functionally the same as MATRIX_COEFFICIENTS_BT601.
Definition: SDL3pp_pixels.h:1544
SDL_TransferCharacteristics TransferCharacteristics
Colorspace transfer characteristics.
Definition: SDL3pp_pixels.h:1447
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_SRGB
IEC 61966-2-1 (sRGB or sYCC)
Definition: SDL3pp_pixels.h:1487
constexpr Colorspace DefineColorspace(ColorType type, ColorRange range, ColorPrimaries primaries, TransferCharacteristics transfer, MatrixCoefficients matrix, ChromaLocation chroma)
A macro for defining custom Colorspace formats.
Definition: SDL3pp_pixels.h:1900
constexpr PixelFormat PIXELFORMAT_BGRA8888
BGRA8888.
Definition: SDL3pp_pixels.h:847
constexpr PixelFormat PIXELFORMAT_RGBX8888
RGBX8888.
Definition: SDL3pp_pixels.h:829
constexpr PixelFormat PIXELFORMAT_YVYU
Packed mode: Y0+V0+Y1+U0 (1 plane)
Definition: SDL3pp_pixels.h:922
constexpr Uint8 ALPHA_TRANSPARENT
A fully transparent 8-bit alpha value.
Definition: SDL3pp_pixels.h:184
constexpr ColorPrimaries COLOR_PRIMARIES_BT470BG
ITU-R BT.470-6 System B, G / ITU-R BT.601-7.
Definition: SDL3pp_pixels.h:1400
constexpr ArrayOrder ARRAYORDER_NONE
NONE.
Definition: SDL3pp_pixels.h:301
constexpr PackedOrder PACKEDORDER_ARGB
ARGB.
Definition: SDL3pp_pixels.h:275
constexpr Uint8 ALPHA_OPAQUE
A fully opaque 8-bit alpha value.
Definition: SDL3pp_pixels.h:166
constexpr PackedLayout PixelFormatLayout(PixelFormatRaw format)
A macro to retrieve the layout of an PixelFormat.
Definition: SDL3pp_pixels.h:1098
constexpr PixelFormat PIXELFORMAT_RGB24
RGB24.
Definition: SDL3pp_pixels.h:822
constexpr ColorPrimaries GetPrimaries() const
Retrieve the primaries of an Colorspace.
Definition: SDL3pp_pixels.h:1985
constexpr Colorspace COLORSPACE_UNKNOWN
UNKNOWN.
Definition: SDL3pp_pixels.h:1830
constexpr ChromaLocation CHROMA_LOCATION_LEFT
In MPEG-2, MPEG-4, and AVC, Cb and Cr are taken on midpoint of the left-edge of the 2x2 square.
Definition: SDL3pp_pixels.h:1600
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_BT2020_CL
ITU-R BT.2020-2 constant luminance.
Definition: SDL3pp_pixels.h:1560
constexpr Colorspace COLORSPACE_BT601_FULL
Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601.
Definition: SDL3pp_pixels.h:1848
static PixelFormat ForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
Convert a bpp value and RGBA masks to an enumerated pixel format.
Definition: SDL3pp_pixels.h:2691
constexpr PixelFormat PIXELFORMAT_ARGB8888
ARGB8888.
Definition: SDL3pp_pixels.h:838
constexpr Colorspace COLORSPACE_SRGB_LINEAR
[object Object]
Definition: SDL3pp_pixels.h:1835
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_HLG
ARIB STD-B67, known as "hybrid log-gamma" (HLG)
Definition: SDL3pp_pixels.h:1505
constexpr auto operator<=>(ColorRaw lhs, ColorRaw rhs)
Spaceship operator for Color.
Definition: SDL3pp_pixels.h:2148
constexpr PackedLayout PACKEDLAYOUT_NONE
NONE.
Definition: SDL3pp_pixels.h:329
SDL_Palette * PaletteRaw
Alias to raw representation for Palette.
Definition: SDL3pp_pixels.h:87
constexpr PixelFormat PIXELFORMAT_ARGB128_FLOAT
ARGB128_FLOAT.
Definition: SDL3pp_pixels.h:901
constexpr PixelType PIXELTYPE_ARRAYU16
ARRAYU16.
Definition: SDL3pp_pixels.h:225
constexpr ColorType COLOR_TYPE_UNKNOWN
COLOR_TYPE_UNKNOWN.
Definition: SDL3pp_pixels.h:1339
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_BT709
ITU-R BT.709-6.
Definition: SDL3pp_pixels.h:1531
constexpr PixelFormat PIXELFORMAT_RGBX32
RGBX32.
Definition: SDL3pp_pixels.h:951
constexpr PackedOrder PACKEDORDER_RGBX
RGBX.
Definition: SDL3pp_pixels.h:273
constexpr Colorspace COLORSPACE_SRGB
Equivalent to DXGI_COLOR_SPACE_RGB_FULL_G22_NONE_P709.
Definition: SDL3pp_pixels.h:1833
constexpr bool IsMatrixBT2020_NCL() const
Determine if an Colorspace uses BT2020_NCL matrix coefficients.
Definition: SDL3pp_pixels.h:2090
constexpr PackedLayout PACKEDLAYOUT_4444
4444
Definition: SDL3pp_pixels.h:333
constexpr PixelFormat PIXELFORMAT_RGBA5551
RGBA5551.
Definition: SDL3pp_pixels.h:809
Uint32 MapRGBA(const PixelFormatDetails &format, PaletteConstParam palette, ColorRaw c)
Map an RGBA quadruple to a pixel value for a given pixel format.
Definition: SDL3pp_pixels.h:2865
constexpr float ALPHA_TRANSPARENT_FLOAT
A fully transparent floating point alpha value.
Definition: SDL3pp_pixels.h:193
constexpr bool operator==(ColorRaw lhs, ColorRaw rhs)
Comparison operator for Color.
Definition: SDL3pp_pixels.h:2136
SDL_ColorRange ColorRange
Colorspace color range, as described by https://www.itu.int/rec/R-REC-BT.2100-2-201807-I/en.
Definition: SDL3pp_pixels.h:1360
void GetRGBA(Uint32 pixel, const PixelFormatDetails &format, PaletteConstParam palette, Uint8 *r, Uint8 *g, Uint8 *b, Uint8 *a)
Get RGBA values from a pixel in the specified format.
Definition: SDL3pp_pixels.h:2938
constexpr PixelFormat DefinePixelFormat(PixelType type, int order, PackedLayout layout, int bits, int bytes)
A macro for defining custom non-FourCC pixel formats.
Definition: SDL3pp_pixels.h:1008
constexpr PixelFormat PIXELFORMAT_XBGR8888
XBGR8888.
Definition: SDL3pp_pixels.h:832
constexpr PixelFormat PIXELFORMAT_BGR48
BGR48.
Definition: SDL3pp_pixels.h:864
constexpr PixelType PIXELTYPE_UNKNOWN
UNKNOWN.
Definition: SDL3pp_pixels.h:209
constexpr bool IsFloat() const
Determine if this is a floating point format.
Definition: SDL3pp_pixels.h:1274
constexpr Colorspace COLORSPACE_BT601_LIMITED
Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P601.
Definition: SDL3pp_pixels.h:1845
constexpr PixelFormat PIXELFORMAT_ARGB1555
ARGB1555.
Definition: SDL3pp_pixels.h:806
void SetColors(SpanRef< const ColorRaw > colors, int firstcolor=0)
Set a range of colors in a palette.
Definition: SDL3pp_pixels.h:2765
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_BT601
ITU-R BT.601-7 525.
Definition: SDL3pp_pixels.h:1547
constexpr ColorPrimaries COLOR_PRIMARIES_EBU3213
EBU Tech. 3213-E.
Definition: SDL3pp_pixels.h:1427
constexpr PackedOrder PACKEDORDER_ABGR
ABGR.
Definition: SDL3pp_pixels.h:283
constexpr bool IsMatrixBT601() const
Determine if a Colorspace uses BT601 (or BT470BG) matrix coefficients.
Definition: SDL3pp_pixels.h:2049
constexpr ColorPrimaries COLOR_PRIMARIES_SMPTE240
SMPTE 240M, functionally the same as COLOR_PRIMARIES_BT601.
Definition: SDL3pp_pixels.h:1408
constexpr Colorspace COLORSPACE_BT709_LIMITED
Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709.
Definition: SDL3pp_pixels.h:1851
constexpr BitmapOrder BITMAPORDER_NONE
NONE.
Definition: SDL3pp_pixels.h:249
constexpr PixelFormat PIXELFORMAT_ARGB64_FLOAT
ARGB64_FLOAT.
Definition: SDL3pp_pixels.h:883
SDL_PixelFormatDetails PixelFormatDetails
Details about the format of a pixel.
Definition: SDL3pp_pixels.h:157
constexpr PixelFormat PIXELFORMAT_XRGB2101010
XRGB2101010.
Definition: SDL3pp_pixels.h:850
constexpr BitmapOrder BITMAPORDER_4321
4321
Definition: SDL3pp_pixels.h:251
constexpr bool IsPacked() const
Determine if this is a packed format.
Definition: SDL3pp_pixels.h:1205
constexpr ColorPrimaries COLOR_PRIMARIES_CUSTOM
COLOR_PRIMARIES_CUSTOM.
Definition: SDL3pp_pixels.h:1430
constexpr ColorPrimaries COLOR_PRIMARIES_BT2020
ITU-R BT.2020-2 / ITU-R BT.2100-0.
Definition: SDL3pp_pixels.h:1415
constexpr ColorType COLOR_TYPE_RGB
COLOR_TYPE_RGB.
Definition: SDL3pp_pixels.h:1342
constexpr PixelType PIXELTYPE_INDEX4
INDEX4.
Definition: SDL3pp_pixels.h:213
constexpr Colorspace COLORSPACE_BT709_FULL
Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P709.
Definition: SDL3pp_pixels.h:1854
SDL_PixelFormat PixelFormatRaw
Alias to raw representation for PixelFormat.
Definition: SDL3pp_pixels.h:72
constexpr PixelFormat PIXELFORMAT_XBGR4444
XBGR4444.
Definition: SDL3pp_pixels.h:785
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_BT1361
ITU-R BT1361 Extended Colour Gamut.
Definition: SDL3pp_pixels.h:1484
constexpr PixelType PIXELTYPE_PACKED16
PACKED16.
Definition: SDL3pp_pixels.h:219
const PixelFormatDetails & GetPixelFormatDetails(PixelFormatRaw format)
Create an PixelFormatDetails structure corresponding to a pixel format.
Definition: SDL3pp_pixels.h:2715
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_YCGCO
MATRIX_COEFFICIENTS_YCGCO.
Definition: SDL3pp_pixels.h:1553
constexpr PackedLayout PACKEDLAYOUT_332
332
Definition: SDL3pp_pixels.h:331
constexpr PixelFormat PIXELFORMAT_RGBA8888
RGBA8888.
Definition: SDL3pp_pixels.h:841
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_PQ
SMPTE ST 2084 for 10-, 12-, 14- and 16-bit systems.
Definition: SDL3pp_pixels.h:1499
constexpr bool IsColorspaceMatrixBT601(ColorspaceRaw cspace)
A macro to determine if an Colorspace uses BT601 (or BT470BG) matrix coefficients.
Definition: SDL3pp_pixels.h:2044
constexpr PackedLayout GetLayout() const
Retrieve the layout.
Definition: SDL3pp_pixels.h:1103
constexpr PixelFormat PIXELFORMAT_RGBA4444
RGBA4444.
Definition: SDL3pp_pixels.h:797
constexpr PixelType PIXELTYPE_ARRAYU8
ARRAYU8.
Definition: SDL3pp_pixels.h:223
constexpr PixelFormat PIXELFORMAT_ARGB32
ARGB32.
Definition: SDL3pp_pixels.h:945
constexpr PixelFormat PIXELFORMAT_INDEX4LSB
INDEX4LSB.
Definition: SDL3pp_pixels.h:772
constexpr bool IsPixelFormatFloat(PixelFormatRaw format)
A macro to determine if an PixelFormat is a floating point format.
Definition: SDL3pp_pixels.h:1269
constexpr ArrayOrder ARRAYORDER_ABGR
ABGR.
Definition: SDL3pp_pixels.h:313
constexpr bool IsFourCC() const
Determine if this is a "FourCC" format.
Definition: SDL3pp_pixels.h:1327
constexpr PixelFormat PIXELFORMAT_ABGR64_FLOAT
ABGR64_FLOAT.
Definition: SDL3pp_pixels.h:889
constexpr bool IsPixelFormatFourCC(PixelFormatRaw format)
A macro to determine if an PixelFormat is a "FourCC" format.
Definition: SDL3pp_pixels.h:1322
constexpr ColorPrimaries COLOR_PRIMARIES_BT470M
ITU-R BT.470-6 System M.
Definition: SDL3pp_pixels.h:1397
constexpr ColorPrimaries COLOR_PRIMARIES_SMPTE431
SMPTE RP 431-2.
Definition: SDL3pp_pixels.h:1421
constexpr PixelFormat PIXELFORMAT_ABGR128_FLOAT
ABGR128_FLOAT.
Definition: SDL3pp_pixels.h:907
constexpr ColorPrimaries COLOR_PRIMARIES_XYZ
SMPTE ST 428-1.
Definition: SDL3pp_pixels.h:1418
constexpr PixelFormat PIXELFORMAT_ABGR2101010
ABGR2101010.
Definition: SDL3pp_pixels.h:859
SDL_ColorType ColorType
Colorspace color type.
Definition: SDL3pp_pixels.h:1337
constexpr PixelFormat PIXELFORMAT_BGRX8888
BGRX8888.
Definition: SDL3pp_pixels.h:835
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL
MATRIX_COEFFICIENTS_CHROMA_DERIVED_NCL.
Definition: SDL3pp_pixels.h:1566
constexpr float ALPHA_OPAQUE_FLOAT
A fully opaque floating point alpha value.
Definition: SDL3pp_pixels.h:175
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_CUSTOM
MATRIX_COEFFICIENTS_CUSTOM.
Definition: SDL3pp_pixels.h:1575
constexpr PixelFormat PIXELFORMAT_YV12
Planar mode: Y + V + U (3 planes)
Definition: SDL3pp_pixels.h:910
constexpr PixelFormat PIXELFORMAT_BGRX32
BGRX32.
Definition: SDL3pp_pixels.h:955
constexpr PixelFormat PIXELFORMAT_BGRA4444
BGRA4444.
Definition: SDL3pp_pixels.h:803
constexpr PixelFormat PIXELFORMAT_INDEX2MSB
INDEX2MSB.
Definition: SDL3pp_pixels.h:769
void SetPaletteColors(PaletteParam palette, SpanRef< const ColorRaw > colors, int firstcolor=0)
Set a range of colors in a palette.
Definition: SDL3pp_pixels.h:2757
constexpr PixelFormat PIXELFORMAT_BGR565
BGR565.
Definition: SDL3pp_pixels.h:820
constexpr PixelFormat PIXELFORMAT_RGB48_FLOAT
RGB48_FLOAT.
Definition: SDL3pp_pixels.h:874
constexpr PixelFormat PIXELFORMAT_RGB565
RGB565.
Definition: SDL3pp_pixels.h:818
constexpr PixelFormat PIXELFORMAT_RGBA32
RGBA32.
Definition: SDL3pp_pixels.h:943
constexpr PixelFormat PIXELFORMAT_BGR24
BGR24.
Definition: SDL3pp_pixels.h:824
constexpr PackedLayout PACKEDLAYOUT_2101010
2101010
Definition: SDL3pp_pixels.h:343
constexpr bool IsColorspaceMatrixBT709(ColorspaceRaw cspace)
A macro to determine if an Colorspace uses BT709 matrix coefficients.
Definition: SDL3pp_pixels.h:2064
constexpr int GetOrder() const
Retrieve the order.
Definition: SDL3pp_pixels.h:1080
constexpr PixelFormat PIXELFORMAT_NV12
Planar mode: Y + U/V interleaved (2 planes)
Definition: SDL3pp_pixels.h:925
SDL_MatrixCoefficients MatrixCoefficients
Colorspace matrix coefficients.
Definition: SDL3pp_pixels.h:1526
constexpr ColorPrimaries COLOR_PRIMARIES_SMPTE432
SMPTE EG 432-1 / DCI P3.
Definition: SDL3pp_pixels.h:1424
constexpr Colorspace COLORSPACE_JPEG
Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_NONE_P709_X601.
Definition: SDL3pp_pixels.h:1842
constexpr PixelFormat PIXELFORMAT_INDEX2LSB
INDEX2LSB.
Definition: SDL3pp_pixels.h:766
SDL_PackedOrder PackedOrder
Packed component order, high bit -> low bit.
Definition: SDL3pp_pixels.h:267
constexpr PackedLayout PACKEDLAYOUT_5551
5551
Definition: SDL3pp_pixels.h:337
Uint32 MapRGB(const PixelFormatDetails &format, PaletteConstParam palette, Uint8 r, Uint8 g, Uint8 b)
Map an RGB triple to an opaque pixel value for a given pixel format.
Definition: SDL3pp_pixels.h:2822
constexpr ColorRange COLOR_RANGE_FULL
Full range, e.g. 0-255 for 8-bit RGB and luma, and 1-255 for 8-bit chroma.
Definition: SDL3pp_pixels.h:1371
constexpr bool IsArray() const
Determine if this is an array format.
Definition: SDL3pp_pixels.h:1228
constexpr PixelFormat PIXELFORMAT_ABGR64
ABGR64.
Definition: SDL3pp_pixels.h:872
constexpr PackedOrder PACKEDORDER_RGBA
RGBA.
Definition: SDL3pp_pixels.h:277
void GetMasksForPixelFormat(PixelFormatRaw format, int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask)
Convert one of the enumerated pixel formats to a bpp value and RGBA masks.
Definition: SDL3pp_pixels.h:2642
constexpr Uint32 DefinePixelFourCC(Uint8 A, Uint8 B, Uint8 C, Uint8 D)
A function for defining custom FourCC pixel formats.
Definition: SDL3pp_pixels.h:980
constexpr PixelFormat PIXELFORMAT_RGBA128_FLOAT
RGBA128_FLOAT.
Definition: SDL3pp_pixels.h:898
constexpr Colorspace COLORSPACE_BT2020_LIMITED
Equivalent to DXGI_COLOR_SPACE_YCBCR_STUDIO_G22_LEFT_P2020.
Definition: SDL3pp_pixels.h:1857
PixelFormat GetPixelFormatForMasks(int bpp, Uint32 Rmask, Uint32 Gmask, Uint32 Bmask, Uint32 Amask)
Convert a bpp value and RGBA masks to an enumerated pixel format.
Definition: SDL3pp_pixels.h:2682
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_UNSPECIFIED
TRANSFER_CHARACTERISTICS_UNSPECIFIED.
Definition: SDL3pp_pixels.h:1455
constexpr int PixelFormatBitsPerPixel(PixelFormatRaw format)
A macro to determine an PixelFormat's bits per pixel.
Definition: SDL3pp_pixels.h:1126
constexpr int GetBytesPerPixel() const
Determine this's bytes per pixel.
Definition: SDL3pp_pixels.h:1159
constexpr PixelFormat PIXELFORMAT_RGB332
RGB332.
Definition: SDL3pp_pixels.h:780
constexpr PixelFormat PIXELFORMAT_BGRA5551
BGRA5551.
Definition: SDL3pp_pixels.h:815
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_CUSTOM
TRANSFER_CHARACTERISTICS_CUSTOM.
Definition: SDL3pp_pixels.h:1509
constexpr ArrayOrder ARRAYORDER_BGRA
BGRA.
Definition: SDL3pp_pixels.h:311
constexpr ColorPrimaries COLOR_PRIMARIES_GENERIC_FILM
Generic film (color filters using Illuminant C)
Definition: SDL3pp_pixels.h:1411
constexpr PixelType PIXELTYPE_INDEX2
INDEX2.
Definition: SDL3pp_pixels.h:233
constexpr ColorRange COLOR_RANGE_UNKNOWN
COLOR_RANGE_UNKNOWN.
Definition: SDL3pp_pixels.h:1362
constexpr ColorPrimaries COLOR_PRIMARIES_BT601
ITU-R BT.601-7 525, SMPTE 170M.
Definition: SDL3pp_pixels.h:1404
constexpr bool IsAlpha() const
Determine if this has an alpha channel.
Definition: SDL3pp_pixels.h:1302
constexpr MatrixCoefficients GetMatrix() const
Retrieve the matrix coefficients of an Colorspace.
Definition: SDL3pp_pixels.h:2025
constexpr PixelFormat PIXELFORMAT_YUY2
Packed mode: Y0+U0+Y1+V0 (1 plane)
Definition: SDL3pp_pixels.h:916
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_LINEAR
TRANSFER_CHARACTERISTICS_LINEAR.
Definition: SDL3pp_pixels.h:1472
constexpr PixelType PIXELTYPE_ARRAYU32
ARRAYU32.
Definition: SDL3pp_pixels.h:227
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_UNKNOWN
TRANSFER_CHARACTERISTICS_UNKNOWN.
Definition: SDL3pp_pixels.h:1449
constexpr PixelType GetType() const
Retrieve the type.
Definition: SDL3pp_pixels.h:1057
constexpr ArrayOrder ARRAYORDER_RGBA
RGBA.
Definition: SDL3pp_pixels.h:305
constexpr PixelFormat PIXELFORMAT_RGBA64_FLOAT
RGBA64_FLOAT.
Definition: SDL3pp_pixels.h:880
constexpr bool IsColorspaceMatrixBT2020_NCL(ColorspaceRaw cspace)
A macro to determine if an Colorspace uses BT2020_NCL matrix coefficients.
Definition: SDL3pp_pixels.h:2085
constexpr PixelFormat PIXELFORMAT_XRGB4444
XRGB4444.
Definition: SDL3pp_pixels.h:782
constexpr Colorspace COLORSPACE_BT2020_FULL
Equivalent to DXGI_COLOR_SPACE_YCBCR_FULL_G22_LEFT_P2020.
Definition: SDL3pp_pixels.h:1860
constexpr TransferCharacteristics ColorspaceTransfer(ColorspaceRaw cspace)
A macro to retrieve the transfer characteristics of an Colorspace.
Definition: SDL3pp_pixels.h:2000
constexpr ChromaLocation CHROMA_LOCATION_NONE
RGB, no chroma sampling.
Definition: SDL3pp_pixels.h:1592
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_BT2020_10BIT
ITU-R BT2020 for 10-bit system.
Definition: SDL3pp_pixels.h:1490
constexpr ChromaLocation CHROMA_LOCATION_CENTER
In JPEG/JFIF, H.261, and MPEG-1, Cb and Cr are taken at the center of the 2x2 square.
Definition: SDL3pp_pixels.h:1607
constexpr PixelFormat PIXELFORMAT_RGBA64
RGBA64.
Definition: SDL3pp_pixels.h:866
SDL_FColor FColorRaw
Alias to raw representation for FColor.
Definition: SDL3pp_pixels.h:81
constexpr PixelFormat PIXELFORMAT_UYVY
Packed mode: U0+Y0+V0+Y1 (1 plane)
Definition: SDL3pp_pixels.h:919
constexpr Colorspace COLORSPACE_RGB_DEFAULT
The default colorspace for RGB surfaces if no colorspace is specified.
Definition: SDL3pp_pixels.h:1863
constexpr PackedOrder PACKEDORDER_NONE
NONE.
Definition: SDL3pp_pixels.h:269
constexpr PixelType PixelFormatType(PixelFormatRaw format)
A macro to retrieve the type of an PixelFormat.
Definition: SDL3pp_pixels.h:1052
SDL_Color ColorRaw
Alias to raw representation for Color.
Definition: SDL3pp_pixels.h:78
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_GAMMA28
ITU-R BT.470-6 System B, G.
Definition: SDL3pp_pixels.h:1462
constexpr PixelFormat PIXELFORMAT_ARGB4444
ARGB4444.
Definition: SDL3pp_pixels.h:794
SDL_BitmapOrder BitmapOrder
Bitmap pixel order, high bit -> low bit.
Definition: SDL3pp_pixels.h:247
constexpr ArrayOrder ARRAYORDER_BGR
BGR.
Definition: SDL3pp_pixels.h:309
constexpr PixelFormat PIXELFORMAT_BGRA32
BGRA32.
Definition: SDL3pp_pixels.h:947
void GetRGB(Uint32 pixel, const PixelFormatDetails &format, PaletteConstParam palette, Uint8 *r, Uint8 *g, Uint8 *b)
Get RGB values from a pixel in the specified format.
Definition: SDL3pp_pixels.h:2898
constexpr bool IsFullRange() const
A function to determine if an Colorspace has a full range.
Definition: SDL3pp_pixels.h:2130
constexpr int GetBitsPerPixel() const
Determine this's bits per pixel.
Definition: SDL3pp_pixels.h:1131
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_BT709
Rec. ITU-R BT.709-6 / ITU-R BT1361.
Definition: SDL3pp_pixels.h:1452
constexpr PixelType PIXELTYPE_INDEX1
INDEX1.
Definition: SDL3pp_pixels.h:211
constexpr PixelFormat PIXELFORMAT_XBGR32
XBGR32.
Definition: SDL3pp_pixels.h:957
constexpr bool IsPixelFormatIndexed(PixelFormatRaw format)
A macro to determine if an PixelFormat is an indexed format.
Definition: SDL3pp_pixels.h:1177
SDL_PixelType PixelType
Pixel type.
Definition: SDL3pp_pixels.h:207
constexpr ArrayOrder ARRAYORDER_ARGB
ARGB.
Definition: SDL3pp_pixels.h:307
constexpr PixelFormat PIXELFORMAT_ARGB64
ARGB64.
Definition: SDL3pp_pixels.h:868
constexpr Colorspace COLORSPACE_HDR10
[object Object]
Definition: SDL3pp_pixels.h:1838
constexpr PackedOrder PACKEDORDER_XRGB
XRGB.
Definition: SDL3pp_pixels.h:271
constexpr PackedLayout PACKEDLAYOUT_8888
8888
Definition: SDL3pp_pixels.h:341
void GetMasks(int *bpp, Uint32 *Rmask, Uint32 *Gmask, Uint32 *Bmask, Uint32 *Amask) const
Convert one of the enumerated pixel formats to a bpp value and RGBA masks.
Definition: SDL3pp_pixels.h:2653
const PixelFormatDetails & GetDetails() const
Create an PixelFormatDetails structure corresponding to a pixel format.
Definition: SDL3pp_pixels.h:2720
constexpr PixelFormat PIXELFORMAT_RGB48
RGB48.
Definition: SDL3pp_pixels.h:862
constexpr bool IsLimitedRange() const
A function to determine if an Colorspace has a limited range.
Definition: SDL3pp_pixels.h:2110
constexpr PixelFormat PIXELFORMAT_XBGR1555
XBGR1555.
Definition: SDL3pp_pixels.h:791
constexpr ColorRange GetRange() const
Retrieve the range of a Colorspace.
Definition: SDL3pp_pixels.h:1945
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_LOG100_SQRT10
TRANSFER_CHARACTERISTICS_LOG100_SQRT10.
Definition: SDL3pp_pixels.h:1478
Palette CreatePalette(int ncolors)
Create a palette structure with the specified number of color entries.
Definition: SDL3pp_pixels.h:2742
constexpr TransferCharacteristics TRANSFER_CHARACTERISTICS_IEC61966
IEC 61966-2-4.
Definition: SDL3pp_pixels.h:1481
constexpr PackedOrder PACKEDORDER_BGRX
BGRX.
Definition: SDL3pp_pixels.h:281
constexpr Colorspace COLORSPACE_YUV_DEFAULT
The default colorspace for YUV surfaces if no colorspace is specified.
Definition: SDL3pp_pixels.h:1866
constexpr PackedOrder PACKEDORDER_XBGR
XBGR.
Definition: SDL3pp_pixels.h:279
constexpr MatrixCoefficients MATRIX_COEFFICIENTS_IDENTITY
MATRIX_COEFFICIENTS_IDENTITY.
Definition: SDL3pp_pixels.h:1528
constexpr PixelFormat PIXELFORMAT_BGR48_FLOAT
BGR48_FLOAT.
Definition: SDL3pp_pixels.h:877
constexpr PixelType PIXELTYPE_INDEX8
INDEX8.
Definition: SDL3pp_pixels.h:215
Uint32 Uint32
An unsigned 32-bit integer type.
Definition: SDL3pp_stdinc.h:325
Uint8 Uint8
An unsigned 8-bit integer type.
Definition: SDL3pp_stdinc.h:257
Main include header for the SDL3pp library.
A structure that represents a color as RGBA components.
Definition: SDL3pp_pixels.h:2179
constexpr Uint8 GetR() const
Get the red component from the color.
Definition: SDL3pp_pixels.h:2208
constexpr Uint8 GetB() const
Get the blue component from the color.
Definition: SDL3pp_pixels.h:2248
constexpr Color & SetG(Uint8 newG)
Set the green component from the color.
Definition: SDL3pp_pixels.h:2236
Uint32 Map(const PixelFormatDetails &format, PaletteConstParam palette) const
Map an RGBA quadruple to a pixel value for a given pixel format.
Definition: SDL3pp_pixels.h:2951
constexpr Color(Uint8 r, Uint8 g, Uint8 b, Uint8 a=255)
Constructs from its fields.
Definition: SDL3pp_pixels.h:2198
constexpr Color & SetR(Uint8 newR)
Set the red component from the color.
Definition: SDL3pp_pixels.h:2216
constexpr Uint8 GetG() const
Get the green component from the color.
Definition: SDL3pp_pixels.h:2228
constexpr Color(ColorRaw color={})
Wraps Color.
Definition: SDL3pp_pixels.h:2185
constexpr Color & SetA(Uint8 newA)
Set the alpha component from the color.
Definition: SDL3pp_pixels.h:2276
constexpr Color & SetB(Uint8 newB)
Set the blue component from the color.
Definition: SDL3pp_pixels.h:2256
constexpr Uint8 GetA() const
Get the alpha component from the color.
Definition: SDL3pp_pixels.h:2268
static Color Get(Uint32 pixel, const PixelFormatDetails &format, PaletteConstParam palette)
Get RGBA values from a pixel in the specified format.
Definition: SDL3pp_pixels.h:2957
The bits of this structure can be directly reinterpreted as a float-packed color which uses the PIXEL...
Definition: SDL3pp_pixels.h:2352
constexpr FColor & SetG(float newG)
Set the green component from the color.
Definition: SDL3pp_pixels.h:2409
constexpr float GetA() const
Get the alpha component from the color.
Definition: SDL3pp_pixels.h:2441
constexpr FColor(float r, float g, float b, float a=1)
Constructs from its fields.
Definition: SDL3pp_pixels.h:2371
constexpr float GetR() const
Get the red component from the color.
Definition: SDL3pp_pixels.h:2381
constexpr float GetG() const
Get the green component from the color.
Definition: SDL3pp_pixels.h:2401
constexpr FColor & SetR(float newR)
Set the red component from the color.
Definition: SDL3pp_pixels.h:2389
constexpr FColor & SetA(float newA)
Set the alpha component from the color.
Definition: SDL3pp_pixels.h:2449
constexpr FColor & SetB(float newB)
Set the blue component from the color.
Definition: SDL3pp_pixels.h:2429
constexpr FColor(const FColorRaw &color={})
Wraps FColor.
Definition: SDL3pp_pixels.h:2358
constexpr float GetB() const
Get the blue component from the color.
Definition: SDL3pp_pixels.h:2421
Safely wrap Palette for non owning const parameters.
Definition: SDL3pp_pixels.h:118
constexpr PaletteConstParam(std::nullptr_t _=nullptr)
Constructs null/invalid.
Definition: SDL3pp_pixels.h:134
constexpr PaletteConstParam(PaletteParam value)
Constructs from PaletteParam.
Definition: SDL3pp_pixels.h:128
const PaletteRaw value
parameter's const PaletteRaw
Definition: SDL3pp_pixels.h:119
constexpr PaletteConstParam(const PaletteRaw value)
Constructs from const PaletteRaw.
Definition: SDL3pp_pixels.h:122
constexpr auto operator<=>(const PaletteConstParam &other) const =default
Comparison.
Safely wrap Palette for non owning parameters.
Definition: SDL3pp_pixels.h:91
constexpr PaletteParam(std::nullptr_t _=nullptr)
Constructs null/invalid.
Definition: SDL3pp_pixels.h:101
constexpr auto operator<=>(const PaletteParam &other) const =default
Comparison.
PaletteRaw value
parameter's PaletteRaw
Definition: SDL3pp_pixels.h:92
constexpr PaletteParam(PaletteRaw value)
Constructs from PaletteRaw.
Definition: SDL3pp_pixels.h:95