Blender V4.3
image_shader_params.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2021 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
9#pragma once
10
11#include "DNA_camera_types.h"
12#include "DNA_image_types.h"
13#include "DNA_scene_types.h"
14
15#include "IMB_imbuf_types.hh"
16
17#include "BKE_image.hh"
18
19#include "image_enums.hh"
20#include "image_space.hh"
21
23
26 float shuffle[4];
27 float far_near[2];
28 bool use_premul_alpha = false;
29
30 void update(AbstractSpaceAccessor *space, const Scene *scene, Image *image, ImBuf *image_buffer)
31 {
33 copy_v4_fl(shuffle, 1.0f);
34 copy_v2_fl2(far_near, 100.0f, 0.0f);
35
37
38 if (scene->camera && scene->camera->type == OB_CAMERA) {
39 const Camera *camera = static_cast<const Camera *>(scene->camera->data);
40 copy_v2_fl2(far_near, camera->clip_end, camera->clip_start);
41 }
42 space->get_shader_parameters(*this, image_buffer);
43 }
44};
45
46} // namespace blender::draw::image_engine
bool BKE_image_has_gpu_texture_premultiplied_alpha(Image *image, ImBuf *ibuf)
Definition image_gpu.cc:41
MINLINE void copy_v2_fl2(float v[2], float x, float y)
MINLINE void copy_v4_fl(float r[4], float f)
@ OB_CAMERA
Contains defines and structs used throughout the imbuf module.
void update(AbstractSpaceAccessor *space, const Scene *scene, Image *image, ImBuf *image_buffer)