30 coba->
data[0].
r = 0.0;
31 coba->
data[0].
g = 0.0;
32 coba->
data[0].
b = 0.0;
33 coba->
data[0].
a = 0.0;
35 coba->
data[1].
r = 1.0;
36 coba->
data[1].
g = 1.0;
37 coba->
data[1].
b = 1.0;
38 coba->
data[1].
a = 1.0;
41 coba->
data[0].
r = 0.0;
42 coba->
data[0].
g = 0.0;
43 coba->
data[0].
b = 0.0;
44 coba->
data[0].
a = 1.0;
46 coba->
data[1].
r = 1.0;
47 coba->
data[1].
g = 1.0;
48 coba->
data[1].
b = 1.0;
49 coba->
data[1].
a = 1.0;
67 const float (*
array)[4],
71 const float eps = (1.0f / 255.0f) + 1e-6f;
75 const float step_size = 1.0f / (
float)
max_ii(stops - 1, 1);
77 for (
int i_step = 0; i_step < stops; i_step++) {
83 coba->
data[i_curr].
pos = i_step * step_size;
84 coba->
data[i_curr].
cur = i_curr;
86 coba->
tot = i_curr + 1;
92 coba->
data[0].
a = 1.0f;
124 float xy_prev[2], xy_curr[2], xy_next[2];
125 xy_prev[0] =
c->prev->pos;
127 xy_next[0] =
c->next->pos;
128 for (
int i = 0; i < 4; i++) {
129 xy_prev[1] =
c->prev->rgba[i];
130 xy_curr[1] =
c->rgba[i];
131 xy_next[1] =
c->next->rgba[i];
136 const float xpc =
c->prev->pos -
c->pos;
137 const float xnc =
c->next->pos -
c->pos;
138 for (
int i = 0; i < 4; i++) {
139 const float ycn =
c->rgba[i] -
c->next->rgba[i];
140 const float ypc =
c->prev->rgba[i] -
c->rgba[i];
141 area +=
fabsf((xpc * ycn) + (ypc * xnc));
150 const float gaussfac = 1.6f;
151 const float two_gaussfac2 = 2.0f * gaussfac * gaussfac;
152 x *= 3.0f * gaussfac;
153 return 1.0f /
sqrtf((
float)
M_PI * two_gaussfac2) *
expf(-
x *
x / two_gaussfac2);
157 const float (*
array)[4],
162 const float eps_2x = ((1.0f / 255.0f) + 1e-6f);
164 int carr_len = array_len;
167 const float step_size = 1.0f / (
float)(array_len - 1);
168 for (
int i = 0; i < array_len; i++,
c++) {
172 c->pos = i * step_size;
181 for (
int i = 0; i < array_len; i++,
c++) {
195 c_prev->next = c_next;
196 c_next->
prev = c_prev;
202 for (
int i = 0; i < 2; i++) {
222 if (filter_samples ==
false) {
223 for (
c = carr;
c !=
NULL;
c =
c->next, i++) {
230 for (
c = carr;
c !=
NULL;
c =
c->next, i++) {
231 const int steps_prev =
c->prev ? (
c -
c->prev) - 1 : 0;
232 const int steps_next =
c->next ? (
c->next -
c) - 1 : 0;
233 if (steps_prev == 0 && steps_next == 0) {
238 float rgba_accum = 1;
242 const float step_size = 1.0 / (
float)(steps_prev + 1);
245 const float step_pos = (
float)j * step_size;
246 BLI_assert(step_pos > 0.0f && step_pos < 1.0f);
253 const float step_size = 1.0 / (
float)(steps_next + 1);
256 const float step_pos = (
float)j * step_size;
257 BLI_assert(step_pos > 0.0f && step_pos < 1.0f);
278 const float (*
array)[4],
309 const int ipotype_hue,
const float mfac,
const float fac,
float h1,
float h2)
314 #define HUE_INTERP(h_a, h_b) ((mfac * (h_a)) + (fac * (h_b)))
315 #define HUE_MOD(h) (((h) < 1.0f) ? (h) : (h)-1.0f)
323 switch (ipotype_hue) {
325 if ((h1 < h2) && (h2 - h1) > +0.5f) {
328 else if ((h1 > h2) && (h2 - h1) < -0.5f) {
341 else if ((h1 < h2) && (h2 - h1) < +0.5f) {
344 else if ((h1 > h2) && (h2 - h1) > -0.5f) {
386 BLI_assert(h_interp >= 0.0f && h_interp < 1.0f);
396 const CBData *cbd1, *cbd2, *cbd0, *cbd3;
401 if (coba ==
NULL || coba->
tot == 0) {
412 if (coba->
tot == 1) {
418 else if ((in <= cbd1->
pos) &&
430 for (
a = 0;
a < coba->
tot;
a++, cbd1++) {
431 if (cbd1->
pos > in) {
436 if (
a == coba->
tot) {
451 if ((
a == coba->
tot) &&
467 if (cbd2->
pos != cbd1->
pos) {
468 fac = (in - cbd1->
pos) / (cbd2->
pos - cbd1->
pos);
473 fac = (
a != coba->
tot) ? 0.0f : 1.0f;
480 if (
a >= coba->
tot - 1) {
493 CLAMP(fac, 0.0f, 1.0f);
502 out[0] =
t[3] * cbd3->
r +
t[2] * cbd2->
r +
t[1] * cbd1->
r +
t[0] * cbd0->
r;
503 out[1] =
t[3] * cbd3->
g +
t[2] * cbd2->
g +
t[1] * cbd1->
g +
t[0] * cbd0->
g;
504 out[2] =
t[3] * cbd3->
b +
t[2] * cbd2->
b +
t[1] * cbd1->
b +
t[0] * cbd0->
b;
505 out[3] =
t[3] * cbd3->
a +
t[2] * cbd2->
a +
t[1] * cbd1->
a +
t[0] * cbd0->
a;
510 const float fac2 = fac * fac;
511 fac = 3.0f * fac2 - 2.0f * fac2 * fac;
513 const float mfac = 1.0f - fac;
516 float col1[3], col2[3];
522 out[1] = mfac * col1[1] + fac * col2[1];
523 out[2] = mfac * col1[2] + fac * col2[2];
524 out[3] = mfac * cbd1->
a + fac * cbd2->
a;
529 float col1[3], col2[3];
535 out[1] = mfac * col1[1] + fac * col2[1];
536 out[2] = mfac * col1[2] + fac * col2[2];
537 out[3] = mfac * cbd1->
a + fac * cbd2->
a;
543 out[0] = mfac * cbd1->
r + fac * cbd2->
r;
544 out[1] = mfac * cbd1->
g + fac * cbd2->
g;
545 out[2] = mfac * cbd1->
b + fac * cbd2->
b;
546 out[3] = mfac * cbd1->
a + fac * cbd2->
a;
571 if (x1->
pos >
x2->pos) {
574 if (x1->
pos <
x2->pos) {
588 for (
a = 0;
a < coba->
tot;
a++) {
594 for (
a = 0;
a < coba->
tot;
a++) {
611 xnew->
pos = position;
613 if (coba->
tot != 0) {
621 coba->
cur = coba->
tot - 1;
634 if (index < 0 || index >= coba->
tot) {
639 for (
int a = index;
a < coba->
tot;
a++) {
typedef float(TangentPoint)[2]
void key_curve_position_weights(float t, float data[4], int type)
General operations, lookup, etc. for materials.
A min-heap / priority queue ADT.
void BLI_heap_free(Heap *heap, HeapFreeFP ptrfreefp) ATTR_NONNULL(1)
void void bool BLI_heap_is_empty(const Heap *heap) ATTR_NONNULL(1)
void * BLI_heap_pop_min(Heap *heap) ATTR_NONNULL(1)
float BLI_heap_top_value(const Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Heap * BLI_heap_new_ex(unsigned int reserve_num) ATTR_WARN_UNUSED_RESULT
void BLI_heap_node_value_update(Heap *heap, HeapNode *node, float value) ATTR_NONNULL(1
HeapNode * BLI_heap_insert(Heap *heap, float value, void *ptr) ATTR_NONNULL(1)
void void BLI_heap_remove(Heap *heap, HeapNode *node) ATTR_NONNULL(1
MINLINE int min_ii(int a, int b)
MINLINE int max_ii(int a, int b)
void hsv_to_rgb_v(const float hsv[3], float r_rgb[3])
void rgb_to_hsv_v(const float rgb[3], float r_hsv[3])
void hsl_to_rgb_v(const float hsl[3], float r_rgb[3])
void rgb_to_hsl_v(const float rgb[3], float r_hsl[3])
MINLINE float cross_tri_v2(const float v1[2], const float v2[2], const float v3[2])
MINLINE void copy_v4_v4(float r[4], const float a[4])
MINLINE void clamp_v4(float vec[4], float min, float max)
MINLINE void mul_v4_v4fl(float r[4], const float a[4], float f)
MINLINE void zero_v4(float r[4])
MINLINE void madd_v4_v4fl(float r[4], const float a[4], float f)
MINLINE void zero_v3(float r[3])
MINLINE bool compare_v4v4(const float a[4], const float b[4], float limit) ATTR_WARN_UNUSED_RESULT
@ COLBAND_INTERP_CONSTANT
@ COLBAND_INTERP_B_SPLINE
@ COLBAND_INTERP_CARDINAL
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble x2
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble right
_GL_VOID GLfloat value _GL_VOID_RET _GL_VOID const GLuint GLboolean *residences _GL_BOOL_RET _GL_VOID GLsizei GLfloat GLfloat GLfloat GLfloat const GLubyte *bitmap _GL_VOID_RET _GL_VOID GLenum const void *lists _GL_VOID_RET _GL_VOID const GLdouble *equation _GL_VOID_RET _GL_VOID GLdouble GLdouble blue _GL_VOID_RET _GL_VOID GLfloat GLfloat blue _GL_VOID_RET _GL_VOID GLint GLint blue _GL_VOID_RET _GL_VOID GLshort GLshort blue _GL_VOID_RET _GL_VOID GLubyte GLubyte blue _GL_VOID_RET _GL_VOID GLuint GLuint blue _GL_VOID_RET _GL_VOID GLushort GLushort blue _GL_VOID_RET _GL_VOID GLbyte GLbyte GLbyte alpha _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble alpha _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat alpha _GL_VOID_RET _GL_VOID GLint GLint GLint alpha _GL_VOID_RET _GL_VOID GLshort GLshort GLshort alpha _GL_VOID_RET _GL_VOID GLubyte GLubyte GLubyte alpha _GL_VOID_RET _GL_VOID GLuint GLuint GLuint alpha _GL_VOID_RET _GL_VOID GLushort GLushort GLushort alpha _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLint GLsizei GLsizei GLenum type _GL_VOID_RET _GL_VOID GLsizei GLenum GLenum const void *pixels _GL_VOID_RET _GL_VOID const void *pointer _GL_VOID_RET _GL_VOID GLdouble v _GL_VOID_RET _GL_VOID GLfloat v _GL_VOID_RET _GL_VOID GLint GLint i2 _GL_VOID_RET _GL_VOID GLint j _GL_VOID_RET _GL_VOID GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble GLdouble GLdouble zFar _GL_VOID_RET _GL_UINT GLdouble *equation _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLenum GLfloat *v _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLfloat *values _GL_VOID_RET _GL_VOID GLushort *values _GL_VOID_RET _GL_VOID GLenum GLfloat *params _GL_VOID_RET _GL_VOID GLenum GLdouble *params _GL_VOID_RET _GL_VOID GLenum GLint *params _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_BOOL GLfloat param _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLushort pattern _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLint GLdouble GLdouble GLint GLint const GLdouble *points _GL_VOID_RET _GL_VOID GLdouble GLdouble u2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLint GLdouble GLdouble v2 _GL_VOID_RET _GL_VOID GLenum GLfloat param _GL_VOID_RET _GL_VOID GLenum GLint param _GL_VOID_RET _GL_VOID GLenum mode _GL_VOID_RET _GL_VOID GLdouble GLdouble nz _GL_VOID_RET _GL_VOID GLfloat GLfloat nz _GL_VOID_RET _GL_VOID GLint GLint nz _GL_VOID_RET _GL_VOID GLshort GLshort nz _GL_VOID_RET _GL_VOID GLsizei const void *pointer _GL_VOID_RET _GL_VOID GLsizei const GLfloat *values _GL_VOID_RET _GL_VOID GLsizei const GLushort *values _GL_VOID_RET _GL_VOID GLint param _GL_VOID_RET _GL_VOID const GLuint const GLclampf *priorities _GL_VOID_RET _GL_VOID GLdouble y _GL_VOID_RET _GL_VOID GLfloat y _GL_VOID_RET _GL_VOID GLint y _GL_VOID_RET _GL_VOID GLshort y _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLfloat GLfloat z _GL_VOID_RET _GL_VOID GLint GLint z _GL_VOID_RET _GL_VOID GLshort GLshort z _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble w _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat w _GL_VOID_RET _GL_VOID GLint GLint GLint w _GL_VOID_RET _GL_VOID GLshort GLshort GLshort w _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble y2 _GL_VOID_RET _GL_VOID GLfloat GLfloat GLfloat y2 _GL_VOID_RET _GL_VOID GLint GLint GLint y2 _GL_VOID_RET _GL_VOID GLshort GLshort GLshort y2 _GL_VOID_RET _GL_VOID GLdouble GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLdouble GLdouble z _GL_VOID_RET _GL_VOID GLuint *buffer _GL_VOID_RET _GL_VOID GLdouble t _GL_VOID_RET _GL_VOID GLfloat t _GL_VOID_RET _GL_VOID GLint t _GL_VOID_RET _GL_VOID GLshort t _GL_VOID_RET _GL_VOID GLdouble t
Read Guarded memory(de)allocation.
Group Output data from inside of a node group A color picker Mix two input colors RGB to Convert a color s luminance to a grayscale value Generate a normal vector and a dot product Bright Control the brightness and contrast of the input color Vector Map an input vectors to used to fine tune the interpolation of the input Camera Retrieve information about the camera and how it relates to the current shading point s position CLAMP
static DBVT_INLINE btScalar size(const btDbvtVolume &a)
bool BKE_colorband_element_remove(struct ColorBand *coba, int index)
void BKE_colorband_evaluate_table_rgba(const ColorBand *coba, float **array, int *size)
ColorBand * BKE_colorband_add(bool rangetype)
void BKE_colorband_init_from_table_rgba(ColorBand *coba, const float(*array)[4], const int array_len, bool filter_samples)
static float colorband_hue_interp(const int ipotype_hue, const float mfac, const float fac, float h1, float h2)
static void colorband_init_from_table_rgba_resample(ColorBand *coba, const float(*array)[4], const int array_len, bool filter_samples)
void BKE_colorband_update_sort(ColorBand *coba)
bool BKE_colorband_evaluate(const ColorBand *coba, float in, float out[4])
#define HUE_INTERP(h_a, h_b)
static float color_sample_remove_cost(const struct ColorResampleElem *c)
static float filter_gauss(float x)
void BKE_colorband_init(ColorBand *coba, bool rangetype)
static int vergcband(const void *a1, const void *a2)
static void colorband_init_from_table_rgba_simple(ColorBand *coba, const float(*array)[4], const int array_len)
CBData * BKE_colorband_element_add(struct ColorBand *coba, float position)
void(* MEM_freeN)(void *vmemh)
void *(* MEM_callocN)(size_t len, const char *str)
void *(* MEM_mallocN)(size_t len, const char *str)
static void area(int d1, int d2, int e1, int e2, float weights[2])
static const pxr::TfToken out("out", pxr::TfToken::Immortal)
static const pxr::TfToken rgba("rgba", pxr::TfToken::Immortal)
struct ColorResampleElem * next
struct ColorResampleElem * prev