4#ifndef GREM_GRAPHICS_TEXTURE_HPP
5#define GREM_GRAPHICS_TEXTURE_HPP
30struct DeviceImplementation;
32struct TextureImplementation;
90 : bits(static_cast<uint8_t>(aspect)) {}
106 [[nodiscard]]
constexpr bool empty() const noexcept {
130 return (bits & aspects.bits) != 0;
142 return static_cast<uint8_t
>(bits & aspects.bits) == aspects.bits;
692 .maxAnisotropy = 1.0f,
712 switch (internalFormat) {
792 switch (internalFormat) {
923 switch (internalFormat) {
1043 switch (internalFormat) {
1102 switch (internalFormat) {
1159 switch (internalFormat) {
1215 switch (internalFormat) {
1269 switch (internalFormat) {
1326 switch (internalFormat) {
1384 switch (internalFormat) {
1442 switch (internalFormat) {
1552 return create(device, type, internalFormat, size, mipLevelCount,
nullptr, samplerOptions);
1584 result.
fill(values);
1613 [[nodiscard]] GREM_API(graphics)
static Texture
1643 result.
fill(values);
1687 explicit operator bool() const noexcept {
1688 return static_cast<bool>(implementation);
1752 pasteImage(imageSize, pixels, destinationOffset,
Region3D{.offset = sourceOffset, .size = imageSize});
1928 return {.texture =
this, .subresource{}};
1937 return {.texture =
this, .subresource{}};
1949 return {.texture =
this, .subresource = subresource};
1961 return {.texture =
this, .subresource = subresource};
1970 return {.texture =
this, .region{.size =
getSize2D()}};
1980 return {.texture =
this, .region{.size =
getSize2D()}};
1992 return {.texture =
this, .region = region};
2004 return {.texture =
this, .region = region};
2016 return {.texture =
this, .region = region};
2028 return {.texture =
this, .region = region};
2174 return implementation;
2185 [[nodiscard]] TextureImplementation*
get() noexcept {
2186 return implementation.get();
2197 [[nodiscard]]
const TextureImplementation*
get() const noexcept {
2198 return implementation.get();
2203 friend DeviceImplementation;
2205 friend TextureImplementation;
2208 : implementation(std::move(handle)) {}
Floating-point linear RGBA color in the Rec.
Definition Color.hpp:60
TransferFunction
Color transfer function.
Definition Color.hpp:65
@ SRGB
sRGB transfer function.
Definition Color.hpp:67
@ LINEAR
Linear transfer function.
Definition Color.hpp:66
static const Color INVISIBLE
Definition Color.hpp:70
Optional value type that holds either a value or no value.
Definition Optional.hpp:58
Definition SharedPointer.hpp:65
friend class Variant
JSON value type using the default allocator.
Definition Variant.hpp:1402
Persistent system managing the rendering context of a Window.
Definition Device.hpp:68
Render target texture holding a chain of images leading to a window to be presented to.
Definition Swapchain.hpp:61
Set of aspects of a texture format.
Definition Texture.hpp:59
constexpr bool containsAnyOf(TextureAspects aspects) const noexcept
Check if the aspect set contains at least one of the given aspects.
Definition Texture.hpp:129
friend constexpr TextureAspects & operator^=(TextureAspects &a, TextureAspects b) noexcept
Assign the symmetric difference of two aspect sets to the first set.
Definition Texture.hpp:226
static const TextureAspects DEPTH_STENCIL
Set containing both the depth and stencil texture aspects.
Definition Texture.hpp:69
friend constexpr TextureAspects & operator|=(TextureAspects &a, TextureAspects b) noexcept
Assign the union of two aspect sets to the first set.
Definition Texture.hpp:214
friend constexpr TextureAspects operator|(TextureAspects a, TextureAspects b) noexcept
Get the union of two aspect sets.
Definition Texture.hpp:177
constexpr bool containsAllOf(TextureAspects aspects) const noexcept
Check if the aspect set contains all of the given aspects.
Definition Texture.hpp:141
friend constexpr TextureAspects & operator&=(TextureAspects &a, TextureAspects b) noexcept
Assign the intersection of two aspect sets to the first set.
Definition Texture.hpp:202
friend constexpr TextureAspects operator&(TextureAspects a, TextureAspects b) noexcept
Get the intersection of two aspect sets.
Definition Texture.hpp:165
constexpr bool contains(TextureAspect aspect) const noexcept
Check if the aspect set contains the given aspect.
Definition Texture.hpp:117
constexpr bool operator==(const TextureAspects &other) const noexcept=default
Compare this aspect set to another for equality.
friend constexpr TextureAspects operator~(TextureAspects a) noexcept
Get the complement of an aspect set.
Definition Texture.hpp:153
static const TextureAspects COLOR_DEPTH_STENCIL
Set containing the color, depth and stencil texture aspects.
Definition Texture.hpp:74
constexpr TextureAspects() noexcept=default
Construct an empty aspect set.
friend constexpr TextureAspects operator^(TextureAspects a, TextureAspects b) noexcept
Get the symmetric difference of two aspect sets.
Definition Texture.hpp:190
static const TextureAspects ALL
Set containing all possible texture aspects.
Definition Texture.hpp:64
constexpr bool empty() const noexcept
Check if the aspect set is empty.
Definition Texture.hpp:106
Storage for multidimensional data, such as 2D images, on the GPU, combined with a sampler configurati...
Definition Texture.hpp:700
Optional< TextureSamplerOptions > getSamplerOptions() const noexcept
Get the configuration options of this texture's associated sampler.
static constexpr bool isRGBAColorFormat(TextureFormat internalFormat) noexcept
Check if a specific internal texture format is an RGBA color format with an alpha channel.
Definition Texture.hpp:1214
static constexpr bool isRawFormat(TextureFormat internalFormat) noexcept
Check if a specific internal texture format is a raw format.
Definition Texture.hpp:1268
resource::Image downloadImage(const TextureImageDownloadOptions &downloadOptions={}) const
Download a copy of all or part of the image stored in the texture.
static Texture create(Device &device, TextureType type, TextureFormat internalFormat, Extent3D size, uint32_t mipLevelCount, const ClearValues &values, Optional< TextureSamplerOptions > samplerOptions=TextureSamplerOptions{})
Create a new texture object and allocate GPU memory for storing image data, initialized to specific v...
Definition Texture.hpp:1581
static constexpr resource::ImageType getImageType(TextureType type)
Get the image type corresponding to a texture type.
Definition Texture.hpp:768
static Texture createRenderbuffer(Device &device, TextureFormat internalFormat, Extent2D size, uint32_t maxMultisampleCount, const ClearValues &values)
Create a new unsampled texture object and allocate GPU memory for storing potentially multisampled 2D...
Definition Texture.hpp:1641
void generateMipmap()
Generate a mipmap, with the maximum possible number of mip levels, for the texture based on the highe...
TextureRegion2DConstReference getRegion2D(TextureRegion2D region) const noexcept
Get a read-only reference to a 2D region of the texture.
Definition Texture.hpp:2003
void pasteTexture(const Texture &texture, Offset3D destinationOffset={.x=0,.y=0,.z=0}, Offset3D sourceOffset={.x=0,.y=0,.z=0})
Copy all of the image data of another 2D or 2D array texture into the texture at a specific position.
Definition Texture.hpp:1807
uint32_t getHeight() const noexcept
Get the height, in texels, of the image data stored in this texture.
Definition Texture.hpp:2116
TextureRegion3DReference getRegion3D(TextureRegion3D region) noexcept
Get a reference to a 3D region of the texture.
Definition Texture.hpp:2015
void pasteImage(Extent3D imageSize, const void *pixels, Offset3D destinationOffset={.x=0,.y=0,.z=0}, Offset3D sourceOffset={.x=0,.y=0,.z=0})
Copy all of an array of layers of 2D image data into the texture at a specific position.
Definition Texture.hpp:1751
static constexpr bool hasInternalSRGBFormat(resource::ImageFormat format) noexcept
Check if an image format has a corresponding internal texture format that uses the sRGB transfer func...
Definition Texture.hpp:869
static constexpr Color::TransferFunction getTransferFunction(TextureFormat internalFormat) noexcept
Get the transfer function of an internal texture format.
Definition Texture.hpp:922
Texture copy() const
Create a new texture object, allocate GPU memory and copy the image data of this texture onto it.
TextureSubresourceConstReference getSubresource(TextureSubresource subresource) const noexcept
Get a read-only reference to a subresource of the texture.
Definition Texture.hpp:1960
static constexpr TextureType getType(resource::ImageType type) noexcept
Get the texture type corresponding to an image type.
Definition Texture.hpp:845
uint32_t getWidth() const noexcept
Get the width, in texels, of the image data stored in this texture.
Definition Texture.hpp:2096
void pasteTexture(const Texture &texture, Offset3D destinationOffset, Region3D sourceRegion)
Copy all or part of the image data of another 2D or 2D array texture into the texture at a specific p...
void fill(TextureSubresource subresource, const ClearValues &values={})
Fill a subresource of the texture with specific values.
static constexpr bool isCompatibleFormat(TextureFormat internalFormat, resource::ImageFormat format) noexcept
Check if a specific image format is directly compatible with an internal texture format.
Definition Texture.hpp:1158
static constexpr TextureFormat getInternalFormat(resource::ImageFormat format, Color::TransferFunction transferFunction) noexcept
Get the internal texture format corresponding to an image format.
Definition Texture.hpp:983
static constexpr TextureAspects getFormatAspects(TextureFormat internalFormat)
Get the set of texture aspects of an internal texture format.
Definition Texture.hpp:711
Extent3D getSize3D() const noexcept
Get the size, in texels, and the depth, in layers, of the 3D image data stored in this texture.
static Texture create(Device &device, TextureType type, TextureFormat internalFormat, Extent3D size, uint32_t mipLevelCount, const UndefinedClearValues &values, Optional< TextureSamplerOptions > samplerOptions=TextureSamplerOptions{})
Create a new texture object and allocate uninitialized GPU memory for storing image data.
Definition Texture.hpp:1549
static constexpr bool isPackedFormat(TextureFormat internalFormat) noexcept
Check if a specific internal texture format is a bit-packed format.
Definition Texture.hpp:1325
TextureSubresourceReference getSubresource(TextureSubresource subresource) noexcept
Get a reference to a subresource of the texture.
Definition Texture.hpp:1948
const TextureImplementation * get() const noexcept
Get a pointer to the underlying resource implementation.
Definition Texture.hpp:2197
static constexpr resource::ImageFormat getImageFormat(TextureFormat internalFormat)
Get the image format corresponding to an internal texture format.
Definition Texture.hpp:791
static constexpr TextureFormat getUncompressedFormat(TextureFormat internalFormat) noexcept
Get the uncompressed format corresponding to a specific internal texture format.
Definition Texture.hpp:1101
uint32_t getMaxMultisampleCount() const noexcept
Get the maximum multisample count of the texture.
uint32_t getDepth() const noexcept
Get the depth, in layers, of the image data stored in this texture.
Definition Texture.hpp:2136
static constexpr TextureFormat getRawFormat(TextureFormat internalFormat) noexcept
Get the raw format corresponding to a specific internal texture format.
Definition Texture.hpp:1042
TextureType getType() const noexcept
Get the type of the texture.
SharedPointer< TextureImplementation > lock() const noexcept
Get a lock for the underlying resource implementation.
Definition Texture.hpp:2173
static constexpr bool isFramebufferCompatibleFormat(TextureFormat internalFormat) noexcept
Check if a specific internal texture format is framebuffer-compatible.
Definition Texture.hpp:1441
void pasteImage(Extent3D imageSize, const void *pixels, Offset3D destinationOffset, Region3D sourceRegion)
Copy all or part of an array of layers of 2D image data into the texture at a specific position.
TextureImplementation * get() noexcept
Get a pointer to the underlying resource implementation.
Definition Texture.hpp:2185
static Texture create(Device &device, TextureType type, TextureFormat internalFormat, Extent3D size, uint32_t mipLevelCount, const void *pixels, Optional< TextureSamplerOptions > samplerOptions=TextureSamplerOptions{})
Create a new texture object and allocate GPU memory for storing image data.
uint32_t getMipLevelCount() const noexcept
Get the number of mip levels of the texture.
static constexpr bool isCompressedFormat(TextureFormat internalFormat) noexcept
Check if a specific internal texture format is a compressed format.
Definition Texture.hpp:1383
Extent2D getSize2D() const noexcept
Get the size, in texels, of the 2D image data stored in this texture.
Definition Texture.hpp:2061
TextureRegion2DReference getRegion2D(TextureRegion2D region) noexcept
Get a reference to a 2D region of the texture.
Definition Texture.hpp:1991
Texture() noexcept=default
Construct an empty texture without a value.
TextureRegion3DConstReference getRegion3D(TextureRegion3D region) const noexcept
Get a read-only reference to a 3D region of the texture.
Definition Texture.hpp:2027
static Texture createRenderbuffer(Device &device, TextureFormat internalFormat, Extent2D size, uint32_t maxMultisampleCount, const UndefinedClearValues &values)
Create a new unsampled texture object and allocate uninitialized GPU memory for storing potentially m...
void fill(const ClearValues &values={})
Fill all allocated texture data with specific values.
Texture copyWithSamplerOptions(Optional< TextureSamplerOptions > newSamplerOptions) const
Create a new texture object with new sampler options, allocate GPU memory and copy the image data of ...
Container for a 2D image.
Definition Image.hpp:951
Definition buffer_layouts.hpp:20
TextureDepthComparisonMode
Depth comparison mode for the sampler of a Texture.
Definition Texture.hpp:499
TextureWrappingMode
Wrapping mode of the sampler of a Texture.
Definition Texture.hpp:490
@ REPEAT
Wrap the texture coordinates around the 0-1 range.
Definition Texture.hpp:491
@ CLAMP_TO_EDGE
Clamp to the edge of the texture when sampling outside the 0-1 range.
Definition Texture.hpp:492
@ MIRRORED_REPEAT
Mirror the texture coordinates in the 0-1 range.
Definition Texture.hpp:493
TextureFormat
Description of the internal format of a Texture.
Definition Texture.hpp:267
@ R32G32_FLOAT
Raw bitmap where each texel comprises 2 32-bit floating-point components: red, green.
Definition Texture.hpp:274
@ D16_UNORM
Raw bitmap where each texel comprises 1 normalized 16-bit unsigned integer component: depth.
Definition Texture.hpp:282
@ BC4_R_UNORM_BLOCK
S3TC BC4 (RGTC1) block-compressed single-channel texture using 64 bits per 4x4 block.
Definition Texture.hpp:297
@ D32_FLOAT
Raw bitmap where each texel comprises 1 32-bit floating-point component: depth.
Definition Texture.hpp:284
@ B8G8R8A8_UNORM
Raw bitmap where each texel comprises 4 normalized 8-bit unsigned integer components: blue,...
Definition Texture.hpp:278
@ B10G11R11_UFLOAT_PACK32
Packed bitmap with the following 32-bit unsigned floating-point RGB texel format: BBBBBBBBBBGGGGGGGGG...
Definition Texture.hpp:289
@ ETC2_R8G8B8A8_UNORM_BLOCK
ETC2 block-compressed RGBA texture using 128 bits per 4x4 block.
Definition Texture.hpp:305
@ R16_FLOAT
Raw bitmap where each texel comprises 1 16-bit floating-point component: red.
Definition Texture.hpp:270
@ R32_FLOAT
Raw bitmap where each texel comprises 1 32-bit floating-point component: red.
Definition Texture.hpp:271
@ PVRTC1_4BPP_RGBA_SRGB_BLOCK
PVRTC1 block-compressed sRGBA texture using 64 bits per 4x4 block.
Definition Texture.hpp:310
@ ETC2_R8G8B8A8_SRGB_BLOCK
ETC2 block-compressed sRGBA texture using 128 bits per 4x4 block.
Definition Texture.hpp:306
@ BC7_RGBA_SRGB_BLOCK
S3TC BC7 (BPTC) block-compressed sRGBA texture using 128 bits per 4x4 block.
Definition Texture.hpp:302
@ R16G16_FLOAT
Raw bitmap where each texel comprises 2 16-bit floating-point components: red, green.
Definition Texture.hpp:273
@ BC1_RGB_UNORM_BLOCK
S3TC BC1 (DXT1) block-compressed RGB texture using 64 bits per 4x4 block.
Definition Texture.hpp:293
@ EAC_R11G11_UNORM_BLOCK
ETC2 EAC block-compressed double-channel texture using 128 bits per 4x4 block.
Definition Texture.hpp:308
@ BC7_RGBA_UNORM_BLOCK
S3TC BC7 (BPTC) block-compressed RGBA texture using 128 bits per 4x4 block.
Definition Texture.hpp:301
@ BC6H_RGB_UFLOAT_BLOCK
S3TC BC6H (BPTC) block-compressed unsigned floating-point RGB texture using 128 bits per 4x4 block.
Definition Texture.hpp:299
@ EAC_R11_UNORM_BLOCK
ETC2 EAC block-compressed single-channel texture using 64 bits per 4x4 block.
Definition Texture.hpp:307
@ R8G8B8A8_SRGB
Raw bitmap where each texel comprises 3 sRGB-encoded and 1 normalized 8-bit unsigned integer componen...
Definition Texture.hpp:277
@ UNKNOWN
Unknown texture format.
Definition Texture.hpp:268
@ A1R5G5B5_UNORM_PACK16
Packed bitmap with the following 16-bit unsigned integer RGBA texel format: ARRRRRGGGGGBBBBB.
Definition Texture.hpp:288
@ A2B10G10R10_UNORM_PACK32
Packed bitmap with the following 32-bit unsigned integer RGBA texel format: AABBBBBBBBBBGGGGGGGGGGRRR...
Definition Texture.hpp:290
@ R8_UNORM
Raw bitmap where each texel comprises 1 normalized 8-bit unsigned integer component: red.
Definition Texture.hpp:269
@ BC3_RGBA_SRGB_BLOCK
S3TC BC3 (DXT5) block-compressed sRGBA texture using 128 bits per 4x4 block.
Definition Texture.hpp:296
@ PVRTC1_4BPP_RGBA_UNORM_BLOCK
PVRTC1 block-compressed RGBA texture using 64 bits per 4x4 block.
Definition Texture.hpp:309
@ R8G8_UNORM
Raw bitmap where each texel comprises 2 normalized 8-bit unsigned integer components: red,...
Definition Texture.hpp:272
@ R5G6B5_UNORM_PACK16
Packed bitmap with the following 16-bit unsigned integer RGB texel format: RRRRRGGGGGGBBBBB.
Definition Texture.hpp:287
@ BC6H_RGB_FLOAT_BLOCK
S3TC BC6H (BPTC) block-compressed signed floating-point RGB texture using 128 bits per 4x4 block.
Definition Texture.hpp:300
@ R32G32B32A32_FLOAT
Raw bitmap where each texel comprises 4 32-bit floating-point components: red, green,...
Definition Texture.hpp:281
@ R16G16B16A16_FLOAT
Raw bitmap where each texel comprises 4 16-bit floating-point components: red, green,...
Definition Texture.hpp:280
@ BC3_RGBA_UNORM_BLOCK
S3TC BC3 (DXT5) block-compressed RGBA texture using 128 bits per 4x4 block.
Definition Texture.hpp:295
@ D32_FLOAT_S8_UINT
Raw bitmap where each texel comprises 1 32-bit floating-point depth component and 1 8-bit unsigned in...
Definition Texture.hpp:286
@ D24_UNORM_S8_UINT
Raw bitmap where each texel comprises 1 normalized 24-bit unsigned integer depth component and 1 8-bi...
Definition Texture.hpp:285
@ ASTC_4x4_RGBA_SRGB_BLOCK
ASTC block-compressed RGBA texture using 128 bits per 4x4 block.
Definition Texture.hpp:292
@ ASTC_4x4_RGBA_UNORM_BLOCK
ASTC block-compressed RGBA texture using 128 bits per 4x4 block.
Definition Texture.hpp:291
@ BC5_RG_UNORM_BLOCK
S3TC BC5 (RGTC2) block-compressed double-channel texture using 128 bits per 4x4 block.
Definition Texture.hpp:298
@ ETC2_R8G8B8_UNORM_BLOCK
ETC2 block-compressed RGB texture using 64 bits per 4x4 block.
Definition Texture.hpp:303
@ BC1_RGB_SRGB_BLOCK
S3TC BC1 (DXT1) block-compressed sRGB texture using 64 bits per 4x4 block.
Definition Texture.hpp:294
@ ETC2_R8G8B8_SRGB_BLOCK
ETC2 block-compressed sRGB texture using 64 bits per 4x4 block.
Definition Texture.hpp:304
@ R8G8B8A8_UNORM
Raw bitmap where each texel comprises 4 normalized 8-bit unsigned integer components: red,...
Definition Texture.hpp:276
@ B8G8R8A8_SRGB
Raw bitmap where each texel comprises 3 sRGB-encoded and 1 normalized 8-bit unsigned integer componen...
Definition Texture.hpp:279
constexpr TextureAspects operator|(TextureAspect a, TextureAspect b) noexcept
Get the union of two texture aspects.
Definition Texture.hpp:256
@ NONE
Ignore the depth buffer.
Definition shaders.hpp:59
TextureAspect
Aspect of a texture format.
Definition Texture.hpp:50
@ COLOR
Color buffer.
Definition Texture.hpp:51
@ STENCIL
Stencil buffer.
Definition Texture.hpp:53
@ DEPTH
Depth buffer.
Definition Texture.hpp:52
constexpr TextureAspects operator~(TextureAspect a) noexcept
Get the complement of a texture aspect.
Definition Texture.hpp:244
TextureMipmapMode
Mipmap mode for the sampler of a Texture.
Definition Texture.hpp:481
@ LINEAR
Interpolate between the two nearest mip levels to the displayed size.
Definition Texture.hpp:484
@ NONE
Always use the most detailed mip level (level 0).
Definition Texture.hpp:482
TextureFilter
Filtering mode for the sampler of a Texture.
Definition Texture.hpp:473
@ LINEAR
Interpolate between texels for a smoother appearance.
Definition Texture.hpp:475
@ NEAREST
Use the nearest neighbor to the sampled texel, which results in a blocky appearance.
Definition Texture.hpp:474
@ ALWAYS_PASS
The depth test always passes.
Definition shaders.hpp:137
@ LESS
The depth test passes if and only if the new depth value is less than the old depth value.
Definition shaders.hpp:102
@ NOT_EQUAL
The depth test passes if and only if the new depth value is not equal to the old depth value.
Definition shaders.hpp:132
@ NEVER_PASS
The depth test always fails.
Definition shaders.hpp:96
@ LESS_OR_EQUAL
The depth test passes if and only if the new depth value is less than or equal to the old depth value...
Definition shaders.hpp:108
@ EQUAL
The depth test passes if and only if the new depth value is equal to the old depth value.
Definition shaders.hpp:126
@ GREATER_OR_EQUAL
The depth test passes if and only if the new depth value is greater than or equal to the old depth va...
Definition shaders.hpp:120
@ GREATER
The depth test passes if and only if the new depth value is greater than the old depth value.
Definition shaders.hpp:114
TextureType
Backend-specific implementation of Texture.
Definition Texture.hpp:37
@ TEXTURE_2D_ARRAY
Texture set up to store an array of 2D images.
Definition Texture.hpp:40
@ SWAPCHAIN
Unsampled texture representing a presentation swapchain.
Definition Texture.hpp:44
@ TEXTURE_CUBE
Texture set up to store a cube of 6 sides of square 2D images.
Definition Texture.hpp:41
@ RENDERBUFFER
Unsampled texture set up to store a potentially multisampled 2D image.
Definition Texture.hpp:43
@ TEXTURE_CUBE_ARRAY
Texture set up to store an array of cubes of 6 sides of square 2D images.
Definition Texture.hpp:42
@ EMPTY
Empty texture without a value.
Definition Texture.hpp:38
@ TEXTURE_2D
Texture set up to store a single 2D image.
Definition Texture.hpp:39
ImageFormat
Description of the format of an Image, including the number of component channels,...
Definition Image.hpp:53
@ R32G32_FLOAT
Raw bitmap where each pixel comprises 2 32-bit floating-point components: red, green.
Definition Image.hpp:60
@ A1R5G5B5_UINT_PACK16
Packed bitmap with the following 16-bit unsigned integer RGBA pixel format: ARRRRRGGGGGBBBBB.
Definition Image.hpp:68
@ BC4_R_UINT_BLOCK
S3TC BC4 (RGTC1) block-compressed single-channel image using 64 bits per 4x4 block.
Definition Image.hpp:74
@ B10G11R11_UFLOAT_PACK32
Packed bitmap with the following 32-bit unsigned floating-point RGB pixel format: BBBBBBBBBBGGGGGGGGG...
Definition Image.hpp:69
@ R16_FLOAT
Raw bitmap where each pixel comprises 1 16-bit floating-point component: red.
Definition Image.hpp:56
@ KTX2_ETC1S_RGBA_UINT_BLOCK
KTX2 container of an ETC1-compressed ETC1S-encoded image with 2 DFD channels: RGB and AAA.
Definition Image.hpp:87
@ R32_FLOAT
Raw bitmap where each pixel comprises 1 32-bit floating-point component: red.
Definition Image.hpp:57
@ R8G8B8_UINT
Raw bitmap where each pixel comprises 3 8-bit unsigned integer components: red, green,...
Definition Image.hpp:61
@ R16G16B16_FLOAT
Raw bitmap where each pixel comprises 3 16-bit floating-point components: red, green,...
Definition Image.hpp:62
@ EAC_R11G11_UINT_BLOCK
ETC2 EAC block-compressed double-channel image using 128 bits per 4x4 block.
Definition Image.hpp:82
@ R16G16_FLOAT
Raw bitmap where each pixel comprises 2 16-bit floating-point components: red, green.
Definition Image.hpp:59
@ KTX2_ETC1S_R_UINT_BLOCK
KTX2 container of an ETC1-compressed ETC1S-encoded image with 1 DFD channel: RRR.
Definition Image.hpp:84
@ BC6H_RGB_UFLOAT_BLOCK
S3TC BC6H (BPTC) block-compressed unsigned floating-point RGB image using 128 bits per 4x4 block.
Definition Image.hpp:76
@ ETC2_R8G8B8A8_UINT_BLOCK
ETC2 block-compressed RGBA image using 128 bits per 4x4 block.
Definition Image.hpp:80
@ BC5_RG_UINT_BLOCK
S3TC BC5 (RGTC2) block-compressed double-channel image using 128 bits per 4x4 block.
Definition Image.hpp:75
@ R8G8B8A8_UINT
Raw bitmap where each pixel comprises 4 8-bit unsigned integer components: red, green,...
Definition Image.hpp:64
@ R8G8_UINT
Raw bitmap where each pixel comprises 2 8-bit unsigned integer components: red, green.
Definition Image.hpp:58
@ UNKNOWN
Unknown image format.
Definition Image.hpp:54
@ KTX2_UASTC_R_UINT_BLOCK
KTX2 container of an ASTC 4x4-compressed UASTC LDR-encoded image with 1 DFD channel: RRR.
Definition Image.hpp:88
@ ETC2_R8G8B8_UINT_BLOCK
ETC2 block-compressed RGB image using 64 bits per 4x4 block.
Definition Image.hpp:79
@ BC6H_RGB_FLOAT_BLOCK
S3TC BC6H (BPTC) block-compressed signed floating-point RGB image using 128 bits per 4x4 block.
Definition Image.hpp:77
@ R32G32B32A32_FLOAT
Raw bitmap where each pixel comprises 4 32-bit floating-point components: red, green,...
Definition Image.hpp:66
@ R16G16B16A16_FLOAT
Raw bitmap where each pixel comprises 4 16-bit floating-point components: red, green,...
Definition Image.hpp:65
@ ASTC_4x4_RGBA_UINT_BLOCK
ASTC block-compressed RGBA image using 128 bits per 4x4 block.
Definition Image.hpp:71
@ KTX2_UASTC_RGB_UINT_BLOCK
KTX2 container of an ASTC 4x4-compressed UASTC LDR-encoded image with 1 DFD channel: RGB.
Definition Image.hpp:90
@ R5G6B5_UINT_PACK16
Packed bitmap with the following 16-bit unsigned integer RGB pixel format: RRRRRGGGGGGBBBBB.
Definition Image.hpp:67
@ EAC_R11_UINT_BLOCK
ETC2 EAC block-compressed single-channel image using 64 bits per 4x4 block.
Definition Image.hpp:81
@ BC3_RGBA_UINT_BLOCK
S3TC BC3 (DXT5) block-compressed RGBA image using 128 bits per 4x4 block.
Definition Image.hpp:73
@ R8_UINT
Raw bitmap where each pixel comprises 1 8-bit unsigned integer component: red.
Definition Image.hpp:55
@ BC1_RGB_UINT_BLOCK
S3TC BC1 (DXT1) block-compressed RGB image using 64 bits per 4x4 block.
Definition Image.hpp:72
@ KTX2_ETC1S_RGB_UINT_BLOCK
KTX2 container of an ETC1-compressed ETC1S-encoded image with 1 DFD channel: RGB.
Definition Image.hpp:86
@ A2B10G10R10_UINT_PACK32
Packed bitmap with the following 32-bit unsigned integer RGBA pixel format: AABBBBBBBBBBGGGGGGGGGGRRR...
Definition Image.hpp:70
@ KTX2_UASTC_RG_UINT_BLOCK
KTX2 container of an ASTC 4x4-compressed UASTC LDR-encoded image with 1 DFD channel: RG.
Definition Image.hpp:89
@ KTX2_ETC1S_RG_UINT_BLOCK
KTX2 container of an ETC1-compressed ETC1S-encoded image with 2 DFD channels: RRR and GGG.
Definition Image.hpp:85
@ PVRTC1_4BPP_RGBA_UINT_BLOCK
PVRTC1 block-compressed RGBA image using 64 bits per 4x4 block.
Definition Image.hpp:83
@ R32G32B32_FLOAT
Raw bitmap where each pixel comprises 3 32-bit floating-point components: red, green,...
Definition Image.hpp:63
@ BC7_RGBA_UINT_BLOCK
S3TC BC7 (BPTC) block-compressed RGBA image using 128 bits per 4x4 block.
Definition Image.hpp:78
@ KTX2_UASTC_RGBA_UINT_BLOCK
KTX2 container of an ASTC 4x4-compressed UASTC LDR-encoded image with 1 DFD channel: RGBA.
Definition Image.hpp:91
ImageType
Type of an Image.
Definition Image.hpp:41
@ IMAGE_CUBE
A cube of 6 sides of square 2D images.
Definition Image.hpp:45
@ IMAGE_CUBE_ARRAY
An array of cubes of 6 sides of square 2D images.
Definition Image.hpp:46
@ EMPTY
Empty image without a value.
Definition Image.hpp:42
@ IMAGE_2D_ARRAY
An array of 2D images.
Definition Image.hpp:44
@ IMAGE_2D
A single 2D image.
Definition Image.hpp:43
Region< 3 > Region3D
Rectangular region of 3D data.
Definition extents.hpp:820
Extent< 2 > Extent2D
Size of a 2D data region.
Definition extents.hpp:31
void unreachable()
Definition assertions.hpp:125
Offset< 3 > Offset3D
Offset in a 3D data region.
Definition extents.hpp:22
Extent< 3 > Extent3D
Size of a 3D data region.
Definition extents.hpp:32
uint32_t height
Vertical extent.
Definition extents.hpp:239
uint32_t width
Horizontal extent.
Definition extents.hpp:238
uint32_t depth
Number of layers.
Definition extents.hpp:240
Specification of how a texture should either be left untouched, be cleared to specific values or be c...
Definition Texture.hpp:444
constexpr Variant() noexcept(std::is_nothrow_default_constructible_v< variant_alternative_t< 0, Variant > >)
Default-construct a variant with the first variant alternative, if it is default-constructible.
Definition Variant.hpp:351
Specification of values that a texture should be cleared to.
Definition Texture.hpp:426
uint8_t stencil
Stencil value to clear the stencil aspect to.
Definition Texture.hpp:430
TextureAspects aspects
Which texture aspects to clear.
Definition Texture.hpp:427
float depth
Depth value to clear the depth aspect to.
Definition Texture.hpp:429
Color color
Color value to clear the color aspect to.
Definition Texture.hpp:428
Exception type for domain-specific errors originating from the grem::graphics module.
Definition Error.hpp:17
Specification of how an intermediate render texture should either store or discard its values after b...
Definition Texture.hpp:466
constexpr Variant() noexcept(std::is_nothrow_default_constructible_v< variant_alternative_t< 0, Variant > >)
Default-construct a variant with the first variant alternative, if it is default-constructible.
Definition Variant.hpp:351
Specification that a texture should leave its values untouched rather than clearing them.
Definition Texture.hpp:421
Configuration options for a texture image download.
Definition Texture.hpp:590
bool convertFromPremultipliedAlpha
Convert the downloaded image from pre-multiplied to straight alpha.
Definition Texture.hpp:602
constexpr bool operator==(const TextureImageDownloadOptions &other) const =default
Compare these options to another set of options for equality.
Optional< TextureSubresource > subresource
Texture subresource to download.
Definition Texture.hpp:595
Configuration options for a texture image upload.
Definition Texture.hpp:550
bool generateMipmap
Generate a new mip chain with the maximum number of mip levels for the texture based on mip level 0 o...
Definition Texture.hpp:575
bool convertToPremultipliedAlpha
Convert the uploaded image from straight to pre-multiplied alpha.
Definition Texture.hpp:565
constexpr bool operator==(const TextureImageUploadOptions &other) const =default
Compare these options to another set of options for equality.
Color::TransferFunction transferFunction
Preferred transfer function to use when choosing the internal texture format.
Definition Texture.hpp:558
Read-only reference to a 2D region of a texture.
Definition Texture.hpp:396
const Texture * texture
Read-only non-null pointer to the texture.
Definition Texture.hpp:397
TextureRegion2D region
Referenced texture region.
Definition Texture.hpp:398
Reference to a 2D region of a texture.
Definition Texture.hpp:388
Texture * texture
Non-null pointer to the texture.
Definition Texture.hpp:389
TextureRegion2D region
Referenced texture region.
Definition Texture.hpp:390
Two-dimensional region of a texture.
Definition Texture.hpp:334
uint32_t mipLevel
Mip level index in the texture.
Definition Texture.hpp:338
Extent2D size
Size of the region, in texels.
Definition Texture.hpp:337
Offset3D offset
Offset from the bottom left of the first layer in the texture, in texels.
Definition Texture.hpp:336
constexpr bool operator==(const TextureRegion2D &other) const =default
Compare this region to another for equality.
TextureAspects aspects
Set of texture aspects.
Definition Texture.hpp:335
Read-only reference to a 3D region of a texture.
Definition Texture.hpp:412
TextureRegion3D region
Referenced texture region.
Definition Texture.hpp:414
const Texture * texture
Read-only non-null pointer to the texture.
Definition Texture.hpp:413
Reference to a 3D region of a texture.
Definition Texture.hpp:404
TextureRegion3D region
Referenced texture region.
Definition Texture.hpp:406
Texture * texture
Non-null pointer to the texture.
Definition Texture.hpp:405
Three-dimensional region of a texture.
Definition Texture.hpp:353
Offset3D offset
Offset from the bottom left of the first layer in the texture, in texels.
Definition Texture.hpp:355
TextureAspects aspects
Set of texture aspects.
Definition Texture.hpp:354
uint32_t mipLevel
Mip level index in the texture.
Definition Texture.hpp:357
constexpr bool operator==(const TextureRegion3D &other) const =default
Compare this region to another for equality.
Extent3D size
Size of the region, in texels/layers.
Definition Texture.hpp:356
Configuration options for the sampler of a Texture.
Definition Texture.hpp:617
constexpr bool operator==(const TextureSamplerOptions &other) const =default
Compare this configuration to another for equality.
TextureWrappingMode horizontalWrappingMode
How to address the texture when the horizontal component of the texture coordinates is outside the 0-...
Definition Texture.hpp:654
float maxAnisotropy
Maximum level of anisotropic filtering to use.
Definition Texture.hpp:667
TextureWrappingMode verticalWrappingMode
How to address the texture when the vertical component of the texture coordinates is outside the 0-1 ...
Definition Texture.hpp:660
TextureFilter magnificationFilter
Filtering mode to use when the texture is rendered larger than its original size.
Definition Texture.hpp:634
Optional< TextureDepthComparisonMode > depthComparisonMode
Depth comparison mode to use when sampling the texture.
Definition Texture.hpp:674
TextureMipmapMode mipmapMode
Mipmap mode to use when determining which mip detail level to sample depending on the texture's size ...
Definition Texture.hpp:648
static const TextureSamplerOptions UNFILTERED
A texture sampler configuration that ensures that the texture is sampled as directly as possible,...
Definition Texture.hpp:622
TextureFilter minificationFilter
Filtering mode to use when the texture is rendered smaller than its original size.
Definition Texture.hpp:628
Read-only reference to a subresource of a texture.
Definition Texture.hpp:380
TextureSubresource subresource
Referenced texture subresource.
Definition Texture.hpp:382
const Texture * texture
Read-only non-null pointer to the texture.
Definition Texture.hpp:381
Reference to a subresource of a texture.
Definition Texture.hpp:372
TextureSubresource subresource
Referenced texture subresource.
Definition Texture.hpp:374
Texture * texture
Non-null pointer to the texture.
Definition Texture.hpp:373
Subresource selection of a texture.
Definition Texture.hpp:316
constexpr bool operator==(const TextureSubresource &other) const =default
Compare this subresource selection to another for equality.
uint32_t layer
Layer index in the texture.
Definition Texture.hpp:318
uint32_t mipLevel
Mip level index in the texture.
Definition Texture.hpp:319
TextureAspects aspects
Set of texture aspects.
Definition Texture.hpp:317
Specification that a texture may be cleared to undefined values.
Definition Texture.hpp:436
TextureAspects aspects
Which texture aspects to clear.
Definition Texture.hpp:437