![]() |
ezEngine Release 26.3
|
Utility functions for texture format conversion and manipulation. More...
#include <TextureUtils.h>
Static Public Member Functions | |
| static ezGALResourceFormat::Enum | ImageFormatToGalFormat (ezImageFormat::Enum format, bool bSRGB) |
| static ezImageFormat::Enum | GalFormatToImageFormat (ezGALResourceFormat::Enum format, bool bRemoveSRGB) |
| static ezImageFormat::Enum | GalFormatToImageFormat (ezGALResourceFormat::Enum format) |
| Converts a GPU texture format to the corresponding image format. | |
| static void | ConfigureSampler (ezTextureFilterSetting::Enum filter, ezGALSamplerStateCreationDescription &out_sampler) |
| static void | CopySubResourceToImage (const ezGALTextureCreationDescription &desc, const ezGALTextureSubresource &subResource, const ezGALSystemMemoryDescription &memory, ezImage &out_image, bool bRemoveSRGB) |
Copies the given texture subresource from memory into out_image according to the texture description. | |
| static ezImageView | MakeImageViewFromSubResource (const ezGALTextureCreationDescription &desc, const ezGALTextureSubresource &subResource, const ezGALSystemMemoryDescription &memory, ezImage &ref_tempImage, bool bRemoveSRGB) |
Returns an image view of the texture subresource in memory. If the format allows for it, the memory will be aliased, removing the need to copy the data but the view becomes invalid once the memory does. If this is not possible, the function reverts to calling CopySubResourceToImage with ref_tempImage used as the data storage. You can check if ref_tempImage is valid to figure out which code path was taken. | |
| static void | CopySubResourceToMemory (const ezGALTextureCreationDescription &desc, const ezGALTextureSubresource &subResource, const ezGALSystemMemoryDescription &sourceMemory, ezArrayPtr< ezUInt8 > targetData, ezUInt32 uiTargetRowPitch) |
| Copies a texture subresource memory to a new location with a different row pitch. | |
Static Public Attributes | |
| static bool | s_bForceFullQualityAlways = false |
| If enabled, textures are always loaded to full quality immediately. Mostly necessary for image comparison unit tests. | |
Utility functions for texture format conversion and manipulation.
|
static |
Configures a sampler state based on a texture filter setting.
Sets up filtering mode, addressing, and anisotropy based on the filter enum.
|
static |
Converts a GPU texture format to the corresponding image format.
If bRemoveSRGB is true, sRGB formats are converted to their linear equivalents.
|
static |
Converts an image format to the corresponding GPU texture format.
The bSRGB parameter determines whether to use sRGB or linear variants.