+1
-1
.wikiheaders-options
+1
-1
.wikiheaders-options
···
27
27
quickreftitle = SDL3 API Quick Reference
28
28
quickrefurl = https://libsdl.org/
29
29
quickrefdesc = The latest version of this document can be found at https://wiki.libsdl.org/SDL3/QuickReference
30
-
quickrefmacroregex = \A(SDL_PLATFORM_.*|SDL_.*_INTRINSICS|SDL_Atomic...Ref|SDL_assert.*?|SDL_arraysize|SDL_Swap[BL]E\d\d|SDL_[a-z]+_cast)\Z
30
+
quickrefmacroregex = \A(SDL_PLATFORM_.*|SDL_.*_INTRINSICS|SDL_Atomic...Ref|SDL_assert.*?|SDL_COMPILE_TIME_ASSERT|SDL_arraysize|SDL_Swap[BL]E\d\d|SDL_[a-z]+_cast)\Z
+53
-25
include/SDL3/SDL_pixels.h
+53
-25
include/SDL3/SDL_pixels.h
···
22
22
/**
23
23
* # CategoryPixels
24
24
*
25
-
* Pixel management.
25
+
* SDL offers facilities for pixel management.
26
+
*
27
+
* Largely these facilities deal with pixel _format_: what does this set of
28
+
* bits represent?
29
+
*
30
+
* If you mostly want to think of a pixel as some combination of red, green,
31
+
* blue, and maybe alpha intensities, this is all pretty straightforward, and
32
+
* in many cases, is enough information to build a perfectly fine game.
33
+
*
34
+
* However, the actual definition of a pixel is more complex than that:
35
+
*
36
+
* Pixels are a representation of a color in a particular color space.
37
+
*
38
+
* The first characteristic of a color space is the color type. SDL
39
+
* understands two different color types, RGB and YCbCr, or in SDL also
40
+
* referred to as YUV.
41
+
*
42
+
* RGB colors consist of red, green, and blue channels of color that are
43
+
* added together to represent the colors we see on the screen.
44
+
*
45
+
* https://en.wikipedia.org/wiki/RGB_color_model
46
+
*
47
+
* YCbCr colors represent colors as a Y luma brightness component and red and
48
+
* blue chroma color offsets. This color representation takes advantage of
49
+
* the fact that the human eye is more sensitive to brightness than the color
50
+
* in an image. The Cb and Cr components are often compressed and have lower
51
+
* resolution than the luma component.
52
+
*
53
+
* https://en.wikipedia.org/wiki/YCbCr
54
+
*
55
+
* When the color information in YCbCr is compressed, the Y pixels are left
56
+
* at full resolution and each Cr and Cb pixel represents an average of the
57
+
* color information in a block of Y pixels. The chroma location determines
58
+
* where in that block of pixels the color information is coming from.
59
+
*
60
+
* The color range defines how much of the pixel to use when converting a
61
+
* pixel into a color on the display. When the full color range is used, the
62
+
* entire numeric range of the pixel bits is significant. When narrow color
63
+
* range is used, for historical reasons, the pixel uses only a portion of
64
+
* the numeric range to represent colors.
65
+
*
66
+
* The color primaries and white point are a definition of the colors in the
67
+
* color space relative to the standard XYZ color space.
68
+
*
69
+
* https://en.wikipedia.org/wiki/CIE_1931_color_space
70
+
*
71
+
* The transfer characteristic, or opto-electrical transfer function (OETF),
72
+
* is the way a color is converted from mathematically linear space into a
73
+
* non-linear output signals.
74
+
*
75
+
* https://en.wikipedia.org/wiki/Rec._709#Transfer_characteristics
76
+
*
77
+
* The matrix coefficients are used to convert between YCbCr and RGB colors.
26
78
*/
27
79
28
80
#ifndef SDL_pixels_h_
···
418
470
SDL_PIXELFORMAT_XBGR32 = SDL_PIXELFORMAT_RGBX8888
419
471
#endif
420
472
} SDL_PixelFormat;
421
-
422
-
/**
423
-
* Pixels are a representation of a color in a particular color space.
424
-
*
425
-
* The first characteristic of a color space is the color type. SDL understands two different color types, RGB and YCbCr, or in SDL also referred to as YUV.
426
-
*
427
-
* RGB colors consist of red, green, and blue channels of color that are added together to represent the colors we see on the screen.
428
-
* https://en.wikipedia.org/wiki/RGB_color_model
429
-
*
430
-
* YCbCr colors represent colors as a Y luma brightness component and red and blue chroma color offsets. This color representation takes advantage of the fact that the human eye is more sensitive to brightness than the color in an image. The Cb and Cr components are often compressed and have lower resolution than the luma component.
431
-
* https://en.wikipedia.org/wiki/YCbCr
432
-
*
433
-
* When the color information in YCbCr is compressed, the Y pixels are left at full resolution and each Cr and Cb pixel represents an average of the color information in a block of Y pixels. The chroma location determines where in that block of pixels the color information is coming from.
434
-
*
435
-
* The color range defines how much of the pixel to use when converting a pixel into a color on the display. When the full color range is used, the entire numeric range of the pixel bits is significant. When narrow color range is used, for historical reasons, the pixel uses only a portion of the numeric range to represent colors.
436
-
*
437
-
* The color primaries and white point are a definition of the colors in the color space relative to the standard XYZ color space.
438
-
* https://en.wikipedia.org/wiki/CIE_1931_color_space
439
-
*
440
-
* The transfer characteristic, or opto-electrical transfer function (OETF), is the way a color is converted from mathematically linear space into a non-linear output signals.
441
-
* https://en.wikipedia.org/wiki/Rec._709#Transfer_characteristics
442
-
*
443
-
* The matrix coefficients are used to convert between YCbCr and RGB colors.
444
-
*/
445
473
446
474
/**
447
475
* Colorspace color type.
+5
include/SDL3/SDL_sensor.h
+5
include/SDL3/SDL_sensor.h
+49
-2
include/SDL3/SDL_stdinc.h
+49
-2
include/SDL3/SDL_stdinc.h
···
95
95
#endif
96
96
97
97
#ifndef SDL_COMPILE_TIME_ASSERT
98
-
#if defined(__cplusplus)
98
+
#ifdef SDL_WIKI_DOCUMENTATION_SECTION
99
+
/**
100
+
* A compile-time assertion.
101
+
*
102
+
* This can check constant values _known to the compiler at build time_ for
103
+
* correctness, and end the compile with the error if they fail.
104
+
*
105
+
* Often times these are used to verify basic truths, like the size of a
106
+
* datatype is what is expected:
107
+
*
108
+
* ```c
109
+
* SDL_COMPILE_TIME_ASSERT(uint32_size, sizeof(Uint32) == 4);
110
+
* ```
111
+
*
112
+
* The `name` parameter must be a valid C symbol, and must be unique across
113
+
* all compile-time asserts in the same compilation unit (one run of the
114
+
* compiler), or the build might fail with cryptic errors on some targets.
115
+
* This is used with a C language trick that works on older compilers that
116
+
* don't support better assertion techniques.
117
+
*
118
+
* If you need an assertion that operates at runtime, on variable data,
119
+
* you should try SDL_assert instead.
120
+
*
121
+
* \param name a unique identifier for this assertion.
122
+
* \param x the value to test. Must be a boolean value.
123
+
*
124
+
* \threadsafety This macro doesn't generate any code to run.
125
+
*
126
+
* \since This macro is available since SDL 3.1.3.
127
+
*
128
+
* \sa SDL_assert
129
+
*/
130
+
#define SDL_COMPILE_TIME_ASSERT(name, x) FailToCompileIf_x_IsFalse(x)
131
+
#elif defined(__cplusplus)
99
132
/* Keep C++ case alone: Some versions of gcc will define __STDC_VERSION__ even when compiling in C++ mode. */
100
133
#if (__cplusplus >= 201103L)
101
134
#define SDL_COMPILE_TIME_ASSERT(name, x) static_assert(x, #x)
···
2852
2885
*/
2853
2886
extern SDL_DECLSPEC Uint32 SDLCALL SDL_rand_bits_r(Uint64 *state);
2854
2887
2855
-
2856
2888
#ifndef SDL_PI_D
2889
+
/**
2890
+
* The value of Pi, as a double-precision floating point literal.
2891
+
*
2892
+
* \since This macro is available since SDL 3.1.3.
2893
+
*
2894
+
* \sa SDL_PI_F
2895
+
*/
2857
2896
#define SDL_PI_D 3.141592653589793238462643383279502884 /**< pi (double) */
2858
2897
#endif
2898
+
2859
2899
#ifndef SDL_PI_F
2900
+
/**
2901
+
* The value of Pi, as a single-precision floating point literal.
2902
+
*
2903
+
* \since This macro is available since SDL 3.1.3.
2904
+
*
2905
+
* \sa SDL_PI_D
2906
+
*/
2860
2907
#define SDL_PI_F 3.141592653589793238462643383279502884F /**< pi (float) */
2861
2908
#endif
2862
2909