Blender  V3.3
colorband.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-or-later
2  * Copyright 2001-2002 NaN Holding BV. All rights reserved. */
3 
8 #include "MEM_guardedalloc.h"
9 
10 #include "BLI_heap.h"
11 #include "BLI_math.h"
12 #include "BLI_math_color.h"
13 #include "BLI_utildefines.h"
14 
15 #include "DNA_key_types.h"
16 #include "DNA_texture_types.h"
17 
18 #include "BKE_colorband.h"
19 #include "BKE_key.h"
20 #include "BKE_material.h"
21 
22 void BKE_colorband_init(ColorBand *coba, bool rangetype)
23 {
24  int a;
25 
26  coba->data[0].pos = 0.0;
27  coba->data[1].pos = 1.0;
28 
29  if (rangetype == 0) {
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;
34 
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;
39  }
40  else {
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;
45 
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;
50  }
51 
52  for (a = 2; a < MAXCOLORBAND; a++) {
53  coba->data[a].r = 0.5;
54  coba->data[a].g = 0.5;
55  coba->data[a].b = 0.5;
56  coba->data[a].a = 1.0;
57  coba->data[a].pos = 0.5;
58  }
59 
60  coba->tot = 2;
61  coba->cur = 0;
64 }
65 
67  const float (*array)[4],
68  const int array_len)
69 {
70  /* No Re-sample, just de-duplicate. */
71  const float eps = (1.0f / 255.0f) + 1e-6f;
72  BLI_assert(array_len < MAXCOLORBAND);
73  int stops = min_ii(MAXCOLORBAND, array_len);
74  if (stops) {
75  const float step_size = 1.0f / (float)max_ii(stops - 1, 1);
76  int i_curr = -1;
77  for (int i_step = 0; i_step < stops; i_step++) {
78  if ((i_curr != -1) && compare_v4v4(&coba->data[i_curr].r, array[i_step], eps)) {
79  continue;
80  }
81  i_curr += 1;
82  copy_v4_v4(&coba->data[i_curr].r, array[i_step]);
83  coba->data[i_curr].pos = i_step * step_size;
84  coba->data[i_curr].cur = i_curr;
85  }
86  coba->tot = i_curr + 1;
87  coba->cur = 0;
88  }
89  else {
90  /* coba is empty, set 1 black stop */
91  zero_v3(&coba->data[0].r);
92  coba->data[0].a = 1.0f;
93  coba->cur = 0;
94  coba->tot = 1;
95  }
96 }
97 
98 /* -------------------------------------------------------------------- */
110  float rgba[4];
111  float pos;
112 };
113 
117 static float color_sample_remove_cost(const struct ColorResampleElem *c)
118 {
119  if (c->next == NULL || c->prev == NULL) {
120  return -1.0f;
121  }
122  float area = 0.0f;
123 #if 0
124  float xy_prev[2], xy_curr[2], xy_next[2];
125  xy_prev[0] = c->prev->pos;
126  xy_curr[0] = c->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];
132  area += fabsf(cross_tri_v2(xy_prev, xy_curr, xy_next));
133  }
134 #else
135  /* Above logic, optimized (p: previous, c: current, n: next). */
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));
142  }
143 #endif
144  return area;
145 }
146 
147 /* TODO(campbell): create BLI_math_filter? */
148 static float filter_gauss(float x)
149 {
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);
154 }
155 
157  const float (*array)[4],
158  const int array_len,
159  bool filter_samples)
160 {
161  BLI_assert(array_len >= 2);
162  const float eps_2x = ((1.0f / 255.0f) + 1e-6f);
163  struct ColorResampleElem *c, *carr = MEM_mallocN(sizeof(*carr) * array_len, __func__);
164  int carr_len = array_len;
165  c = carr;
166  {
167  const float step_size = 1.0f / (float)(array_len - 1);
168  for (int i = 0; i < array_len; i++, c++) {
169  copy_v4_v4(carr[i].rgba, array[i]);
170  c->next = c + 1;
171  c->prev = c - 1;
172  c->pos = i * step_size;
173  }
174  }
175  carr[0].prev = NULL;
176  carr[array_len - 1].next = NULL;
177 
178  /* -2 to remove endpoints. */
179  Heap *heap = BLI_heap_new_ex(array_len - 2);
180  c = carr;
181  for (int i = 0; i < array_len; i++, c++) {
182  float cost = color_sample_remove_cost(c);
183  if (cost != -1.0f) {
184  c->node = BLI_heap_insert(heap, cost, c);
185  }
186  else {
187  c->node = NULL;
188  }
189  }
190 
191  while ((carr_len > 1 && !BLI_heap_is_empty(heap)) &&
192  ((carr_len >= MAXCOLORBAND) || (BLI_heap_top_value(heap) <= eps_2x))) {
193  c = BLI_heap_pop_min(heap);
194  struct ColorResampleElem *c_next = c->next, *c_prev = c->prev;
195  c_prev->next = c_next;
196  c_next->prev = c_prev;
197  /* Clear data (not essential, avoid confusion). */
198  c->prev = c->next = NULL;
199  c->node = NULL;
200 
201  /* Update adjacent */
202  for (int i = 0; i < 2; i++) {
203  struct ColorResampleElem *c_other = i ? c_next : c_prev;
204  if (c_other->node != NULL) {
205  const float cost = color_sample_remove_cost(c_other);
206  if (cost != -1.0) {
207  BLI_heap_node_value_update(heap, c_other->node, cost);
208  }
209  else {
210  BLI_heap_remove(heap, c_other->node);
211  c_other->node = NULL;
212  }
213  }
214  }
215  carr_len -= 1;
216  }
217  BLI_heap_free(heap, NULL);
218 
219  /* First member is never removed. */
220  int i = 0;
221  BLI_assert(carr_len < MAXCOLORBAND);
222  if (filter_samples == false) {
223  for (c = carr; c != NULL; c = c->next, i++) {
224  copy_v4_v4(&coba->data[i].r, c->rgba);
225  coba->data[i].pos = c->pos;
226  coba->data[i].cur = i;
227  }
228  }
229  else {
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) {
234  copy_v4_v4(&coba->data[i].r, c->rgba);
235  }
236  else {
237  float rgba[4];
238  float rgba_accum = 1;
239  copy_v4_v4(rgba, c->rgba);
240 
241  if (steps_prev) {
242  const float step_size = 1.0 / (float)(steps_prev + 1);
243  int j = steps_prev;
244  for (struct ColorResampleElem *c_other = c - 1; c_other != c->prev; c_other--, j--) {
245  const float step_pos = (float)j * step_size;
246  BLI_assert(step_pos > 0.0f && step_pos < 1.0f);
247  const float f = filter_gauss(step_pos);
248  madd_v4_v4fl(rgba, c_other->rgba, f);
249  rgba_accum += f;
250  }
251  }
252  if (steps_next) {
253  const float step_size = 1.0 / (float)(steps_next + 1);
254  int j = steps_next;
255  for (struct ColorResampleElem *c_other = c + 1; c_other != c->next; c_other++, j--) {
256  const float step_pos = (float)j * step_size;
257  BLI_assert(step_pos > 0.0f && step_pos < 1.0f);
258  const float f = filter_gauss(step_pos);
259  madd_v4_v4fl(rgba, c_other->rgba, f);
260  rgba_accum += f;
261  }
262  }
263 
264  mul_v4_v4fl(&coba->data[i].r, rgba, 1.0f / rgba_accum);
265  }
266  coba->data[i].pos = c->pos;
267  coba->data[i].cur = i;
268  }
269  }
270  BLI_assert(i == carr_len);
271  coba->tot = i;
272  coba->cur = 0;
273 
274  MEM_freeN(carr);
275 }
276 
278  const float (*array)[4],
279  const int array_len,
280  bool filter_samples)
281 {
282  /* NOTE: we could use MAXCOLORBAND here, but results of re-sampling are nicer,
283  * avoid different behavior when limit is hit. */
284  if (array_len < 2) {
285  /* No Re-sample, just de-duplicate. */
287  }
288  else {
289  /* Re-sample */
290  colorband_init_from_table_rgba_resample(coba, array, array_len, filter_samples);
291  }
292 }
293 
296 ColorBand *BKE_colorband_add(bool rangetype)
297 {
298  ColorBand *coba;
299 
300  coba = MEM_callocN(sizeof(ColorBand), "colorband");
301  BKE_colorband_init(coba, rangetype);
302 
303  return coba;
304 }
305 
306 /* ------------------------------------------------------------------------- */
307 
308 static float colorband_hue_interp(
309  const int ipotype_hue, const float mfac, const float fac, float h1, float h2)
310 {
311  float h_interp;
312  int mode = 0;
313 
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)
316 
317  h1 = HUE_MOD(h1);
318  h2 = HUE_MOD(h2);
319 
320  BLI_assert(h1 >= 0.0f && h1 < 1.0f);
321  BLI_assert(h2 >= 0.0f && h2 < 1.0f);
322 
323  switch (ipotype_hue) {
324  case COLBAND_HUE_NEAR: {
325  if ((h1 < h2) && (h2 - h1) > +0.5f) {
326  mode = 1;
327  }
328  else if ((h1 > h2) && (h2 - h1) < -0.5f) {
329  mode = 2;
330  }
331  else {
332  mode = 0;
333  }
334  break;
335  }
336  case COLBAND_HUE_FAR: {
337  /* Do full loop in Hue space in case both stops are the same... */
338  if (h1 == h2) {
339  mode = 1;
340  }
341  else if ((h1 < h2) && (h2 - h1) < +0.5f) {
342  mode = 1;
343  }
344  else if ((h1 > h2) && (h2 - h1) > -0.5f) {
345  mode = 2;
346  }
347  else {
348  mode = 0;
349  }
350  break;
351  }
352  case COLBAND_HUE_CCW: {
353  if (h1 > h2) {
354  mode = 2;
355  }
356  else {
357  mode = 0;
358  }
359  break;
360  }
361  case COLBAND_HUE_CW: {
362  if (h1 < h2) {
363  mode = 1;
364  }
365  else {
366  mode = 0;
367  }
368  break;
369  }
370  }
371 
372  switch (mode) {
373  case 0:
374  h_interp = HUE_INTERP(h1, h2);
375  break;
376  case 1:
377  h_interp = HUE_INTERP(h1 + 1.0f, h2);
378  h_interp = HUE_MOD(h_interp);
379  break;
380  case 2:
381  h_interp = HUE_INTERP(h1, h2 + 1.0f);
382  h_interp = HUE_MOD(h_interp);
383  break;
384  }
385 
386  BLI_assert(h_interp >= 0.0f && h_interp < 1.0f);
387 
388 #undef HUE_INTERP
389 #undef HUE_MOD
390 
391  return h_interp;
392 }
393 
394 bool BKE_colorband_evaluate(const ColorBand *coba, float in, float out[4])
395 {
396  const CBData *cbd1, *cbd2, *cbd0, *cbd3;
397  float fac;
398  int ipotype;
399  int a;
400 
401  if (coba == NULL || coba->tot == 0) {
402  return false;
403  }
404 
405  cbd1 = coba->data;
406 
407  /* NOTE: when ipotype >= COLBAND_INTERP_B_SPLINE,
408  * we cannot do early-out with a constant color before first color stop and after last one,
409  * because interpolation starts before and ends after those... */
410  ipotype = (coba->color_mode == COLBAND_BLEND_RGB) ? coba->ipotype : COLBAND_INTERP_LINEAR;
411 
412  if (coba->tot == 1) {
413  out[0] = cbd1->r;
414  out[1] = cbd1->g;
415  out[2] = cbd1->b;
416  out[3] = cbd1->a;
417  }
418  else if ((in <= cbd1->pos) &&
420  /* We are before first color stop. */
421  out[0] = cbd1->r;
422  out[1] = cbd1->g;
423  out[2] = cbd1->b;
424  out[3] = cbd1->a;
425  }
426  else {
427  CBData left, right;
428 
429  /* we're looking for first pos > in */
430  for (a = 0; a < coba->tot; a++, cbd1++) {
431  if (cbd1->pos > in) {
432  break;
433  }
434  }
435 
436  if (a == coba->tot) {
437  cbd2 = cbd1 - 1;
438  right = *cbd2;
439  right.pos = 1.0f;
440  cbd1 = &right;
441  }
442  else if (a == 0) {
443  left = *cbd1;
444  left.pos = 0.0f;
445  cbd2 = &left;
446  }
447  else {
448  cbd2 = cbd1 - 1;
449  }
450 
451  if ((a == coba->tot) &&
453  /* We are after last color stop. */
454  out[0] = cbd2->r;
455  out[1] = cbd2->g;
456  out[2] = cbd2->b;
457  out[3] = cbd2->a;
458  }
459  else if (ipotype == COLBAND_INTERP_CONSTANT) {
460  /* constant */
461  out[0] = cbd2->r;
462  out[1] = cbd2->g;
463  out[2] = cbd2->b;
464  out[3] = cbd2->a;
465  }
466  else {
467  if (cbd2->pos != cbd1->pos) {
468  fac = (in - cbd1->pos) / (cbd2->pos - cbd1->pos);
469  }
470  else {
471  /* was setting to 0.0 in 2.56 & previous, but this
472  * is incorrect for the last element, see T26732. */
473  fac = (a != coba->tot) ? 0.0f : 1.0f;
474  }
475 
477  /* Interpolate from right to left: `3 2 1 0`. */
478  float t[4];
479 
480  if (a >= coba->tot - 1) {
481  cbd0 = cbd1;
482  }
483  else {
484  cbd0 = cbd1 + 1;
485  }
486  if (a < 2) {
487  cbd3 = cbd2;
488  }
489  else {
490  cbd3 = cbd2 - 1;
491  }
492 
493  CLAMP(fac, 0.0f, 1.0f);
494 
495  if (ipotype == COLBAND_INTERP_CARDINAL) {
497  }
498  else {
500  }
501 
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;
506  clamp_v4(out, 0.0f, 1.0f);
507  }
508  else {
509  if (ipotype == COLBAND_INTERP_EASE) {
510  const float fac2 = fac * fac;
511  fac = 3.0f * fac2 - 2.0f * fac2 * fac;
512  }
513  const float mfac = 1.0f - fac;
514 
515  if (UNLIKELY(coba->color_mode == COLBAND_BLEND_HSV)) {
516  float col1[3], col2[3];
517 
518  rgb_to_hsv_v(&cbd1->r, col1);
519  rgb_to_hsv_v(&cbd2->r, col2);
520 
521  out[0] = colorband_hue_interp(coba->ipotype_hue, mfac, fac, col1[0], col2[0]);
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;
525 
526  hsv_to_rgb_v(out, out);
527  }
528  else if (UNLIKELY(coba->color_mode == COLBAND_BLEND_HSL)) {
529  float col1[3], col2[3];
530 
531  rgb_to_hsl_v(&cbd1->r, col1);
532  rgb_to_hsl_v(&cbd2->r, col2);
533 
534  out[0] = colorband_hue_interp(coba->ipotype_hue, mfac, fac, col1[0], col2[0]);
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;
538 
539  hsl_to_rgb_v(out, out);
540  }
541  else {
542  /* COLBAND_BLEND_RGB */
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;
547  }
548  }
549  }
550  }
551 
552  return true; /* OK */
553 }
554 
555 void BKE_colorband_evaluate_table_rgba(const ColorBand *coba, float **array, int *size)
556 {
557  int a;
558 
559  *size = CM_TABLE + 1;
560  *array = MEM_callocN(sizeof(float) * (*size) * 4, "ColorBand");
561 
562  for (a = 0; a < *size; a++) {
563  BKE_colorband_evaluate(coba, (float)a / (float)CM_TABLE, &(*array)[a * 4]);
564  }
565 }
566 
567 static int vergcband(const void *a1, const void *a2)
568 {
569  const CBData *x1 = a1, *x2 = a2;
570 
571  if (x1->pos > x2->pos) {
572  return 1;
573  }
574  if (x1->pos < x2->pos) {
575  return -1;
576  }
577  return 0;
578 }
579 
581 {
582  int a;
583 
584  if (coba->tot < 2) {
585  return;
586  }
587 
588  for (a = 0; a < coba->tot; a++) {
589  coba->data[a].cur = a;
590  }
591 
592  qsort(coba->data, coba->tot, sizeof(CBData), vergcband);
593 
594  for (a = 0; a < coba->tot; a++) {
595  if (coba->data[a].cur == coba->cur) {
596  coba->cur = a;
597  break;
598  }
599  }
600 }
601 
602 CBData *BKE_colorband_element_add(struct ColorBand *coba, float position)
603 {
604  if (coba->tot == MAXCOLORBAND) {
605  return NULL;
606  }
607 
608  CBData *xnew;
609 
610  xnew = &coba->data[coba->tot];
611  xnew->pos = position;
612 
613  if (coba->tot != 0) {
614  BKE_colorband_evaluate(coba, position, &xnew->r);
615  }
616  else {
617  zero_v4(&xnew->r);
618  }
619 
620  coba->tot++;
621  coba->cur = coba->tot - 1;
622 
624 
625  return coba->data + coba->cur;
626 }
627 
628 bool BKE_colorband_element_remove(struct ColorBand *coba, int index)
629 {
630  if (coba->tot < 2) {
631  return false;
632  }
633 
634  if (index < 0 || index >= coba->tot) {
635  return false;
636  }
637 
638  coba->tot--;
639  for (int a = index; a < coba->tot; a++) {
640  coba->data[a] = coba->data[a + 1];
641  }
642  if (coba->cur) {
643  coba->cur--;
644  }
645  return true;
646 }
typedef float(TangentPoint)[2]
#define MAXCOLORBAND
Definition: BKE_colorband.h:16
void key_curve_position_weights(float t, float data[4], int type)
Definition: key.c:336
General operations, lookup, etc. for materials.
#define BLI_assert(a)
Definition: BLI_assert.h:46
A min-heap / priority queue ADT.
void BLI_heap_free(Heap *heap, HeapFreeFP ptrfreefp) ATTR_NONNULL(1)
Definition: BLI_heap.c:202
void void bool BLI_heap_is_empty(const Heap *heap) ATTR_NONNULL(1)
Definition: BLI_heap.c:279
void * BLI_heap_pop_min(Heap *heap) ATTR_NONNULL(1)
Definition: BLI_heap.c:301
float BLI_heap_top_value(const Heap *heap) ATTR_WARN_UNUSED_RESULT ATTR_NONNULL(1)
Definition: BLI_heap.c:294
Heap * BLI_heap_new_ex(unsigned int reserve_num) ATTR_WARN_UNUSED_RESULT
Definition: BLI_heap.c:182
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)
Definition: BLI_heap.c:245
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)
#define M_PI
Definition: BLI_math_base.h:20
void hsv_to_rgb_v(const float hsv[3], float r_rgb[3])
Definition: math_color.c:49
void rgb_to_hsv_v(const float rgb[3], float r_hsv[3])
Definition: math_color.c:232
void hsl_to_rgb_v(const float hsl[3], float r_rgb[3])
Definition: math_color.c:54
void rgb_to_hsl_v(const float rgb[3], float r_hsl[3])
Definition: math_color.c:292
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
#define UNLIKELY(x)
#define ELEM(...)
#define CM_TABLE
@ KEY_CARDINAL
@ KEY_BSPLINE
@ COLBAND_BLEND_RGB
@ COLBAND_BLEND_HSL
@ COLBAND_BLEND_HSV
@ COLBAND_HUE_FAR
@ COLBAND_HUE_CW
@ COLBAND_HUE_NEAR
@ COLBAND_HUE_CCW
@ COLBAND_INTERP_LINEAR
@ COLBAND_INTERP_CONSTANT
@ COLBAND_INTERP_B_SPLINE
@ COLBAND_INTERP_EASE
@ 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)
Definition: btDbvt.cpp:52
bool BKE_colorband_element_remove(struct ColorBand *coba, int index)
Definition: colorband.c:628
void BKE_colorband_evaluate_table_rgba(const ColorBand *coba, float **array, int *size)
Definition: colorband.c:555
ColorBand * BKE_colorband_add(bool rangetype)
Definition: colorband.c:296
void BKE_colorband_init_from_table_rgba(ColorBand *coba, const float(*array)[4], const int array_len, bool filter_samples)
Definition: colorband.c:277
static float colorband_hue_interp(const int ipotype_hue, const float mfac, const float fac, float h1, float h2)
Definition: colorband.c:308
static void colorband_init_from_table_rgba_resample(ColorBand *coba, const float(*array)[4], const int array_len, bool filter_samples)
Definition: colorband.c:156
void BKE_colorband_update_sort(ColorBand *coba)
Definition: colorband.c:580
bool BKE_colorband_evaluate(const ColorBand *coba, float in, float out[4])
Definition: colorband.c:394
#define HUE_INTERP(h_a, h_b)
static float color_sample_remove_cost(const struct ColorResampleElem *c)
Definition: colorband.c:117
static float filter_gauss(float x)
Definition: colorband.c:148
#define HUE_MOD(h)
void BKE_colorband_init(ColorBand *coba, bool rangetype)
Definition: colorband.c:22
static int vergcband(const void *a1, const void *a2)
Definition: colorband.c:567
static void colorband_init_from_table_rgba_simple(ColorBand *coba, const float(*array)[4], const int array_len)
Definition: colorband.c:66
CBData * BKE_colorband_element_add(struct ColorBand *coba, float position)
Definition: colorband.c:602
#define expf(x)
Definition: cuda/compat.h:106
uint pos
void(* MEM_freeN)(void *vmemh)
Definition: mallocn.c:27
void *(* MEM_callocN)(size_t len, const char *str)
Definition: mallocn.c:31
void *(* MEM_mallocN)(size_t len, const char *str)
Definition: mallocn.c:33
static int left
#define fabsf(x)
Definition: metal/compat.h:219
#define sqrtf(x)
Definition: metal/compat.h:243
static unsigned c
Definition: RandGen.cpp:83
static unsigned a[3]
Definition: RandGen.cpp:78
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)
const btScalar eps
Definition: poly34.cpp:11
CBData data[32]
struct ColorResampleElem * next
Definition: colorband.c:108
HeapNode * node
Definition: colorband.c:109
struct ColorResampleElem * prev
Definition: colorband.c:108
Definition: BLI_heap.c:43