Blender V4.3
colorband.cc File Reference
#include "MEM_guardedalloc.h"
#include "BLI_heap.h"
#include "BLI_math_color.h"
#include "BLI_math_vector.h"
#include "BLI_utildefines.h"
#include "DNA_key_types.h"
#include "DNA_texture_types.h"
#include "BKE_colorband.hh"
#include "BKE_key.hh"

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)
 
ColorBandBKE_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)
 
CBDataBKE_colorband_element_add (ColorBand *coba, float position)
 
bool BKE_colorband_element_remove (ColorBand *coba, int index)
 
Color Ramp Re-Sample
static float color_sample_remove_cost (const 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)
 

Macro Definition Documentation

◆ HUE_INTERP

#define HUE_INTERP ( h_a,
h_b )   ((mfac * (h_a)) + (fac * (h_b)))

Referenced by colorband_hue_interp().

◆ HUE_MOD

#define HUE_MOD ( h)    (((h) < 1.0f) ? (h) : (h)-1.0f)

Referenced by colorband_hue_interp().

Function Documentation

◆ BKE_colorband_add()

◆ BKE_colorband_element_add()

CBData * BKE_colorband_element_add ( ColorBand * coba,
float position )

◆ BKE_colorband_element_remove()

bool BKE_colorband_element_remove ( ColorBand * coba,
int index )

Definition at line 632 of file colorband.cc.

References ColorBand::cur, ColorBand::data, and ColorBand::tot.

Referenced by colorband_buttons_layout().

◆ BKE_colorband_evaluate()

◆ BKE_colorband_evaluate_table_rgba()

◆ BKE_colorband_init()

◆ BKE_colorband_init_from_table_rgba()

void BKE_colorband_init_from_table_rgba ( ColorBand * coba,
const float(*) array[4],
const int array_len,
bool filter_samples )

◆ BKE_colorband_update_sort()

void BKE_colorband_update_sort ( ColorBand * coba)

◆ color_sample_remove_cost()

static float color_sample_remove_cost ( const ColorResampleElem * c)
static

Measure the 'area' of each channel and combine to use as a cost for this samples removal.

Definition at line 117 of file colorband.cc.

References cross_tri_v2(), fabsf, ColorResampleElem::next, ColorResampleElem::pos, ColorResampleElem::prev, and ColorResampleElem::rgba.

Referenced by colorband_init_from_table_rgba_resample().

◆ colorband_hue_interp()

static float colorband_hue_interp ( const int ipotype_hue,
const float mfac,
const float fac,
float h1,
float h2 )
static

◆ colorband_init_from_table_rgba_resample()

◆ colorband_init_from_table_rgba_simple()

static void colorband_init_from_table_rgba_simple ( ColorBand * coba,
const float(*) array[4],
const int array_len )
static

◆ filter_gauss()

static float filter_gauss ( float x)
static

Definition at line 148 of file colorband.cc.

References expf, M_PI, and sqrtf.

Referenced by colorband_init_from_table_rgba_resample().

◆ vergcband()

static int vergcband ( const void * a1,
const void * a2 )
static

Definition at line 571 of file colorband.cc.

References CBData::pos.

Referenced by BKE_colorband_update_sort().