Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <ideasman42@gmail.com>2017-12-07 07:52:59 +0300
committerCampbell Barton <ideasman42@gmail.com>2017-12-07 07:52:59 +0300
commit2e2e6e3bdb694e56fcd161f06b6751e953cd2fa1 (patch)
treeda178a4ab2c3993a90750afef65a51ee460465de /source/blender/blenkernel
parentcc811d1fd63425e180ec50f7d13a0b9fe3a6e2eb (diff)
Cleanup: Use BKE_colorband prefix
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r--source/blender/blenkernel/BKE_colorband.h14
-rw-r--r--source/blender/blenkernel/intern/DerivedMesh.c2
-rw-r--r--source/blender/blenkernel/intern/colorband.c22
-rw-r--r--source/blender/blenkernel/intern/dynamicpaint.c10
-rw-r--r--source/blender/blenkernel/intern/linestyle.c16
-rw-r--r--source/blender/blenkernel/intern/texture.c4
6 files changed, 34 insertions, 34 deletions
diff --git a/source/blender/blenkernel/BKE_colorband.h b/source/blender/blenkernel/BKE_colorband.h
index 09ed9a60477..aa64e793331 100644
--- a/source/blender/blenkernel/BKE_colorband.h
+++ b/source/blender/blenkernel/BKE_colorband.h
@@ -35,13 +35,13 @@ struct ColorBand;
/* in ColorBand struct */
#define MAXCOLORBAND 32
-void init_colorband(struct ColorBand *coba, bool rangetype);
-struct ColorBand *add_colorband(bool rangetype);
-bool do_colorband(const struct ColorBand *coba, float in, float out[4]);
-void colorband_table_RGBA(struct ColorBand *coba, float **array, int *size);
-struct CBData *colorband_element_add(struct ColorBand *coba, float position);
-int colorband_element_remove(struct ColorBand *coba, int index);
-void colorband_update_sort(struct ColorBand *coba);
+void BKE_colorband_init(struct ColorBand *coba, bool rangetype);
+struct ColorBand *BKE_colorband_add(bool rangetype);
+bool BKE_colorband_evaluate(const struct ColorBand *coba, float in, float out[4]);
+void BKE_colorband_evaluate_table_rgba(const struct ColorBand *coba, float **array, int *size);
+struct CBData *BKE_colorband_element_add(struct ColorBand *coba, float position);
+int BKE_colorband_element_remove(struct ColorBand *coba, int index);
+void BKE_colorband_update_sort(struct ColorBand *coba);
#ifdef __cplusplus
}
diff --git a/source/blender/blenkernel/intern/DerivedMesh.c b/source/blender/blenkernel/intern/DerivedMesh.c
index b588cd07aec..7ccd00b3f62 100644
--- a/source/blender/blenkernel/intern/DerivedMesh.c
+++ b/source/blender/blenkernel/intern/DerivedMesh.c
@@ -1377,7 +1377,7 @@ static void weightpaint_color(unsigned char r_col[4], DMWeightColorInfo *dm_wcin
float colf[4];
if (dm_wcinfo && dm_wcinfo->coba) {
- do_colorband(dm_wcinfo->coba, input, colf);
+ BKE_colorband_evaluate(dm_wcinfo->coba, input, colf);
}
else {
weight_to_rgb(colf, input);
diff --git a/source/blender/blenkernel/intern/colorband.c b/source/blender/blenkernel/intern/colorband.c
index b1f6431019d..a9f4ae083d0 100644
--- a/source/blender/blenkernel/intern/colorband.c
+++ b/source/blender/blenkernel/intern/colorband.c
@@ -38,7 +38,7 @@
#include "BKE_material.h"
#include "BKE_key.h"
-void init_colorband(ColorBand *coba, bool rangetype)
+void BKE_colorband_init(ColorBand *coba, bool rangetype)
{
int a;
@@ -80,12 +80,12 @@ void init_colorband(ColorBand *coba, bool rangetype)
coba->color_mode = COLBAND_BLEND_RGB;
}
-ColorBand *add_colorband(bool rangetype)
+ColorBand *BKE_colorband_add(bool rangetype)
{
ColorBand *coba;
coba = MEM_callocN(sizeof(ColorBand), "colorband");
- init_colorband(coba, rangetype);
+ BKE_colorband_init(coba, rangetype);
return coba;
}
@@ -160,7 +160,7 @@ static float colorband_hue_interp(
return h_interp;
}
-bool do_colorband(const ColorBand *coba, float in, float out[4])
+bool BKE_colorband_evaluate(const ColorBand *coba, float in, float out[4])
{
const CBData *cbd1, *cbd2, *cbd0, *cbd3;
float fac;
@@ -310,7 +310,7 @@ bool do_colorband(const ColorBand *coba, float in, float out[4])
return true; /* OK */
}
-void colorband_table_RGBA(ColorBand *coba, float **array, int *size)
+void BKE_colorband_evaluate_table_rgba(const ColorBand *coba, float **array, int *size)
{
int a;
@@ -318,7 +318,7 @@ void colorband_table_RGBA(ColorBand *coba, float **array, int *size)
*array = MEM_callocN(sizeof(float) * (*size) * 4, "ColorBand");
for (a = 0; a < *size; a++)
- do_colorband(coba, (float)a / (float)CM_TABLE, &(*array)[a * 4]);
+ BKE_colorband_evaluate(coba, (float)a / (float)CM_TABLE, &(*array)[a * 4]);
}
static int vergcband(const void *a1, const void *a2)
@@ -330,7 +330,7 @@ static int vergcband(const void *a1, const void *a2)
return 0;
}
-void colorband_update_sort(ColorBand *coba)
+void BKE_colorband_update_sort(ColorBand *coba)
{
int a;
@@ -350,7 +350,7 @@ void colorband_update_sort(ColorBand *coba)
}
}
-CBData *colorband_element_add(struct ColorBand *coba, float position)
+CBData *BKE_colorband_element_add(struct ColorBand *coba, float position)
{
if (coba->tot == MAXCOLORBAND) {
return NULL;
@@ -362,7 +362,7 @@ CBData *colorband_element_add(struct ColorBand *coba, float position)
xnew->pos = position;
if (coba->tot != 0) {
- do_colorband(coba, position, &xnew->r);
+ BKE_colorband_evaluate(coba, position, &xnew->r);
}
else {
zero_v4(&xnew->r);
@@ -372,12 +372,12 @@ CBData *colorband_element_add(struct ColorBand *coba, float position)
coba->tot++;
coba->cur = coba->tot - 1;
- colorband_update_sort(coba);
+ BKE_colorband_update_sort(coba);
return coba->data + coba->cur;
}
-int colorband_element_remove(struct ColorBand *coba, int index)
+int BKE_colorband_element_remove(struct ColorBand *coba, int index)
{
int a;
diff --git a/source/blender/blenkernel/intern/dynamicpaint.c b/source/blender/blenkernel/intern/dynamicpaint.c
index b809e13d1a0..b44ee21432c 100644
--- a/source/blender/blenkernel/intern/dynamicpaint.c
+++ b/source/blender/blenkernel/intern/dynamicpaint.c
@@ -1092,7 +1092,7 @@ bool dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, str
{
CBData *ramp;
- brush->paint_ramp = add_colorband(false);
+ brush->paint_ramp = BKE_colorband_add(false);
if (!brush->paint_ramp)
return false;
ramp = brush->paint_ramp->data;
@@ -1108,7 +1108,7 @@ bool dynamicPaint_createType(struct DynamicPaintModifierData *pmd, int type, str
{
CBData *ramp;
- brush->vel_ramp = add_colorband(false);
+ brush->vel_ramp = BKE_colorband_add(false);
if (!brush->vel_ramp)
return false;
ramp = brush->vel_ramp->data;
@@ -3462,7 +3462,7 @@ static void dynamicPaint_updatePointData(
vel_factor /= brush->max_velocity;
CLAMP(vel_factor, 0.0f, 1.0f);
- if (do_colorband(brush->vel_ramp, vel_factor, coba_res)) {
+ if (BKE_colorband_evaluate(brush->vel_ramp, vel_factor, coba_res)) {
if (brush->flags & MOD_DPAINT_VELOCITY_COLOR) {
copy_v3_v3(paint, coba_res);
}
@@ -3908,7 +3908,7 @@ static void dynamic_paint_paint_mesh_cell_point_cb_ex(
else if (hit_found == HIT_PROXIMITY) {
/* apply falloff curve to the proximity_factor */
if (brush->proximity_falloff == MOD_DPAINT_PRFALL_RAMP &&
- do_colorband(brush->paint_ramp, (1.0f - proximity_factor), prox_colorband))
+ BKE_colorband_evaluate(brush->paint_ramp, (1.0f - proximity_factor), prox_colorband))
{
proximity_factor = prox_colorband[3];
}
@@ -4472,7 +4472,7 @@ static void dynamic_paint_paint_single_point_cb_ex(
/* color ramp */
if (brush->proximity_falloff == MOD_DPAINT_PRFALL_RAMP &&
- do_colorband(brush->paint_ramp, (1.0f - strength), colorband))
+ BKE_colorband_evaluate(brush->paint_ramp, (1.0f - strength), colorband))
{
strength = colorband[3];
}
diff --git a/source/blender/blenkernel/intern/linestyle.c b/source/blender/blenkernel/intern/linestyle.c
index 653b79709e6..0465c5d54f7 100644
--- a/source/blender/blenkernel/intern/linestyle.c
+++ b/source/blender/blenkernel/intern/linestyle.c
@@ -295,39 +295,39 @@ LineStyleModifier *BKE_linestyle_color_modifier_add(FreestyleLineStyle *linestyl
switch (type) {
case LS_MODIFIER_ALONG_STROKE:
- ((LineStyleColorModifier_AlongStroke *)m)->color_ramp = add_colorband(1);
+ ((LineStyleColorModifier_AlongStroke *)m)->color_ramp = BKE_colorband_add(true);
break;
case LS_MODIFIER_DISTANCE_FROM_CAMERA:
- ((LineStyleColorModifier_DistanceFromCamera *)m)->color_ramp = add_colorband(1);
+ ((LineStyleColorModifier_DistanceFromCamera *)m)->color_ramp = BKE_colorband_add(true);
((LineStyleColorModifier_DistanceFromCamera *)m)->range_min = 0.0f;
((LineStyleColorModifier_DistanceFromCamera *)m)->range_max = 10000.0f;
break;
case LS_MODIFIER_DISTANCE_FROM_OBJECT:
((LineStyleColorModifier_DistanceFromObject *)m)->target = NULL;
- ((LineStyleColorModifier_DistanceFromObject *)m)->color_ramp = add_colorband(1);
+ ((LineStyleColorModifier_DistanceFromObject *)m)->color_ramp = BKE_colorband_add(true);
((LineStyleColorModifier_DistanceFromObject *)m)->range_min = 0.0f;
((LineStyleColorModifier_DistanceFromObject *)m)->range_max = 10000.0f;
break;
case LS_MODIFIER_MATERIAL:
- ((LineStyleColorModifier_Material *)m)->color_ramp = add_colorband(1);
+ ((LineStyleColorModifier_Material *)m)->color_ramp = BKE_colorband_add(true);
((LineStyleColorModifier_Material *)m)->mat_attr = LS_MODIFIER_MATERIAL_LINE;
break;
case LS_MODIFIER_TANGENT:
- ((LineStyleColorModifier_Tangent *)m)->color_ramp = add_colorband(1);
+ ((LineStyleColorModifier_Tangent *)m)->color_ramp = BKE_colorband_add(true);
break;
case LS_MODIFIER_NOISE:
- ((LineStyleColorModifier_Noise *)m)->color_ramp = add_colorband(1);
+ ((LineStyleColorModifier_Noise *)m)->color_ramp = BKE_colorband_add(true);
((LineStyleColorModifier_Noise *)m)->amplitude = 10.0f;
((LineStyleColorModifier_Noise *)m)->period = 10.0f;
((LineStyleColorModifier_Noise *)m)->seed = 512;
break;
case LS_MODIFIER_CREASE_ANGLE:
- ((LineStyleColorModifier_CreaseAngle *)m)->color_ramp = add_colorband(1);
+ ((LineStyleColorModifier_CreaseAngle *)m)->color_ramp = BKE_colorband_add(true);
((LineStyleColorModifier_CreaseAngle *)m)->min_angle = 0.0f;
((LineStyleColorModifier_CreaseAngle *)m)->max_angle = DEG2RADF(180.0f);
break;
case LS_MODIFIER_CURVATURE_3D:
- ((LineStyleColorModifier_Curvature_3D *)m)->color_ramp = add_colorband(1);
+ ((LineStyleColorModifier_Curvature_3D *)m)->color_ramp = BKE_colorband_add(true);
((LineStyleColorModifier_Curvature_3D *)m)->min_curvature = 0.0f;
((LineStyleColorModifier_Curvature_3D *)m)->max_curvature = 0.5f;
break;
diff --git a/source/blender/blenkernel/intern/texture.c b/source/blender/blenkernel/intern/texture.c
index fc41815737d..fcedd880615 100644
--- a/source/blender/blenkernel/intern/texture.c
+++ b/source/blender/blenkernel/intern/texture.c
@@ -186,7 +186,7 @@ void BKE_texture_colormapping_default(ColorMapping *colormap)
{
memset(colormap, 0, sizeof(ColorMapping));
- init_colorband(&colormap->coba, true);
+ BKE_colorband_init(&colormap->coba, true);
colormap->bright = 1.0;
colormap->contrast = 1.0;
@@ -999,7 +999,7 @@ void BKE_texture_pointdensity_init_data(PointDensity *pd)
pd->noise_depth = 1;
pd->noise_fac = 1.0f;
pd->noise_influence = TEX_PD_NOISE_STATIC;
- pd->coba = add_colorband(true);
+ pd->coba = BKE_colorband_add(true);
pd->speed_scale = 1.0f;
pd->totpoints = 0;
pd->object = NULL;