|
Blender V5.0
|
#include "BLI_utildefines.h"#include "MEM_guardedalloc.h"#include "CLG_log.h"#include "GPU_capabilities.hh"#include "GPU_texture.hh"#include "IMB_colormanagement.hh"#include "IMB_imbuf.hh"#include "IMB_imbuf_types.hh"Go to the source code of this file.
Functions | |
| static bool | imb_is_grayscale_texture_format_compatible (const ImBuf *ibuf) |
| static void | imb_gpu_get_format (const ImBuf *ibuf, bool high_bitdepth, bool use_grayscale, blender::gpu::TextureFormat *r_texture_format) |
| static const char * | imb_gpu_get_swizzle (const ImBuf *ibuf) |
| bool | IMB_gpu_get_compressed_format (const ImBuf *ibuf, blender::gpu::TextureFormat *r_texture_format) |
| static void * | imb_gpu_get_data (const ImBuf *ibuf, const bool do_rescale, const int rescale_size[2], const bool store_premultiplied, const bool allow_grayscale, bool *r_freedata, eGPUDataFormat *r_data_format) |
| blender::gpu::Texture * | IMB_touch_gpu_texture (const char *name, ImBuf *ibuf, int w, int h, int layers, bool use_high_bitdepth, bool use_grayscale) |
| void | IMB_update_gpu_texture_sub (blender::gpu::Texture *tex, ImBuf *ibuf, int x, int y, int z, int w, int h, bool use_high_bitdepth, bool use_grayscale, bool use_premult) |
| blender::gpu::Texture * | IMB_create_gpu_texture (const char *name, ImBuf *ibuf, bool use_high_bitdepth, bool use_premult) |
| blender::gpu::TextureFormat | IMB_gpu_get_texture_format (const ImBuf *ibuf, bool high_bitdepth, bool use_grayscale) |
| void | IMB_gpu_clamp_half_float (ImBuf *image_buffer) |
Variables | |
| static CLG_LogRef | LOG = {"image.gpu"} |
| blender::gpu::Texture * IMB_create_gpu_texture | ( | const char * | name, |
| ImBuf * | ibuf, | ||
| bool | use_high_bitdepth, | ||
| bool | use_premult ) |
Definition at line 327 of file util_gpu.cc.
References BLI_assert, CLOG_WARN, data, DDSData::data, ImBuf::dds_data, ImBuf::ftype, GPU_texture_anisotropic_filter(), GPU_texture_create_2d(), GPU_texture_create_compressed_2d(), GPU_texture_size_with_limit(), GPU_texture_swizzle_set(), GPU_texture_update(), GPU_TEXTURE_USAGE_GENERAL, GPU_TEXTURE_USAGE_HOST_READ, GPU_TEXTURE_USAGE_SHADER_READ, IMB_FTYPE_DDS, IMB_gpu_get_compressed_format(), imb_gpu_get_data(), imb_gpu_get_format(), imb_gpu_get_swizzle(), is_power_of_2_i(), LOG, max_ii(), MEM_freeN(), name, DDSData::nummipmaps, size(), UNPACK2, ImBuf::x, and ImBuf::y.
Referenced by BKE_movieclip_get_gpu_texture(), blender::compositor::CachedImage::CachedImage(), and image_get_gpu_texture().
| void IMB_gpu_clamp_half_float | ( | ImBuf * | image_buffer | ) |
Ensures that values stored in the float rect can safely loaded into half float gpu textures.
Does nothing when given image_buffer doesn't contain a float rect.
Definition at line 419 of file util_gpu.cc.
References ImBuf::channels, clamp_f(), ImBufFloatBuffer::data, ImBuf::float_buffer, i, ImBuf::x, and ImBuf::y.
| bool IMB_gpu_get_compressed_format | ( | const ImBuf * | ibuf, |
| blender::gpu::TextureFormat * | r_texture_format ) |
Definition at line 101 of file util_gpu.cc.
References ImBuf::byte_buffer, ImBufByteBuffer::colorspace, ImBuf::dds_data, DDSData::fourcc, FOURCC_DXT1, FOURCC_DXT3, FOURCC_DXT5, IMB_colormanagement_space_is_data(), and IMB_colormanagement_space_is_scene_linear().
Referenced by IMB_create_gpu_texture(), and uiTemplateImageInfo().
|
static |
Apply colormanagement and scale buffer if needed. *r_freedata is set to true if the returned buffer need to be manually freed.
Definition at line 131 of file util_gpu.cc.
References Box, ImBuf::byte_buffer, ImBuf::channels, ImBufByteBuffer::colorspace, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, GPU_DATA_FLOAT, GPU_DATA_UBYTE, i, IMB_allocFromBuffer(), IMB_colormanagement_imbuf_to_byte_texture(), IMB_colormanagement_imbuf_to_float_texture(), IMB_colormanagement_space_is_data(), IMB_colormanagement_space_is_scene_linear(), IMB_colormanagement_space_is_srgb(), IMB_freeImBuf(), IMB_get_pixel_count(), imb_is_grayscale_texture_format_compatible(), IMB_scale(), IMB_steal_byte_buffer(), IMB_steal_float_buffer(), MEM_freeN(), MEM_malloc_arrayN(), MEM_mallocN(), UNPACK2, ImBuf::x, and ImBuf::y.
Referenced by IMB_create_gpu_texture(), and IMB_update_gpu_texture_sub().
|
static |
Definition at line 57 of file util_gpu.cc.
References ImBuf::byte_buffer, ImBufByteBuffer::colorspace, ImBufFloatBuffer::data, ImbFormatOptions::flag, ImBuf::float_buffer, ImBuf::foptions, IMB_colormanagement_space_is_data(), IMB_colormanagement_space_is_scene_linear(), IMB_colormanagement_space_is_srgb(), imb_is_grayscale_texture_format_compatible(), and OPENEXR_HALF.
Referenced by IMB_create_gpu_texture(), IMB_gpu_get_texture_format(), IMB_touch_gpu_texture(), and IMB_update_gpu_texture_sub().
|
static |
Definition at line 95 of file util_gpu.cc.
References imb_is_grayscale_texture_format_compatible().
Referenced by IMB_create_gpu_texture(), and IMB_touch_gpu_texture().
| blender::gpu::TextureFormat IMB_gpu_get_texture_format | ( | const ImBuf * | ibuf, |
| bool | high_bitdepth, | ||
| bool | use_grayscale ) |
Definition at line 410 of file util_gpu.cc.
References imb_gpu_get_format().
Referenced by uiTemplateImageInfo().
|
static |
Definition at line 26 of file util_gpu.cc.
References ImBuf::byte_buffer, ImBufByteBuffer::colorspace, ImBufFloatBuffer::colorspace, ImBufByteBuffer::data, ImBufFloatBuffer::data, ImBuf::float_buffer, IMB_colormanagement_space_is_data(), IMB_colormanagement_space_is_scene_linear(), IMB_colormanagement_space_is_srgb(), and ImBuf::planes.
Referenced by imb_gpu_get_data(), imb_gpu_get_format(), and imb_gpu_get_swizzle().
| blender::gpu::Texture * IMB_touch_gpu_texture | ( | const char * | name, |
| ImBuf * | ibuf, | ||
| int | w, | ||
| int | h, | ||
| int | layers, | ||
| bool | use_high_bitdepth, | ||
| bool | use_grayscale ) |
The ibuf is only here to detect the storage type. The produced texture will have undefined content. It will need to be populated by using IMB_update_gpu_texture_sub().
Definition at line 270 of file util_gpu.cc.
References GPU_texture_anisotropic_filter(), GPU_texture_create_2d(), GPU_texture_create_2d_array(), GPU_texture_swizzle_set(), GPU_TEXTURE_USAGE_SHADER_READ, imb_gpu_get_format(), imb_gpu_get_swizzle(), name, and w().
Referenced by gpu_texture_create_tile_array().
| void IMB_update_gpu_texture_sub | ( | blender::gpu::Texture * | tex, |
| ImBuf * | ibuf, | ||
| int | x, | ||
| int | y, | ||
| int | z, | ||
| int | w, | ||
| int | h, | ||
| bool | use_high_bitdepth, | ||
| bool | use_grayscale, | ||
| bool | use_premult ) |
Will update a blender::gpu::Texture using the content of the ImBuf. Only one layer will be updated. Will resize the ibuf if needed. Z is the layer to update. Unused if the texture is 2D.
Definition at line 296 of file util_gpu.cc.
References data, GPU_texture_update_sub(), imb_gpu_get_data(), imb_gpu_get_format(), MEM_freeN(), size(), w(), ImBuf::x, x, ImBuf::y, y, and z().
Referenced by gpu_texture_create_tile_array().
|
static |
Definition at line 22 of file util_gpu.cc.