Blender
V2.93
source
blender
draw
intern
draw_color_management.c
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or
3
* modify it under the terms of the GNU General Public License
4
* as published by the Free Software Foundation; either version 2
5
* of the License, or (at your option) any later version.
6
*
7
* This program is distributed in the hope that it will be useful,
8
* but WITHOUT ANY WARRANTY; without even the implied warranty of
9
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10
* GNU General Public License for more details.
11
*
12
* You should have received a copy of the GNU General Public License
13
* along with this program; if not, write to the Free Software Foundation,
14
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
15
*
16
* Copyright 2020, Blender Foundation.
17
*/
18
23
#include <stdio.h>
24
25
#include "
draw_manager.h
"
26
27
#include "
DRW_render.h
"
28
29
#include "
GPU_batch.h
"
30
#include "
GPU_framebuffer.h
"
31
#include "
GPU_matrix.h
"
32
#include "
GPU_texture.h
"
33
34
#include "
BKE_colortools.h
"
35
36
#include "
IMB_colormanagement.h
"
37
38
#include "
draw_color_management.h
"
39
40
/* -------------------------------------------------------------------- */
44
/* Draw texture to framebuffer without any color transforms */
45
void
DRW_transform_none
(
GPUTexture
*
tex
)
46
{
47
drw_state_set
(
DRW_STATE_WRITE_COLOR
);
48
49
GPU_matrix_identity_set
();
50
GPU_matrix_identity_projection_set
();
51
52
/* Draw as texture for final render (without immediate mode). */
53
GPUBatch
*geom =
DRW_cache_fullscreen_quad_get
();
54
GPU_batch_program_set_builtin
(geom,
GPU_SHADER_2D_IMAGE_COLOR
);
55
GPU_batch_uniform_4f
(geom,
"color"
, 1.0f, 1.0f, 1.0f, 1.0f);
56
GPU_batch_texture_bind
(geom,
"image"
,
tex
);
57
58
GPU_batch_draw
(geom);
59
60
GPU_texture_unbind
(
tex
);
61
}
62
BKE_colortools.h
DRW_render.h
DRW_STATE_WRITE_COLOR
@ DRW_STATE_WRITE_COLOR
Definition:
DRW_render.h:315
GPU_batch.h
GPUBatch
GPUBatch
Definition:
GPU_batch.h:93
GPU_batch_texture_bind
#define GPU_batch_texture_bind(batch, name, tex)
Definition:
GPU_batch.h:149
GPU_batch_program_set_builtin
void GPU_batch_program_set_builtin(GPUBatch *batch, eGPUBuiltinShader shader_id)
Definition:
gpu_batch.cc:299
GPU_batch_draw
void GPU_batch_draw(GPUBatch *batch)
Definition:
gpu_batch.cc:234
GPU_batch_uniform_4f
#define GPU_batch_uniform_4f(batch, name, x, y, z, w)
Definition:
GPU_batch.h:138
GPU_framebuffer.h
GPU_matrix.h
GPU_matrix_identity_projection_set
void GPU_matrix_identity_projection_set(void)
Definition:
gpu_matrix.cc:170
GPU_matrix_identity_set
void GPU_matrix_identity_set(void)
Definition:
gpu_matrix.cc:184
GPU_SHADER_2D_IMAGE_COLOR
@ GPU_SHADER_2D_IMAGE_COLOR
Definition:
GPU_shader.h:187
GPU_texture.h
GPUTexture
struct GPUTexture GPUTexture
Definition:
GPU_texture.h:33
GPU_texture_unbind
void GPU_texture_unbind(GPUTexture *tex)
Definition:
gpu_texture.cc:421
IMB_colormanagement.h
tex
Tex tex
Definition:
deg_eval_copy_on_write.cc:121
DRW_cache_fullscreen_quad_get
GPUBatch * DRW_cache_fullscreen_quad_get(void)
Definition:
draw_cache.c:358
DRW_transform_none
void DRW_transform_none(GPUTexture *tex)
Definition:
draw_color_management.c:45
draw_color_management.h
draw_manager.h
drw_state_set
void drw_state_set(DRWState state)
Definition:
draw_manager_exec.c:81
Generated on Tue Jan 31 2023 14:37:24 for Blender by
doxygen
1.9.1