24void PixelBitmapDrawer::init_vertex_attributes()
33 init_vertex_attributes();
38 init_vertex_attributes();
50 const bool use_filter,
56 const float draw_width = img_w * scale_x;
57 const float draw_height = img_h * scale_y;
61 const bool use_mipmap = use_filter && (scale_x < 0.5f || scale_y < 0.5f);
62 const int mip_len = use_mipmap ? 9999 : 1;
69 "immDrawPixels", img_w, img_h, mip_len, gpu_format, usage,
nullptr);
74 const bool use_float_data =
ELEM(gpu_format,
75 gpu::TextureFormat::SFLOAT_16_16_16_16,
76 gpu::TextureFormat::SFLOAT_16_16_16,
77 gpu::TextureFormat::SFLOAT_16);
92 static const float white[4] = {1.0f, 1.0f, 1.0f, 1.0f};
97 const uint pos = this->pos, texco = this->texco;
141 const bool predivide = ibuf->
float_data() !=
nullptr;
143 view_settings, display_settings,
colorspace, ibuf->
dither, predivide,
false))
148 const void *texture_data =
nullptr;
153 format = TextureFormat::SFLOAT_16;
156 format = TextureFormat::SFLOAT_16_16_16;
159 format = TextureFormat::SFLOAT_16_16_16_16;
162 BLI_assert_msg(0,
"Incompatible number of channels for GLSL display");
167 format = TextureFormat::UNORM_8_8_8_8;
171 drawer.
draw(
x,
y, ibuf->
x, ibuf->
y, format, use_filter, texture_data, zoom_x, zoom_y,
nullptr);
188 ED_draw_imbuf(ibuf,
x,
y, use_filter, view_settings, display_settings, zoom_x, zoom_y);
#define BLI_assert_msg(a, msg)
void draw(float x, float y, int img_w, int img_h, gpu::TextureFormat gpu_format, bool use_filter, const void *rect, float scale_x, float scale_y, const float color[4])
MINLINE float min_ff(float a, float b)
void GPU_texture_update(gpu::Texture *texture, eGPUDataFormat data_format, const void *data)
void IMB_colormanagement_finish_glsl_draw()
void immDrawBorderCorners(unsigned int pos, const rcti *border, float zoomx, float zoomy)
GPUVertFormat * immVertexFormat()
void GPU_texture_update_mipmap_chain(gpu::Texture *texture)
void ED_draw_imbuf(const ImBuf *ibuf, float x, float y, bool use_filter, const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, float zoom_x, float zoom_y)
void immBegin(GPUPrimType, uint vertex_len)
bool IMB_colormanagement_setup_glsl_draw_from_space(const ColorManagedViewSettings *view_settings, const ColorManagedDisplaySettings *display_settings, const ColorSpace *from_colorspace, float dither, bool predivide, bool do_overlay_merge, ColorManagedDisplaySpace display_space=DISPLAY_SPACE_DRAW, float opacity=1.0f)
@ GPU_SAMPLER_EXTEND_MODE_EXTEND
void immUniformColor4fv(const float rgba[4])
void immAttr2f(uint attr_id, float x, float y)
void immBindBuiltinProgram(GPUBuiltinShader shader_id)
void GPU_texture_mipmap_mode(gpu::Texture *texture, bool use_mipmap, bool use_filter)
void immVertex2f(uint attr_id, float x, float y)
@ GPU_TEXTURE_USAGE_SHADER_READ
@ GPU_TEXTURE_USAGE_SHADER_WRITE
void GPU_texture_filter_mode(gpu::Texture *texture, bool use_filter)
uint GPU_vertformat_attr_add(GPUVertFormat *format, StringRef name, gpu::VertAttrType type)
void IMB_colormanagement_display_settings_from_ctx(const bContext *C, ColorManagedViewSettings **r_view_settings, ColorManagedDisplaySettings **r_display_settings)
void GPU_texture_extend_mode(gpu::Texture *texture, GPUSamplerExtendMode extend_mode)
int GPU_shader_get_uniform(gpu::Shader *shader, const char *name)
void ED_draw_imbuf_ctx(const bContext *C, const ImBuf *ibuf, float x, float y, bool use_filter, float zoom_x, float zoom_y)
gpu::Shader * GPU_shader_get_builtin_shader(GPUBuiltinShader shader)
void GPU_texture_bind(gpu::Texture *texture, int unit)
void GPU_texture_free(gpu::Texture *texture)
void GPU_texture_unbind(gpu::Texture *texture)
gpu::Texture * GPU_texture_create_2d(const char *name, int width, int height, int mip_len, gpu::TextureFormat format, eGPUTextureUsage usage, const float *data)
ocio::ColorSpace ColorSpace
const ColorSpace * colorspace
const ColorSpace * colorspace
ImBufFloatBuffer float_buffer
ImBufByteBuffer byte_buffer
const uint8_t * byte_data() const
const float * float_data() const