Blender  V2.93
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 */
46 {
48 
51 
52  /* Draw as texture for final render (without immediate mode). */
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 
61 }
62 
@ DRW_STATE_WRITE_COLOR
Definition: DRW_render.h:315
GPUBatch
Definition: GPU_batch.h:93
#define GPU_batch_texture_bind(batch, name, tex)
Definition: GPU_batch.h:149
void GPU_batch_program_set_builtin(GPUBatch *batch, eGPUBuiltinShader shader_id)
Definition: gpu_batch.cc:299
void GPU_batch_draw(GPUBatch *batch)
Definition: gpu_batch.cc:234
#define GPU_batch_uniform_4f(batch, name, x, y, z, w)
Definition: GPU_batch.h:138
void GPU_matrix_identity_projection_set(void)
Definition: gpu_matrix.cc:170
void GPU_matrix_identity_set(void)
Definition: gpu_matrix.cc:184
@ GPU_SHADER_2D_IMAGE_COLOR
Definition: GPU_shader.h:187
struct GPUTexture GPUTexture
Definition: GPU_texture.h:33
void GPU_texture_unbind(GPUTexture *tex)
Definition: gpu_texture.cc:421
GPUBatch * DRW_cache_fullscreen_quad_get(void)
Definition: draw_cache.c:358
void DRW_transform_none(GPUTexture *tex)
void drw_state_set(DRWState state)