Blender  V2.93
RE_texture.h
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  * The Original Code is Copyright (C) 2006 by Blender Foundation
17  * All rights reserved.
18  */
23 #pragma once
24 
25 /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
26 /* this include is for non-render pipeline exports (still old cruft here) */
27 /* ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ */
28 
29 /* called by meshtools */
30 struct Depsgraph;
31 struct ImagePool;
32 struct MTex;
33 struct Tex;
34 
35 #ifdef __cplusplus
36 extern "C" {
37 #endif
38 
39 /* texture_procedural.c */
40 bool RE_texture_evaluate(const struct MTex *mtex,
41  const float vec[3],
42  const int thread,
43  struct ImagePool *pool,
44  const bool skip_load_image,
45  const bool texnode_preview,
46  /* Return arguments. */
47  float *r_intensity,
48  float r_rgba[4]) ATTR_NONNULL(1, 2, 7, 8);
49 
51  float in[3], const float tex[3], const float out[3], float fact, float facg, int blendtype);
52 float texture_value_blend(float tex, float out, float fact, float facg, int blendtype);
53 
54 void RE_texture_rng_init(void);
55 void RE_texture_rng_exit(void);
56 
57 /* texture_image.c */
58 void ibuf_sample(struct ImBuf *ibuf, float fx, float fy, float dx, float dy, float result[4]);
59 
60 /* texture_pointdensity.c */
61 struct PointDensity;
62 
63 void RE_point_density_cache(struct Depsgraph *depsgraph, struct PointDensity *pd);
64 
66  struct PointDensity *pd,
67  float r_min[3],
68  float r_max[3]);
69 
71  struct PointDensity *pd,
72  const int resolution,
73  float *values);
74 
75 void RE_point_density_free(struct PointDensity *pd);
76 
78 
79 /* texture_procedural.c */
80 
81 /* Texture evaluation result.
82  * Note; tr tg tb ta has to remain in this order for array access. */
83 typedef struct TexResult {
84  float tin, tr, tg, tb, ta;
85  int talpha;
86  float *nor;
88 
89 /* This one uses nodes. */
90 int multitex_ext(struct Tex *tex,
91  float texvec[3],
92  float dxt[3],
93  float dyt[3],
94  int osatex,
95  struct TexResult *texres,
96  const short thread,
97  struct ImagePool *pool,
98  bool scene_color_manage,
99  const bool skip_load_image);
100 /* Nodes disabled. */
101 int multitex_ext_safe(struct Tex *tex,
102  const float texvec[3],
103  struct TexResult *texres,
104  struct ImagePool *pool,
105  bool scene_color_manage,
106  const bool skip_load_image);
107 /* Only for internal node usage. */
108 int multitex_nodes(struct Tex *tex,
109  const float texvec[3],
110  float dxt[3],
111  float dyt[3],
112  int osatex,
113  struct TexResult *texres,
114  const short thread,
115  short which_output,
116  struct MTex *mtex,
117  struct ImagePool *pool);
118 
119 #ifdef __cplusplus
120 }
121 #endif
#define ATTR_NONNULL(...)
struct Depsgraph Depsgraph
Definition: DEG_depsgraph.h:51
int multitex_ext_safe(struct Tex *tex, const float texvec[3], struct TexResult *texres, struct ImagePool *pool, bool scene_color_manage, const bool skip_load_image)
void RE_point_density_fix_linking(void)
void RE_point_density_cache(struct Depsgraph *depsgraph, struct PointDensity *pd)
void RE_point_density_sample(struct Depsgraph *depsgraph, struct PointDensity *pd, const int resolution, float *values)
void RE_texture_rng_init(void)
void RE_point_density_minmax(struct Depsgraph *depsgraph, struct PointDensity *pd, float r_min[3], float r_max[3])
int multitex_ext(struct Tex *tex, float texvec[3], float dxt[3], float dyt[3], int osatex, struct TexResult *texres, const short thread, struct ImagePool *pool, bool scene_color_manage, const bool skip_load_image)
void ibuf_sample(struct ImBuf *ibuf, float fx, float fy, float dx, float dy, float result[4])
bool RE_texture_evaluate(const struct MTex *mtex, const float vec[3], const int thread, struct ImagePool *pool, const bool skip_load_image, const bool texnode_preview, float *r_intensity, float r_rgba[4]) ATTR_NONNULL(1
void RE_point_density_free(struct PointDensity *pd)
bool void texture_rgb_blend(float in[3], const float tex[3], const float out[3], float fact, float facg, int blendtype)
void RE_texture_rng_exit(void)
float texture_value_blend(float tex, float out, float fact, float facg, int blendtype)
struct TexResult TexResult
int multitex_nodes(struct Tex *tex, const float texvec[3], float dxt[3], float dyt[3], int osatex, struct TexResult *texres, const short thread, short which_output, struct MTex *mtex, struct ImagePool *pool)
const Depsgraph * depsgraph
int talpha
Definition: RE_texture.h:85
float tb
Definition: RE_texture.h:84
float * nor
Definition: RE_texture.h:86
float tin
Definition: RE_texture.h:84
float ta
Definition: RE_texture.h:84
float tr
Definition: RE_texture.h:84
float tg
Definition: RE_texture.h:84