|
Blender
V2.93
|
#include "MEM_guardedalloc.h"#include "BLI_heap.h"#include "BLI_math.h"#include "BLI_math_color.h"#include "BLI_utildefines.h"#include "DNA_key_types.h"#include "DNA_texture_types.h"#include "BKE_colorband.h"#include "BKE_key.h"#include "BKE_material.h"Go to the source code of this file.
Classes | |
| struct | ColorResampleElem |
Macros | |
| #define | HUE_INTERP(h_a, h_b) ((mfac * (h_a)) + (fac * (h_b))) |
| #define | HUE_MOD(h) (((h) < 1.0f) ? (h) : (h)-1.0f) |
Functions | |
| void | BKE_colorband_init (ColorBand *coba, bool rangetype) |
| static void | colorband_init_from_table_rgba_simple (ColorBand *coba, const float(*array)[4], const int array_len) |
| ColorBand * | BKE_colorband_add (bool rangetype) |
| static float | colorband_hue_interp (const int ipotype_hue, const float mfac, const float fac, float h1, float h2) |
| bool | BKE_colorband_evaluate (const ColorBand *coba, float in, float out[4]) |
| void | BKE_colorband_evaluate_table_rgba (const ColorBand *coba, float **array, int *size) |
| static int | vergcband (const void *a1, const void *a2) |
| void | BKE_colorband_update_sort (ColorBand *coba) |
| CBData * | BKE_colorband_element_add (struct ColorBand *coba, float position) |
| bool | BKE_colorband_element_remove (struct ColorBand *coba, int index) |
Color Ramp Re-Sample | |
Local functions for BKE_colorband_init_from_table_rgba | |
| static float | color_sample_remove_cost (const struct ColorResampleElem *c) |
| static float | filter_gauss (float x) |
| static void | colorband_init_from_table_rgba_resample (ColorBand *coba, const float(*array)[4], const int array_len, bool filter_samples) |
| void | BKE_colorband_init_from_table_rgba (ColorBand *coba, const float(*array)[4], const int array_len, bool filter_samples) |
| #define HUE_INTERP | ( | h_a, | |
| h_b | |||
| ) | ((mfac * (h_a)) + (fac * (h_b))) |
| #define HUE_MOD | ( | h | ) | (((h) < 1.0f) ? (h) : (h)-1.0f) |
| ColorBand* BKE_colorband_add | ( | bool | rangetype | ) |
Definition at line 312 of file colorband.c.
References BKE_colorband_init(), and MEM_callocN.
Referenced by BKE_linestyle_color_modifier_add(), BKE_texture_pointdensity_init_data(), dynamicPaint_createType(), initData(), node_composit_init_valtorgb(), node_shader_init_valtorgb(), and valtorgb_init().
Definition at line 618 of file colorband.c.
References BKE_colorband_evaluate(), BKE_colorband_update_sort(), ColorBand::cur, ColorBand::data, MAXCOLORBAND, NULL, CBData::pos, CBData::r, ColorBand::tot, and zero_v4().
Referenced by colorband_add_cb(), and ui_do_but_COLORBAND().
| bool BKE_colorband_element_remove | ( | struct ColorBand * | coba, |
| int | index | ||
| ) |
Definition at line 644 of file colorband.c.
References Freestyle::a, ColorBand::cur, ColorBand::data, and ColorBand::tot.
Referenced by colorband_del_cb().
Definition at line 410 of file colorband.c.
References Freestyle::a, CBData::a, CBData::b, CLAMP, clamp_v4(), COLBAND_BLEND_HSL, COLBAND_BLEND_HSV, COLBAND_BLEND_RGB, COLBAND_INTERP_B_SPLINE, COLBAND_INTERP_CARDINAL, COLBAND_INTERP_CONSTANT, COLBAND_INTERP_EASE, COLBAND_INTERP_LINEAR, ColorBand::color_mode, colorband_hue_interp(), ColorBand::data, ELEM, CBData::g, hsl_to_rgb_v(), hsv_to_rgb_v(), if(), ColorBand::ipotype, ColorBand::ipotype_hue, KEY_BSPLINE, KEY_CARDINAL, key_curve_position_weights(), left, NULL, pos, CBData::pos, CBData::r, rgb_to_hsl_v(), rgb_to_hsv_v(), right, t, ColorBand::tot, and UNLIKELY.
Referenced by BKE_colorband_element_add(), and BKE_colorband_evaluate_table_rgba().
Definition at line 571 of file colorband.c.
References Freestyle::a, BKE_colorband_evaluate(), CM_TABLE, MEM_callocN, and size().
| void BKE_colorband_init | ( | ColorBand * | coba, |
| bool | rangetype | ||
| ) |
Definition at line 38 of file colorband.c.
References Freestyle::a, CBData::a, CBData::b, COLBAND_BLEND_RGB, COLBAND_INTERP_LINEAR, ColorBand::color_mode, ColorBand::cur, ColorBand::data, CBData::g, ColorBand::ipotype, MAXCOLORBAND, CBData::pos, CBData::r, and ColorBand::tot.
Referenced by BKE_blendfile_userdef_from_defaults(), BKE_colorband_add(), BKE_texture_colormapping_default(), blo_do_versions_userdef(), colorband_tools_dofunc(), blender::nodes::geo_node_attribute_color_ramp_init(), and initData().
| void BKE_colorband_init_from_table_rgba | ( | ColorBand * | coba, |
| const float(*) | array[4], | ||
| const int | array_len, | ||
| bool | filter_samples | ||
| ) |
Definition at line 293 of file colorband.c.
References colorband_init_from_table_rgba_resample(), and colorband_init_from_table_rgba_simple().
Referenced by eyedropper_colorband_apply().
| void BKE_colorband_update_sort | ( | ColorBand * | coba | ) |
Definition at line 596 of file colorband.c.
References Freestyle::a, CBData::cur, ColorBand::cur, ColorBand::data, ColorBand::tot, and vergcband().
Referenced by BKE_colorband_element_add(), colorband_update_cb(), ui_do_but_COLORBAND(), and ui_numedit_but_COLORBAND().
|
static |
Measure the 'area' of each channel and combine to use as a cost for this samples removal.
Definition at line 133 of file colorband.c.
References blender::compositor::area(), Freestyle::c, cross_tri_v2(), fabsf, and NULL.
Referenced by colorband_init_from_table_rgba_resample().
|
static |
Definition at line 324 of file colorband.c.
References BLI_assert, COLBAND_HUE_CCW, COLBAND_HUE_CW, COLBAND_HUE_FAR, COLBAND_HUE_NEAR, HUE_INTERP, and HUE_MOD.
Referenced by BKE_colorband_evaluate().
|
static |
Definition at line 172 of file colorband.c.
References BLI_assert, BLI_heap_free(), BLI_heap_insert(), BLI_heap_is_empty(), BLI_heap_new_ex(), BLI_heap_node_value_update(), BLI_heap_pop_min(), BLI_heap_remove(), BLI_heap_top_value(), Freestyle::c, color_sample_remove_cost(), copy_v4_v4(), CBData::cur, ColorBand::cur, ColorBand::data, filter_gauss(), float(), madd_v4_v4fl(), MAXCOLORBAND, MEM_freeN, MEM_mallocN, mul_v4_v4fl(), ColorResampleElem::next, ColorResampleElem::node, NULL, CBData::pos, ColorResampleElem::prev, CBData::r, ColorResampleElem::rgba, and ColorBand::tot.
Referenced by BKE_colorband_init_from_table_rgba().
|
static |
Definition at line 82 of file colorband.c.
References CBData::a, BLI_assert, compare_v4v4(), copy_v4_v4(), CBData::cur, ColorBand::cur, ColorBand::data, eps, float(), max_ii(), MAXCOLORBAND, min_ii(), CBData::pos, CBData::r, ColorBand::tot, and zero_v3().
Referenced by BKE_colorband_init_from_table_rgba().
Definition at line 164 of file colorband.c.
References expf, M_PI, sqrtf, and x.
Referenced by colorband_init_from_table_rgba_resample().
|
static |
Definition at line 583 of file colorband.c.
References CBData::pos, and x2.
Referenced by BKE_colorband_update_sort().