Cleanup: use BKE_ prefix for BKE_colortools.h
authorCampbell Barton <ideasman42@gmail.com>
Tue, 6 Aug 2019 17:21:55 +0000 (03:21 +1000)
committerCampbell Barton <ideasman42@gmail.com>
Tue, 6 Aug 2019 17:38:01 +0000 (03:38 +1000)
62 files changed:
source/blender/blenkernel/BKE_colortools.h
source/blender/blenkernel/intern/brush.c
source/blender/blenkernel/intern/colortools.c
source/blender/blenkernel/intern/gpencil.c
source/blender/blenkernel/intern/light.c
source/blender/blenkernel/intern/linestyle.c
source/blender/blenkernel/intern/paint.c
source/blender/blenkernel/intern/particle.c
source/blender/blenkernel/intern/particle_child.c
source/blender/blenkernel/intern/particle_system.c
source/blender/blenkernel/intern/scene.c
source/blender/blenkernel/intern/seqmodifier.c
source/blender/blenkernel/intern/smoke.c
source/blender/blenkernel/intern/texture.c
source/blender/blenloader/intern/readfile.c
source/blender/blenloader/intern/versioning_250.c
source/blender/blenloader/intern/versioning_270.c
source/blender/blenloader/intern/versioning_280.c
source/blender/blenloader/intern/versioning_cycles.c
source/blender/blenloader/intern/versioning_defaults.c
source/blender/blenloader/intern/versioning_legacy.c
source/blender/compositor/nodes/COM_TimeNode.cpp
source/blender/compositor/operations/COM_ColorCurveOperation.cpp
source/blender/compositor/operations/COM_CurveBaseOperation.cpp
source/blender/compositor/operations/COM_HueSaturationValueCorrectOperation.cpp
source/blender/compositor/operations/COM_VectorCurveOperation.cpp
source/blender/editors/gpencil/gpencil_brush.c
source/blender/editors/gpencil/gpencil_interpolate.c
source/blender/editors/gpencil/gpencil_paint.c
source/blender/editors/gpencil/gpencil_primitive.c
source/blender/editors/gpencil/gpencil_utils.c
source/blender/editors/interface/interface_draw.c
source/blender/editors/interface/interface_handlers.c
source/blender/editors/interface/interface_templates.c
source/blender/editors/render/render_internal.c
source/blender/editors/sculpt_paint/paint_cursor.c
source/blender/editors/sculpt_paint/paint_image_proj.c
source/blender/editors/sculpt_paint/paint_stroke.c
source/blender/editors/sculpt_paint/paint_vertex_weight_ops.c
source/blender/editors/sculpt_paint/sculpt.c
source/blender/editors/sculpt_paint/sculpt_uv.c
source/blender/editors/space_image/image_edit.c
source/blender/editors/space_image/image_ops.c
source/blender/editors/space_image/space_image.c
source/blender/editors/transform/transform_conversions.c
source/blender/freestyle/intern/python/BPy_Freestyle.cpp
source/blender/gpencil_modifiers/intern/MOD_gpencilhook.c
source/blender/gpencil_modifiers/intern/MOD_gpencilthick.c
source/blender/imbuf/intern/colormanagement.c
source/blender/makesrna/intern/rna_color.c
source/blender/makesrna/intern/rna_scene.c
source/blender/modifiers/intern/MOD_hook.c
source/blender/modifiers/intern/MOD_warp.c
source/blender/modifiers/intern/MOD_weightvg_util.c
source/blender/modifiers/intern/MOD_weightvgedit.c
source/blender/nodes/composite/nodes/node_composite_curves.c
source/blender/nodes/composite/nodes/node_composite_huecorrect.c
source/blender/nodes/intern/node_util.c
source/blender/nodes/shader/nodes/node_shader_curves.c
source/blender/nodes/texture/nodes/node_texture_curves.c
source/blender/render/intern/source/pipeline.c
source/blender/render/intern/source/pointdensity.c

index a6eb12c37083e6297fc70dda3bb9e5c594c55354..643073b3470fa19e10ac8eeeb8698a9842da9999 100644 (file)
@@ -34,17 +34,19 @@ struct ImBuf;
 struct Scopes;
 struct rctf;
 
-void curvemapping_set_defaults(
+void BKE_curvemapping_set_defaults(
     struct CurveMapping *cumap, int tot, float minx, float miny, float maxx, float maxy);
-struct CurveMapping *curvemapping_add(int tot, float minx, float miny, float maxx, float maxy);
-void curvemapping_free_data(struct CurveMapping *cumap);
-void curvemapping_free(struct CurveMapping *cumap);
-void curvemapping_copy_data(struct CurveMapping *target, const struct CurveMapping *cumap);
-struct CurveMapping *curvemapping_copy(const struct CurveMapping *cumap);
-void curvemapping_set_black_white_ex(const float black[3], const float white[3], float r_bwmul[3]);
-void curvemapping_set_black_white(struct CurveMapping *cumap,
-                                  const float black[3],
-                                  const float white[3]);
+struct CurveMapping *BKE_curvemapping_add(int tot, float minx, float miny, float maxx, float maxy);
+void BKE_curvemapping_free_data(struct CurveMapping *cumap);
+void BKE_curvemapping_free(struct CurveMapping *cumap);
+void BKE_curvemapping_copy_data(struct CurveMapping *target, const struct CurveMapping *cumap);
+struct CurveMapping *BKE_curvemapping_copy(const struct CurveMapping *cumap);
+void BKE_curvemapping_set_black_white_ex(const float black[3],
+                                         const float white[3],
+                                         float r_bwmul[3]);
+void BKE_curvemapping_set_black_white(struct CurveMapping *cumap,
+                                      const float black[3],
+                                      const float white[3]);
 
 enum {
   CURVEMAP_SLOPE_NEGATIVE = 0,
@@ -52,56 +54,56 @@ enum {
   CURVEMAP_SLOPE_POS_NEG = 2,
 };
 
-void curvemap_reset(struct CurveMap *cuma, const struct rctf *clipr, int preset, int slope);
-void curvemap_remove(struct CurveMap *cuma, const short flag);
-bool curvemap_remove_point(struct CurveMap *cuma, struct CurveMapPoint *cmp);
-struct CurveMapPoint *curvemap_insert(struct CurveMap *cuma, float x, float y);
-void curvemap_handle_set(struct CurveMap *cuma, int type);
+void BKE_curvemap_reset(struct CurveMap *cuma, const struct rctf *clipr, int preset, int slope);
+void BKE_curvemap_remove(struct CurveMap *cuma, const short flag);
+bool BKE_curvemap_remove_point(struct CurveMap *cuma, struct CurveMapPoint *cmp);
+struct CurveMapPoint *BKE_curvemap_insert(struct CurveMap *cuma, float x, float y);
+void BKE_curvemap_handle_set(struct CurveMap *cuma, int type);
 
-void curvemapping_changed(struct CurveMapping *cumap, const bool rem_doubles);
-void curvemapping_changed_all(struct CurveMapping *cumap);
+void BKE_curvemapping_changed(struct CurveMapping *cumap, const bool rem_doubles);
+void BKE_curvemapping_changed_all(struct CurveMapping *cumap);
 
 /* call before _all_ evaluation functions */
-void curvemapping_initialize(struct CurveMapping *cumap);
+void BKE_curvemapping_initialize(struct CurveMapping *cumap);
 
 /* keep these (const CurveMap) - to help with thread safety */
 /* single curve, no table check */
-float curvemap_evaluateF(const struct CurveMap *cuma, float value);
+float BKE_curvemap_evaluateF(const struct CurveMap *cuma, float value);
 /* single curve, with table check */
-float curvemapping_evaluateF(const struct CurveMapping *cumap, int cur, float value);
-void curvemapping_evaluate3F(const struct CurveMapping *cumap,
-                             float vecout[3],
-                             const float vecin[3]);
-void curvemapping_evaluateRGBF(const struct CurveMapping *cumap,
-                               float vecout[3],
-                               const float vecin[3]);
-void curvemapping_evaluate_premulRGB(const struct CurveMapping *cumap,
-                                     unsigned char vecout_byte[3],
-                                     const unsigned char vecin_byte[3]);
-void curvemapping_evaluate_premulRGBF_ex(const struct CurveMapping *cumap,
-                                         float vecout[3],
-                                         const float vecin[3],
-                                         const float black[3],
-                                         const float bwmul[3]);
-void curvemapping_evaluate_premulRGBF(const struct CurveMapping *cumap,
-                                      float vecout[3],
-                                      const float vecin[3]);
-int curvemapping_RGBA_does_something(const struct CurveMapping *cumap);
-void curvemapping_table_RGBA(const struct CurveMapping *cumap, float **array, int *size);
+float BKE_curvemapping_evaluateF(const struct CurveMapping *cumap, int cur, float value);
+void BKE_curvemapping_evaluate3F(const struct CurveMapping *cumap,
+                                 float vecout[3],
+                                 const float vecin[3]);
+void BKE_curvemapping_evaluateRGBF(const struct CurveMapping *cumap,
+                                   float vecout[3],
+                                   const float vecin[3]);
+void BKE_curvemapping_evaluate_premulRGB(const struct CurveMapping *cumap,
+                                         unsigned char vecout_byte[3],
+                                         const unsigned char vecin_byte[3]);
+void BKE_curvemapping_evaluate_premulRGBF_ex(const struct CurveMapping *cumap,
+                                             float vecout[3],
+                                             const float vecin[3],
+                                             const float black[3],
+                                             const float bwmul[3]);
+void BKE_curvemapping_evaluate_premulRGBF(const struct CurveMapping *cumap,
+                                          float vecout[3],
+                                          const float vecin[3]);
+int BKE_curvemapping_RGBA_does_something(const struct CurveMapping *cumap);
+void BKE_curvemapping_table_RGBA(const struct CurveMapping *cumap, float **array, int *size);
 
 /* non-const, these modify the curve */
-void curvemapping_premultiply(struct CurveMapping *cumap, int restore);
+void BKE_curvemapping_premultiply(struct CurveMapping *cumap, int restore);
 
 void BKE_histogram_update_sample_line(struct Histogram *hist,
                                       struct ImBuf *ibuf,
                                       const struct ColorManagedViewSettings *view_settings,
                                       const struct ColorManagedDisplaySettings *display_settings);
-void scopes_update(struct Scopes *scopes,
-                   struct ImBuf *ibuf,
-                   const struct ColorManagedViewSettings *view_settings,
-                   const struct ColorManagedDisplaySettings *display_settings);
-void scopes_free(struct Scopes *scopes);
-void scopes_new(struct Scopes *scopes);
+void BKE_scopes_update(struct Scopes *scopes,
+                       struct ImBuf *ibuf,
+                       const struct ColorManagedViewSettings *view_settings,
+                       const struct ColorManagedDisplaySettings *display_settings);
+void BKE_scopes_free(struct Scopes *scopes);
+void BKE_scopes_new(struct Scopes *scopes);
 
 void BKE_color_managed_display_settings_init(struct ColorManagedDisplaySettings *settings);
 void BKE_color_managed_display_settings_copy(struct ColorManagedDisplaySettings *new_settings,
index 709f74808a3a4fa89c45af9fadc22a029dfe8d4e..b2d3ccfebc3f00d80c6db3bf38c4a26bbbe45711 100644 (file)
@@ -184,9 +184,9 @@ void BKE_brush_init_gpencil_settings(Brush *brush)
   brush->gpencil_settings->flag |= GP_BRUSH_ENABLE_CURSOR;
 
   /* curves */
-  brush->gpencil_settings->curve_sensitivity = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
-  brush->gpencil_settings->curve_strength = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
-  brush->gpencil_settings->curve_jitter = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+  brush->gpencil_settings->curve_sensitivity = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+  brush->gpencil_settings->curve_strength = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+  brush->gpencil_settings->curve_jitter = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
 }
 
 /* add a new gp-brush */
@@ -386,8 +386,8 @@ void BKE_brush_gpencil_presets(bContext *C)
 
   /* Curve */
   custom_curve = brush->gpencil_settings->curve_sensitivity;
-  curvemapping_set_defaults(custom_curve, 0, 0.0f, 0.0f, 1.0f, 1.0f);
-  curvemapping_initialize(custom_curve);
+  BKE_curvemapping_set_defaults(custom_curve, 0, 0.0f, 0.0f, 1.0f, 1.0f);
+  BKE_curvemapping_initialize(custom_curve);
   brush_gpencil_curvemap_reset(custom_curve->cm, 3, GPCURVE_PRESET_INK);
 
   /* Ink Noise brush */
@@ -423,8 +423,8 @@ void BKE_brush_gpencil_presets(bContext *C)
 
   /* Curve */
   custom_curve = brush->gpencil_settings->curve_sensitivity;
-  curvemapping_set_defaults(custom_curve, 0, 0.0f, 0.0f, 1.0f, 1.0f);
-  curvemapping_initialize(custom_curve);
+  BKE_curvemapping_set_defaults(custom_curve, 0, 0.0f, 0.0f, 1.0f, 1.0f);
+  BKE_curvemapping_initialize(custom_curve);
   brush_gpencil_curvemap_reset(custom_curve->cm, 3, GPCURVE_PRESET_INKNOISE);
 
   brush->gpencil_settings->gradient_f = 1.0f;
@@ -495,8 +495,8 @@ void BKE_brush_gpencil_presets(bContext *C)
   brush->smooth_stroke_factor = SMOOTH_STROKE_FACTOR;
   /* Curve */
   custom_curve = brush->gpencil_settings->curve_sensitivity;
-  curvemapping_set_defaults(custom_curve, 0, 0.0f, 0.0f, 1.0f, 1.0f);
-  curvemapping_initialize(custom_curve);
+  BKE_curvemapping_set_defaults(custom_curve, 0, 0.0f, 0.0f, 1.0f, 1.0f);
+  BKE_curvemapping_initialize(custom_curve);
   brush_gpencil_curvemap_reset(custom_curve->cm, 4, GPCURVE_PRESET_MARKER);
 
   brush->gpencil_settings->gradient_f = 1.0f;
@@ -649,14 +649,14 @@ void BKE_brush_copy_data(Main *UNUSED(bmain),
     brush_dst->preview = NULL;
   }
 
-  brush_dst->curve = curvemapping_copy(brush_src->curve);
+  brush_dst->curve = BKE_curvemapping_copy(brush_src->curve);
   if (brush_src->gpencil_settings != NULL) {
     brush_dst->gpencil_settings = MEM_dupallocN(brush_src->gpencil_settings);
-    brush_dst->gpencil_settings->curve_sensitivity = curvemapping_copy(
+    brush_dst->gpencil_settings->curve_sensitivity = BKE_curvemapping_copy(
         brush_src->gpencil_settings->curve_sensitivity);
-    brush_dst->gpencil_settings->curve_strength = curvemapping_copy(
+    brush_dst->gpencil_settings->curve_strength = BKE_curvemapping_copy(
         brush_src->gpencil_settings->curve_strength);
-    brush_dst->gpencil_settings->curve_jitter = curvemapping_copy(
+    brush_dst->gpencil_settings->curve_jitter = BKE_curvemapping_copy(
         brush_src->gpencil_settings->curve_jitter);
   }
 
@@ -677,12 +677,12 @@ void BKE_brush_free(Brush *brush)
   if (brush->icon_imbuf) {
     IMB_freeImBuf(brush->icon_imbuf);
   }
-  curvemapping_free(brush->curve);
+  BKE_curvemapping_free(brush->curve);
 
   if (brush->gpencil_settings != NULL) {
-    curvemapping_free(brush->gpencil_settings->curve_sensitivity);
-    curvemapping_free(brush->gpencil_settings->curve_strength);
-    curvemapping_free(brush->gpencil_settings->curve_jitter);
+    BKE_curvemapping_free(brush->gpencil_settings->curve_sensitivity);
+    BKE_curvemapping_free(brush->gpencil_settings->curve_strength);
+    BKE_curvemapping_free(brush->gpencil_settings->curve_jitter);
     MEM_SAFE_FREE(brush->gpencil_settings);
   }
 
@@ -917,15 +917,15 @@ void BKE_brush_curve_preset(Brush *b, eCurveMappingPreset preset)
   CurveMap *cm = NULL;
 
   if (!b->curve) {
-    b->curve = curvemapping_add(1, 0, 0, 1, 1);
+    b->curve = BKE_curvemapping_add(1, 0, 0, 1, 1);
   }
 
   cm = b->curve->cm;
   cm->flag &= ~CUMA_EXTEND_EXTRAPOLATE;
 
   b->curve->preset = preset;
-  curvemap_reset(cm, &b->curve->clipr, b->curve->preset, CURVEMAP_SLOPE_NEGATIVE);
-  curvemapping_changed(b->curve, false);
+  BKE_curvemap_reset(cm, &b->curve->clipr, b->curve->preset, CURVEMAP_SLOPE_NEGATIVE);
+  BKE_curvemapping_changed(b->curve, false);
 }
 
 /* Generic texture sampler for 3D painting systems. point has to be either in
@@ -1412,7 +1412,7 @@ float BKE_brush_curve_strength(const Brush *br, float p, const float len)
 
   switch (br->curve_preset) {
     case BRUSH_CURVE_CUSTOM:
-      strength = curvemapping_evaluateF(br->curve, 0, 1.0f - p);
+      strength = BKE_curvemapping_evaluateF(br->curve, 0, 1.0f - p);
       break;
     case BRUSH_CURVE_SHARP:
       strength = p * p;
@@ -1498,7 +1498,7 @@ struct ImBuf *BKE_brush_gen_radial_control_imbuf(Brush *br, bool secondary)
   int half = side / 2;
   int i, j;
 
-  curvemapping_initialize(br->curve);
+  BKE_curvemapping_initialize(br->curve);
   texcache = BKE_brush_gen_texture_cache(br, half, secondary);
   im->rect_float = MEM_callocN(sizeof(float) * side * side, "radial control rect");
   im->x = im->y = side;
index aa5f74c629783680b7fce8c7acc1593f7d1a0465..b129bf14bb82472a552ab942a9a784105e5be323 100644 (file)
@@ -48,7 +48,7 @@
 
 /* ***************** operations on full struct ************* */
 
-void curvemapping_set_defaults(
+void BKE_curvemapping_set_defaults(
     CurveMapping *cumap, int tot, float minx, float miny, float maxx, float maxy)
 {
   int a;
@@ -84,18 +84,18 @@ void curvemapping_set_defaults(
   cumap->changed_timestamp = 0;
 }
 
-CurveMapping *curvemapping_add(int tot, float minx, float miny, float maxx, float maxy)
+CurveMapping *BKE_curvemapping_add(int tot, float minx, float miny, float maxx, float maxy)
 {
   CurveMapping *cumap;
 
   cumap = MEM_callocN(sizeof(CurveMapping), "new curvemap");
 
-  curvemapping_set_defaults(cumap, tot, minx, miny, maxx, maxy);
+  BKE_curvemapping_set_defaults(cumap, tot, minx, miny, maxx, maxy);
 
   return cumap;
 }
 
-void curvemapping_free_data(CurveMapping *cumap)
+void BKE_curvemapping_free_data(CurveMapping *cumap)
 {
   int a;
 
@@ -115,15 +115,15 @@ void curvemapping_free_data(CurveMapping *cumap)
   }
 }
 
-void curvemapping_free(CurveMapping *cumap)
+void BKE_curvemapping_free(CurveMapping *cumap)
 {
   if (cumap) {
-    curvemapping_free_data(cumap);
+    BKE_curvemapping_free_data(cumap);
     MEM_freeN(cumap);
   }
 }
 
-void curvemapping_copy_data(CurveMapping *target, const CurveMapping *cumap)
+void BKE_curvemapping_copy_data(CurveMapping *target, const CurveMapping *cumap)
 {
   int a;
 
@@ -142,17 +142,19 @@ void curvemapping_copy_data(CurveMapping *target, const CurveMapping *cumap)
   }
 }
 
-CurveMapping *curvemapping_copy(const CurveMapping *cumap)
+CurveMapping *BKE_curvemapping_copy(const CurveMapping *cumap)
 {
   if (cumap) {
     CurveMapping *cumapn = MEM_dupallocN(cumap);
-    curvemapping_copy_data(cumapn, cumap);
+    BKE_curvemapping_copy_data(cumapn, cumap);
     return cumapn;
   }
   return NULL;
 }
 
-void curvemapping_set_black_white_ex(const float black[3], const float white[3], float r_bwmul[3])
+void BKE_curvemapping_set_black_white_ex(const float black[3],
+                                         const float white[3],
+                                         float r_bwmul[3])
 {
   int a;
 
@@ -162,7 +164,9 @@ void curvemapping_set_black_white_ex(const float black[3], const float white[3],
   }
 }
 
-void curvemapping_set_black_white(CurveMapping *cumap, const float black[3], const float white[3])
+void BKE_curvemapping_set_black_white(CurveMapping *cumap,
+                                      const float black[3],
+                                      const float white[3])
 {
   if (white) {
     copy_v3_v3(cumap->white, white);
@@ -171,15 +175,15 @@ void curvemapping_set_black_white(CurveMapping *cumap, const float black[3], con
     copy_v3_v3(cumap->black, black);
   }
 
-  curvemapping_set_black_white_ex(cumap->black, cumap->white, cumap->bwmul);
+  BKE_curvemapping_set_black_white_ex(cumap->black, cumap->white, cumap->bwmul);
   cumap->changed_timestamp++;
 }
 
 /* ***************** operations on single curve ************* */
-/* ********** NOTE: requires curvemapping_changed() call after ******** */
+/* ********** NOTE: requires BKE_curvemapping_changed() call after ******** */
 
 /* remove specified point */
-bool curvemap_remove_point(CurveMap *cuma, CurveMapPoint *point)
+bool BKE_curvemap_remove_point(CurveMap *cuma, CurveMapPoint *point)
 {
   CurveMapPoint *cmp;
   int a, b, removed = 0;
@@ -209,7 +213,7 @@ bool curvemap_remove_point(CurveMap *cuma, CurveMapPoint *point)
 }
 
 /* removes with flag set */
-void curvemap_remove(CurveMap *cuma, const short flag)
+void BKE_curvemap_remove(CurveMap *cuma, const short flag)
 {
   CurveMapPoint *cmp = MEM_mallocN((cuma->totpoint) * sizeof(CurveMapPoint), "curve points");
   int a, b, removed = 0;
@@ -232,7 +236,7 @@ void curvemap_remove(CurveMap *cuma, const short flag)
   cuma->totpoint -= removed;
 }
 
-CurveMapPoint *curvemap_insert(CurveMap *cuma, float x, float y)
+CurveMapPoint *BKE_curvemap_insert(CurveMap *cuma, float x, float y)
 {
   CurveMapPoint *cmp = MEM_callocN((cuma->totpoint + 1) * sizeof(CurveMapPoint), "curve points");
   CurveMapPoint *newcmp = NULL;
@@ -266,7 +270,7 @@ CurveMapPoint *curvemap_insert(CurveMap *cuma, float x, float y)
   return newcmp;
 }
 
-void curvemap_reset(CurveMap *cuma, const rctf *clipr, int preset, int slope)
+void BKE_curvemap_reset(CurveMap *cuma, const rctf *clipr, int preset, int slope)
 {
   if (cuma->curve) {
     MEM_freeN(cuma->curve);
@@ -439,7 +443,7 @@ void curvemap_reset(CurveMap *cuma, const rctf *clipr, int preset, int slope)
 /**
  * \param type: eBezTriple_Handle
  */
-void curvemap_handle_set(CurveMap *cuma, int type)
+void BKE_curvemap_handle_set(CurveMap *cuma, int type)
 {
   int a;
 
@@ -800,7 +804,7 @@ static void curvemap_make_table(CurveMap *cuma, const rctf *clipr)
 
 /* call when you do images etc, needs restore too. also verifies tables */
 /* it uses a flag to prevent premul or free to happen twice */
-void curvemapping_premultiply(CurveMapping *cumap, int restore)
+void BKE_curvemapping_premultiply(CurveMapping *cumap, int restore)
 {
   int a;
 
@@ -841,7 +845,7 @@ void curvemapping_premultiply(CurveMapping *cumap, int restore)
       for (a = 0; a < 3; a++) {
         int b;
         for (b = 0; b <= CM_TABLE; b++) {
-          cumap->cm[a].table[b].y = curvemap_evaluateF(cumap->cm + 3, cumap->cm[a].table[b].y);
+          cumap->cm[a].table[b].y = BKE_curvemap_evaluateF(cumap->cm + 3, cumap->cm[a].table[b].y);
         }
 
         copy_v2_v2(cumap->cm[a].premul_ext_in, cumap->cm[a].ext_in);
@@ -871,7 +875,7 @@ static int sort_curvepoints(const void *a1, const void *a2)
 /* ************************ more CurveMapping calls *************** */
 
 /* note; only does current curvemap! */
-void curvemapping_changed(CurveMapping *cumap, const bool rem_doubles)
+void BKE_curvemapping_changed(CurveMapping *cumap, const bool rem_doubles)
 {
   CurveMap *cuma = cumap->cm + cumap->cur;
   CurveMapPoint *cmp = cuma->curve;
@@ -942,20 +946,20 @@ void curvemapping_changed(CurveMapping *cumap, const bool rem_doubles)
       }
     }
     if (a != cuma->totpoint - 1) {
-      curvemap_remove(cuma, 2);
+      BKE_curvemap_remove(cuma, 2);
     }
   }
   curvemap_make_table(cuma, clipr);
 }
 
-void curvemapping_changed_all(CurveMapping *cumap)
+void BKE_curvemapping_changed_all(CurveMapping *cumap)
 {
   int a, cur = cumap->cur;
 
   for (a = 0; a < CM_TOT; a++) {
     if (cumap->cm[a].curve) {
       cumap->cur = a;
-      curvemapping_changed(cumap, false);
+      BKE_curvemapping_changed(cumap, false);
     }
   }
 
@@ -963,7 +967,7 @@ void curvemapping_changed_all(CurveMapping *cumap)
 }
 
 /* table should be verified */
-float curvemap_evaluateF(const CurveMap *cuma, float value)
+float BKE_curvemap_evaluateF(const CurveMap *cuma, float value)
 {
   float fi;
   int i;
@@ -990,10 +994,10 @@ float curvemap_evaluateF(const CurveMap *cuma, float value)
 }
 
 /* works with curve 'cur' */
-float curvemapping_evaluateF(const CurveMapping *cumap, int cur, float value)
+float BKE_curvemapping_evaluateF(const CurveMapping *cumap, int cur, float value)
 {
   const CurveMap *cuma = cumap->cm + cur;
-  float val = curvemap_evaluateF(cuma, value);
+  float val = BKE_curvemap_evaluateF(cuma, value);
 
   /* account for clipping */
   if (cumap->flag & CUMA_DO_CLIP) {
@@ -1009,19 +1013,24 @@ float curvemapping_evaluateF(const CurveMapping *cumap, int cur, float value)
 }
 
 /* vector case */
-void curvemapping_evaluate3F(const CurveMapping *cumap, float vecout[3], const float vecin[3])
+void BKE_curvemapping_evaluate3F(const CurveMapping *cumap, float vecout[3], const float vecin[3])
 {
-  vecout[0] = curvemap_evaluateF(&cumap->cm[0], vecin[0]);
-  vecout[1] = curvemap_evaluateF(&cumap->cm[1], vecin[1]);
-  vecout[2] = curvemap_evaluateF(&cumap->cm[2], vecin[2]);
+  vecout[0] = BKE_curvemap_evaluateF(&cumap->cm[0], vecin[0]);
+  vecout[1] = BKE_curvemap_evaluateF(&cumap->cm[1], vecin[1]);
+  vecout[2] = BKE_curvemap_evaluateF(&cumap->cm[2], vecin[2]);
 }
 
 /* RGB case, no black/white points, no premult */
-void curvemapping_evaluateRGBF(const CurveMapping *cumap, float vecout[3], const float vecin[3])
+void BKE_curvemapping_evaluateRGBF(const CurveMapping *cumap,
+                                   float vecout[3],
+                                   const float vecin[3])
 {
-  vecout[0] = curvemap_evaluateF(&cumap->cm[0], curvemap_evaluateF(&cumap->cm[3], vecin[0]));
-  vecout[1] = curvemap_evaluateF(&cumap->cm[1], curvemap_evaluateF(&cumap->cm[3], vecin[1]));
-  vecout[2] = curvemap_evaluateF(&cumap->cm[2], curvemap_evaluateF(&cumap->cm[3], vecin[2]));
+  vecout[0] = BKE_curvemap_evaluateF(&cumap->cm[0],
+                                     BKE_curvemap_evaluateF(&cumap->cm[3], vecin[0]));
+  vecout[1] = BKE_curvemap_evaluateF(&cumap->cm[1],
+                                     BKE_curvemap_evaluateF(&cumap->cm[3], vecin[1]));
+  vecout[2] = BKE_curvemap_evaluateF(&cumap->cm[2],
+                                     BKE_curvemap_evaluateF(&cumap->cm[3], vecin[2]));
 }
 
 static void curvemapping_evaluateRGBF_filmlike(const CurveMapping *cumap,
@@ -1033,8 +1042,8 @@ static void curvemapping_evaluateRGBF_filmlike(const CurveMapping *cumap,
   const float v1in = vecin[channel_offset[1]];
   const float v2in = vecin[channel_offset[2]];
 
-  const float v0 = curvemap_evaluateF(&cumap->cm[channel_offset[0]], v0in);
-  const float v2 = curvemap_evaluateF(&cumap->cm[channel_offset[2]], v2in);
+  const float v0 = BKE_curvemap_evaluateF(&cumap->cm[channel_offset[0]], v0in);
+  const float v2 = BKE_curvemap_evaluateF(&cumap->cm[channel_offset[2]], v2in);
   const float v1 = v2 + ((v0 - v2) * (v1in - v2in) / (v0in - v2in));
 
   vecout[channel_offset[0]] = v0;
@@ -1042,20 +1051,20 @@ static void curvemapping_evaluateRGBF_filmlike(const CurveMapping *cumap,
   vecout[channel_offset[2]] = v2;
 }
 
-/** same as #curvemapping_evaluate_premulRGBF
+/** same as #BKE_curvemapping_evaluate_premulRGBF
  * but black/bwmul are passed as args for the compositor
  * where they can change per pixel.
  *
- * Use in conjunction with #curvemapping_set_black_white_ex
+ * Use in conjunction with #BKE_curvemapping_set_black_white_ex
  *
  * \param black: Use instead of cumap->black
  * \param bwmul: Use instead of cumap->bwmul
  */
-void curvemapping_evaluate_premulRGBF_ex(const CurveMapping *cumap,
-                                         float vecout[3],
-                                         const float vecin[3],
-                                         const float black[3],
-                                         const float bwmul[3])
+void BKE_curvemapping_evaluate_premulRGBF_ex(const CurveMapping *cumap,
+                                             float vecout[3],
+                                             const float vecin[3],
+                                             const float black[3],
+                                             const float bwmul[3])
 {
   const float r = (vecin[0] - black[0]) * bwmul[0];
   const float g = (vecin[1] - black[1]) * bwmul[1];
@@ -1064,9 +1073,9 @@ void curvemapping_evaluate_premulRGBF_ex(const CurveMapping *cumap,
   switch (cumap->tone) {
     default:
     case CURVE_TONE_STANDARD: {
-      vecout[0] = curvemap_evaluateF(&cumap->cm[0], r);
-      vecout[1] = curvemap_evaluateF(&cumap->cm[1], g);
-      vecout[2] = curvemap_evaluateF(&cumap->cm[2], b);
+      vecout[0] = BKE_curvemap_evaluateF(&cumap->cm[0], r);
+      vecout[1] = BKE_curvemap_evaluateF(&cumap->cm[1], g);
+      vecout[2] = BKE_curvemap_evaluateF(&cumap->cm[2], b);
       break;
     }
     case CURVE_TONE_FILMLIKE: {
@@ -1088,8 +1097,9 @@ void curvemapping_evaluate_premulRGBF_ex(const CurveMapping *cumap,
         }
         else {
           /* Case 4: r >= g == b */
-          copy_v2_fl2(
-              vecout, curvemap_evaluateF(&cumap->cm[0], r), curvemap_evaluateF(&cumap->cm[1], g));
+          copy_v2_fl2(vecout,
+                      BKE_curvemap_evaluateF(&cumap->cm[0], r),
+                      BKE_curvemap_evaluateF(&cumap->cm[1], g));
           vecout[2] = vecout[1];
         }
       }
@@ -1116,17 +1126,17 @@ void curvemapping_evaluate_premulRGBF_ex(const CurveMapping *cumap,
 }
 
 /* RGB with black/white points and premult. tables are checked */
-void curvemapping_evaluate_premulRGBF(const CurveMapping *cumap,
-                                      float vecout[3],
-                                      const float vecin[3])
+void BKE_curvemapping_evaluate_premulRGBF(const CurveMapping *cumap,
+                                          float vecout[3],
+                                          const float vecin[3])
 {
-  curvemapping_evaluate_premulRGBF_ex(cumap, vecout, vecin, cumap->black, cumap->bwmul);
+  BKE_curvemapping_evaluate_premulRGBF_ex(cumap, vecout, vecin, cumap->black, cumap->bwmul);
 }
 
 /* same as above, byte version */
-void curvemapping_evaluate_premulRGB(const CurveMapping *cumap,
-                                     unsigned char vecout_byte[3],
-                                     const unsigned char vecin_byte[3])
+void BKE_curvemapping_evaluate_premulRGB(const CurveMapping *cumap,
+                                         unsigned char vecout_byte[3],
+                                         const unsigned char vecin_byte[3])
 {
   float vecin[3], vecout[3];
 
@@ -1134,14 +1144,14 @@ void curvemapping_evaluate_premulRGB(const CurveMapping *cumap,
   vecin[1] = (float)vecin_byte[1] / 255.0f;
   vecin[2] = (float)vecin_byte[2] / 255.0f;
 
-  curvemapping_evaluate_premulRGBF(cumap, vecout, vecin);
+  BKE_curvemapping_evaluate_premulRGBF(cumap, vecout, vecin);
 
   vecout_byte[0] = unit_float_to_uchar_clamp(vecout[0]);
   vecout_byte[1] = unit_float_to_uchar_clamp(vecout[1]);
   vecout_byte[2] = unit_float_to_uchar_clamp(vecout[2]);
 }
 
-int curvemapping_RGBA_does_something(const CurveMapping *cumap)
+int BKE_curvemapping_RGBA_does_something(const CurveMapping *cumap)
 {
   int a;
 
@@ -1187,7 +1197,7 @@ int curvemapping_RGBA_does_something(const CurveMapping *cumap)
   return 0;
 }
 
-void curvemapping_initialize(CurveMapping *cumap)
+void BKE_curvemapping_initialize(CurveMapping *cumap)
 {
   int a;
 
@@ -1202,7 +1212,7 @@ void curvemapping_initialize(CurveMapping *cumap)
   }
 }
 
-void curvemapping_table_RGBA(const CurveMapping *cumap, float **array, int *size)
+void BKE_curvemapping_table_RGBA(const CurveMapping *cumap, float **array, int *size)
 {
   int a;
 
@@ -1520,10 +1530,10 @@ static void scopes_update_finalize(void *__restrict userdata, void *__restrict u
   }
 }
 
-void scopes_update(Scopes *scopes,
-                   ImBuf *ibuf,
-                   const ColorManagedViewSettings *view_settings,
-                   const ColorManagedDisplaySettings *display_settings)
+void BKE_scopes_update(Scopes *scopes,
+                       ImBuf *ibuf,
+                       const ColorManagedViewSettings *view_settings,
+                       const ColorManagedDisplaySettings *display_settings)
 {
   int a;
   unsigned int nl, na, nr, ng, nb;
@@ -1685,7 +1695,7 @@ void scopes_update(Scopes *scopes,
   scopes->ok = 1;
 }
 
-void scopes_free(Scopes *scopes)
+void BKE_scopes_free(Scopes *scopes)
 {
   if (scopes->waveform_1) {
     MEM_freeN(scopes->waveform_1);
@@ -1705,7 +1715,7 @@ void scopes_free(Scopes *scopes)
   }
 }
 
-void scopes_new(Scopes *scopes)
+void BKE_scopes_new(Scopes *scopes)
 {
   scopes->accuracy = 30.0;
   scopes->hist.mode = HISTO_MODE_RGB;
@@ -1781,7 +1791,7 @@ void BKE_color_managed_view_settings_copy(ColorManagedViewSettings *new_settings
   new_settings->gamma = settings->gamma;
 
   if (settings->curve_mapping) {
-    new_settings->curve_mapping = curvemapping_copy(settings->curve_mapping);
+    new_settings->curve_mapping = BKE_curvemapping_copy(settings->curve_mapping);
   }
   else {
     new_settings->curve_mapping = NULL;
@@ -1791,7 +1801,7 @@ void BKE_color_managed_view_settings_copy(ColorManagedViewSettings *new_settings
 void BKE_color_managed_view_settings_free(ColorManagedViewSettings *settings)
 {
   if (settings->curve_mapping) {
-    curvemapping_free(settings->curve_mapping);
+    BKE_curvemapping_free(settings->curve_mapping);
   }
 }
 
index 731e9aff926ab3b7d2fac5e2dbb740d3e18e1682..3ae20642b15999b56073b8bdfcf77c5dc36d1827 100644 (file)
@@ -1632,13 +1632,13 @@ float BKE_gpencil_multiframe_falloff_calc(
   if (gpf->framenum < actnum) {
     fnum = (float)(gpf->framenum - f_init) / (actnum - f_init);
     fnum *= 0.5f;
-    value = curvemapping_evaluateF(cur_falloff, 0, fnum);
+    value = BKE_curvemapping_evaluateF(cur_falloff, 0, fnum);
   }
   /* frames to the left of the active frame */
   else if (gpf->framenum > actnum) {
     fnum = (float)(gpf->framenum - actnum) / (f_end - actnum);
     fnum *= 0.5f;
-    value = curvemapping_evaluateF(cur_falloff, 0, fnum + 0.5f);
+    value = BKE_curvemapping_evaluateF(cur_falloff, 0, fnum + 0.5f);
   }
   else {
     value = 1.0f;
index 271bf58fcc63de7eb55cc7e8ba31608bceb0780f..75c9e0e42a5c17ab78be79f5edac42823e5c1ad2 100644 (file)
@@ -69,7 +69,7 @@ void BKE_light_init(Light *la)
   la->coeff_const = 1.0f;
   la->coeff_lin = 0.0f;
   la->coeff_quad = 0.0f;
-  la->curfalloff = curvemapping_add(1, 0.0f, 1.0f, 1.0f, 0.0f);
+  la->curfalloff = BKE_curvemapping_add(1, 0.0f, 1.0f, 1.0f, 0.0f);
   la->cascade_max_dist = 200.0f;
   la->cascade_count = 4;
   la->cascade_exponent = 0.8f;
@@ -82,7 +82,7 @@ void BKE_light_init(Light *la)
   la->att_dist = 40.0f;
   la->sun_angle = DEG2RADF(0.526f);
 
-  curvemapping_initialize(la->curfalloff);
+  BKE_curvemapping_initialize(la->curfalloff);
 }
 
 Light *BKE_light_add(Main *bmain, const char *name)
@@ -108,7 +108,7 @@ Light *BKE_light_add(Main *bmain, const char *name)
  */
 void BKE_light_copy_data(Main *bmain, Light *la_dst, const Light *la_src, const int flag)
 {
-  la_dst->curfalloff = curvemapping_copy(la_src->curfalloff);
+  la_dst->curfalloff = BKE_curvemapping_copy(la_src->curfalloff);
 
   if (la_src->nodetree) {
     /* Note: nodetree is *not* in bmain, however this specific case is handled at lower level
@@ -145,7 +145,7 @@ Light *BKE_light_localize(Light *la)
 
   Light *lan = BKE_libblock_copy_for_localize(&la->id);
 
-  lan->curfalloff = curvemapping_copy(la->curfalloff);
+  lan->curfalloff = BKE_curvemapping_copy(la->curfalloff);
 
   if (la->nodetree) {
     lan->nodetree = ntreeLocalize(la->nodetree);
@@ -167,7 +167,7 @@ void BKE_light_free(Light *la)
 {
   BKE_animdata_free((ID *)la, false);
 
-  curvemapping_free(la->curfalloff);
+  BKE_curvemapping_free(la->curfalloff);
 
   /* is no lib link block, but light extension */
   if (la->nodetree) {
index 31e6d2e89e550314a1580124a645ce1bd2c5715b..7bfe5a7c8ffafb751782bed297baa08a2f021af4 100644 (file)
@@ -512,13 +512,13 @@ LineStyleModifier *BKE_linestyle_alpha_modifier_add(FreestyleLineStyle *linestyl
   switch (type) {
     case LS_MODIFIER_ALONG_STROKE: {
       LineStyleAlphaModifier_AlongStroke *p = (LineStyleAlphaModifier_AlongStroke *)m;
-      p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+      p->curve = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
       break;
     }
     case LS_MODIFIER_DISTANCE_FROM_CAMERA: {
       LineStyleAlphaModifier_DistanceFromCamera *p = (LineStyleAlphaModifier_DistanceFromCamera *)
           m;
-      p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+      p->curve = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
       p->range_min = 0.0f;
       p->range_max = 10000.0f;
       break;
@@ -527,25 +527,25 @@ LineStyleModifier *BKE_linestyle_alpha_modifier_add(FreestyleLineStyle *linestyl
       LineStyleAlphaModifier_DistanceFromObject *p = (LineStyleAlphaModifier_DistanceFromObject *)
           m;
       p->target = NULL;
-      p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+      p->curve = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
       p->range_min = 0.0f;
       p->range_max = 10000.0f;
       break;
     }
     case LS_MODIFIER_MATERIAL: {
       LineStyleAlphaModifier_Material *p = (LineStyleAlphaModifier_Material *)m;
-      p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+      p->curve = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
       p->mat_attr = LS_MODIFIER_MATERIAL_LINE_A;
       break;
     }
     case LS_MODIFIER_TANGENT: {
       LineStyleAlphaModifier_Tangent *p = (LineStyleAlphaModifier_Tangent *)m;
-      p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+      p->curve = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
       break;
     }
     case LS_MODIFIER_NOISE: {
       LineStyleAlphaModifier_Noise *p = (LineStyleAlphaModifier_Noise *)m;
-      p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+      p->curve = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
       ((LineStyleAlphaModifier_Noise *)m)->amplitude = 10.0f;
       ((LineStyleAlphaModifier_Noise *)m)->period = 10.0f;
       ((LineStyleAlphaModifier_Noise *)m)->seed = 512;
@@ -553,14 +553,14 @@ LineStyleModifier *BKE_linestyle_alpha_modifier_add(FreestyleLineStyle *linestyl
     }
     case LS_MODIFIER_CREASE_ANGLE: {
       LineStyleAlphaModifier_CreaseAngle *p = (LineStyleAlphaModifier_CreaseAngle *)m;
-      p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+      p->curve = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
       ((LineStyleAlphaModifier_CreaseAngle *)m)->min_angle = 0.0f;
       ((LineStyleAlphaModifier_CreaseAngle *)m)->max_angle = DEG2RADF(180.0f);
       break;
     }
     case LS_MODIFIER_CURVATURE_3D: {
       LineStyleAlphaModifier_Curvature_3D *p = (LineStyleAlphaModifier_Curvature_3D *)m;
-      p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+      p->curve = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
       ((LineStyleAlphaModifier_Curvature_3D *)m)->min_curvature = 0.0f;
       ((LineStyleAlphaModifier_Curvature_3D *)m)->max_curvature = 0.5f;
       break;
@@ -588,7 +588,7 @@ LineStyleModifier *BKE_linestyle_alpha_modifier_copy(FreestyleLineStyle *linesty
     case LS_MODIFIER_ALONG_STROKE: {
       LineStyleAlphaModifier_AlongStroke *p = (LineStyleAlphaModifier_AlongStroke *)m;
       LineStyleAlphaModifier_AlongStroke *q = (LineStyleAlphaModifier_AlongStroke *)new_m;
-      q->curve = curvemapping_copy(p->curve);
+      q->curve = BKE_curvemapping_copy(p->curve);
       q->flags = p->flags;
       break;
     }
@@ -597,7 +597,7 @@ LineStyleModifier *BKE_linestyle_alpha_modifier_copy(FreestyleLineStyle *linesty
           m;
       LineStyleAlphaModifier_DistanceFromCamera *q = (LineStyleAlphaModifier_DistanceFromCamera *)
           new_m;
-      q->curve = curvemapping_copy(p->curve);
+      q->curve = BKE_curvemapping_copy(p->curve);
       q->flags = p->flags;
       q->range_min = p->range_min;
       q->range_max = p->range_max;
@@ -612,7 +612,7 @@ LineStyleModifier *BKE_linestyle_alpha_modifier_copy(FreestyleLineStyle *linesty
         id_us_plus(&p->target->id);
       }
       q->target = p->target;
-      q->curve = curvemapping_copy(p->curve);
+      q->curve = BKE_curvemapping_copy(p->curve);
       q->flags = p->flags;
       q->range_min = p->range_min;
       q->range_max = p->range_max;
@@ -621,7 +621,7 @@ LineStyleModifier *BKE_linestyle_alpha_modifier_copy(FreestyleLineStyle *linesty
     case LS_MODIFIER_MATERIAL: {
       LineStyleAlphaModifier_Material *p = (LineStyleAlphaModifier_Material *)m;
       LineStyleAlphaModifier_Material *q = (LineStyleAlphaModifier_Material *)new_m;
-      q->curve = curvemapping_copy(p->curve);
+      q->curve = BKE_curvemapping_copy(p->curve);
       q->flags = p->flags;
       q->mat_attr = p->mat_attr;
       break;
@@ -629,14 +629,14 @@ LineStyleModifier *BKE_linestyle_alpha_modifier_copy(FreestyleLineStyle *linesty
     case LS_MODIFIER_TANGENT: {
       LineStyleAlphaModifier_Tangent *p = (LineStyleAlphaModifier_Tangent *)m;
       LineStyleAlphaModifier_Tangent *q = (LineStyleAlphaModifier_Tangent *)new_m;
-      q->curve = curvemapping_copy(p->curve);
+      q->curve = BKE_curvemapping_copy(p->curve);
       q->flags = p->flags;
       break;
     }
     case LS_MODIFIER_NOISE: {
       LineStyleAlphaModifier_Noise *p = (LineStyleAlphaModifier_Noise *)m;
       LineStyleAlphaModifier_Noise *q = (LineStyleAlphaModifier_Noise *)new_m;
-      q->curve = curvemapping_copy(p->curve);
+      q->curve = BKE_curvemapping_copy(p->curve);
       q->flags = p->flags;
       q->amplitude = p->amplitude;
       q->period = p->period;
@@ -646,7 +646,7 @@ LineStyleModifier *BKE_linestyle_alpha_modifier_copy(FreestyleLineStyle *linesty
     case LS_MODIFIER_CREASE_ANGLE: {
       LineStyleAlphaModifier_CreaseAngle *p = (LineStyleAlphaModifier_CreaseAngle *)m;
       LineStyleAlphaModifier_CreaseAngle *q = (LineStyleAlphaModifier_CreaseAngle *)new_m;
-      q->curve = curvemapping_copy(p->curve);
+      q->curve = BKE_curvemapping_copy(p->curve);
       q->flags = p->flags;
       q->min_angle = p->min_angle;
       q->max_angle = p->max_angle;
@@ -655,7 +655,7 @@ LineStyleModifier *BKE_linestyle_alpha_modifier_copy(FreestyleLineStyle *linesty
     case LS_MODIFIER_CURVATURE_3D: {
       LineStyleAlphaModifier_Curvature_3D *p = (LineStyleAlphaModifier_Curvature_3D *)m;
       LineStyleAlphaModifier_Curvature_3D *q = (LineStyleAlphaModifier_Curvature_3D *)new_m;
-      q->curve = curvemapping_copy(p->curve);
+      q->curve = BKE_curvemapping_copy(p->curve);
       q->flags = p->flags;
       q->min_curvature = p->min_curvature;
       q->max_curvature = p->max_curvature;
@@ -676,28 +676,28 @@ int BKE_linestyle_alpha_modifier_remove(FreestyleLineStyle *linestyle, LineStyle
   }
   switch (m->type) {
     case LS_MODIFIER_ALONG_STROKE:
-      curvemapping_free(((LineStyleAlphaModifier_AlongStroke *)m)->curve);
+      BKE_curvemapping_free(((LineStyleAlphaModifier_AlongStroke *)m)->curve);
       break;
     case LS_MODIFIER_DISTANCE_FROM_CAMERA:
-      curvemapping_free(((LineStyleAlphaModifier_DistanceFromCamera *)m)->curve);
+      BKE_curvemapping_free(((LineStyleAlphaModifier_DistanceFromCamera *)m)->curve);
       break;
     case LS_MODIFIER_DISTANCE_FROM_OBJECT:
-      curvemapping_free(((LineStyleAlphaModifier_DistanceFromObject *)m)->curve);
+      BKE_curvemapping_free(((LineStyleAlphaModifier_DistanceFromObject *)m)->curve);
       break;
     case LS_MODIFIER_MATERIAL:
-      curvemapping_free(((LineStyleAlphaModifier_Material *)m)->curve);
+      BKE_curvemapping_free(((LineStyleAlphaModifier_Material *)m)->curve);
       break;
     case LS_MODIFIER_TANGENT:
-      curvemapping_free(((LineStyleAlphaModifier_Tangent *)m)->curve);
+      BKE_curvemapping_free(((LineStyleAlphaModifier_Tangent *)m)->curve);
       break;
     case LS_MODIFIER_NOISE:
-      curvemapping_free(((LineStyleAlphaModifier_Noise *)m)->curve);
+      BKE_curvemapping_free(((LineStyleAlphaModifier_Noise *)m)->curve);
       break;
     case LS_MODIFIER_CREASE_ANGLE:
-      curvemapping_free(((LineStyleAlphaModifier_CreaseAngle *)m)->curve);
+      BKE_curvemapping_free(((LineStyleAlphaModifier_CreaseAngle *)m)->curve);
       break;
     case LS_MODIFIER_CURVATURE_3D:
-      curvemapping_free(((LineStyleAlphaModifier_Curvature_3D *)m)->curve);
+      BKE_curvemapping_free(((LineStyleAlphaModifier_Curvature_3D *)m)->curve);
       break;
   }
   BLI_freelinkN(&linestyle->alpha_modifiers, m);
@@ -755,7 +755,7 @@ LineStyleModifier *BKE_linestyle_thickness_modifier_add(FreestyleLineStyle *line
   switch (type) {
     case LS_MODIFIER_ALONG_STROKE: {
       LineStyleThicknessModifier_AlongStroke *p = (LineStyleThicknessModifier_AlongStroke *)m;
-      p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+      p->curve = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
       p->value_min = 0.0f;
       p->value_max = 1.0f;
       break;
@@ -763,7 +763,7 @@ LineStyleModifier *BKE_linestyle_thickness_modifier_add(FreestyleLineStyle *line
     case LS_MODIFIER_DISTANCE_FROM_CAMERA: {
       LineStyleThicknessModifier_DistanceFromCamera *p =
           (LineStyleThicknessModifier_DistanceFromCamera *)m;
-      p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+      p->curve = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
       p->range_min = 0.0f;
       p->range_max = 1000.0f;
       p->value_min = 0.0f;
@@ -774,7 +774,7 @@ LineStyleModifier *BKE_linestyle_thickness_modifier_add(FreestyleLineStyle *line
       LineStyleThicknessModifier_DistanceFromObject *p =
           (LineStyleThicknessModifier_DistanceFromObject *)m;
       p->target = NULL;
-      p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+      p->curve = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
       p->range_min = 0.0f;
       p->range_max = 1000.0f;
       p->value_min = 0.0f;
@@ -783,7 +783,7 @@ LineStyleModifier *BKE_linestyle_thickness_modifier_add(FreestyleLineStyle *line
     }
     case LS_MODIFIER_MATERIAL: {
       LineStyleThicknessModifier_Material *p = (LineStyleThicknessModifier_Material *)m;
-      p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+      p->curve = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
       p->mat_attr = LS_MODIFIER_MATERIAL_LINE;
       p->value_min = 0.0f;
       p->value_max = 1.0f;
@@ -798,7 +798,7 @@ LineStyleModifier *BKE_linestyle_thickness_modifier_add(FreestyleLineStyle *line
     }
     case LS_MODIFIER_TANGENT: {
       LineStyleThicknessModifier_Tangent *p = (LineStyleThicknessModifier_Tangent *)m;
-      p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+      p->curve = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
       p->min_thickness = 1.0f;
       p->max_thickness = 10.0f;
       break;
@@ -813,7 +813,7 @@ LineStyleModifier *BKE_linestyle_thickness_modifier_add(FreestyleLineStyle *line
     }
     case LS_MODIFIER_CREASE_ANGLE: {
       LineStyleThicknessModifier_CreaseAngle *p = (LineStyleThicknessModifier_CreaseAngle *)m;
-      p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+      p->curve = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
       p->min_angle = 0.0f;
       p->max_angle = DEG2RADF(180.0f);
       p->min_thickness = 1.0f;
@@ -822,7 +822,7 @@ LineStyleModifier *BKE_linestyle_thickness_modifier_add(FreestyleLineStyle *line
     }
     case LS_MODIFIER_CURVATURE_3D: {
       LineStyleThicknessModifier_Curvature_3D *p = (LineStyleThicknessModifier_Curvature_3D *)m;
-      p->curve = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+      p->curve = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
       p->min_curvature = 0.0f;
       p->max_curvature = 0.5f;
       p->min_thickness = 1.0f;
@@ -855,7 +855,7 @@ LineStyleModifier *BKE_linestyle_thickness_modifier_copy(FreestyleLineStyle *lin
     case LS_MODIFIER_ALONG_STROKE: {
       LineStyleThicknessModifier_AlongStroke *p = (LineStyleThicknessModifier_AlongStroke *)m;
       LineStyleThicknessModifier_AlongStroke *q = (LineStyleThicknessModifier_AlongStroke *)new_m;
-      q->curve = curvemapping_copy(p->curve);
+      q->curve = BKE_curvemapping_copy(p->curve);
       q->flags = p->flags;
       q->value_min = p->value_min;
       q->value_max = p->value_max;
@@ -866,7 +866,7 @@ LineStyleModifier *BKE_linestyle_thickness_modifier_copy(FreestyleLineStyle *lin
           (LineStyleThicknessModifier_DistanceFromCamera *)m;
       LineStyleThicknessModifier_DistanceFromCamera *q =
           (LineStyleThicknessModifier_DistanceFromCamera *)new_m;
-      q->curve = curvemapping_copy(p->curve);
+      q->curve = BKE_curvemapping_copy(p->curve);
       q->flags = p->flags;
       q->range_min = p->range_min;
       q->range_max = p->range_max;
@@ -883,7 +883,7 @@ LineStyleModifier *BKE_linestyle_thickness_modifier_copy(FreestyleLineStyle *lin
       if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) == 0) {
         id_us_plus((ID *)q->target);
       }
-      q->curve = curvemapping_copy(p->curve);
+      q->curve = BKE_curvemapping_copy(p->curve);
       q->flags = p->flags;
       q->range_min = p->range_min;
       q->range_max = p->range_max;
@@ -894,7 +894,7 @@ LineStyleModifier *BKE_linestyle_thickness_modifier_copy(FreestyleLineStyle *lin
     case LS_MODIFIER_MATERIAL: {
       LineStyleThicknessModifier_Material *p = (LineStyleThicknessModifier_Material *)m;
       LineStyleThicknessModifier_Material *q = (LineStyleThicknessModifier_Material *)new_m;
-      q->curve = curvemapping_copy(p->curve);
+      q->curve = BKE_curvemapping_copy(p->curve);
       q->flags = p->flags;
       q->mat_attr = p->mat_attr;
       q->value_min = p->value_min;
@@ -912,7 +912,7 @@ LineStyleModifier *BKE_linestyle_thickness_modifier_copy(FreestyleLineStyle *lin
     case LS_MODIFIER_TANGENT: {
       LineStyleThicknessModifier_Tangent *p = (LineStyleThicknessModifier_Tangent *)m;
       LineStyleThicknessModifier_Tangent *q = (LineStyleThicknessModifier_Tangent *)new_m;
-      q->curve = curvemapping_copy(p->curve);
+      q->curve = BKE_curvemapping_copy(p->curve);
       q->flags = p->flags;
       q->min_thickness = p->min_thickness;
       q->max_thickness = p->max_thickness;
@@ -931,7 +931,7 @@ LineStyleModifier *BKE_linestyle_thickness_modifier_copy(FreestyleLineStyle *lin
       LineStyleThicknessModifier_Curvature_3D *p = (LineStyleThicknessModifier_Curvature_3D *)m;
       LineStyleThicknessModifier_Curvature_3D *q = (LineStyleThicknessModifier_Curvature_3D *)
           new_m;
-      q->curve = curvemapping_copy(p->curve);
+      q->curve = BKE_curvemapping_copy(p->curve);
       q->flags = p->flags;
       q->min_curvature = p->min_curvature;
       q->max_curvature = p->max_curvature;
@@ -942,7 +942,7 @@ LineStyleModifier *BKE_linestyle_thickness_modifier_copy(FreestyleLineStyle *lin
     case LS_MODIFIER_CREASE_ANGLE: {
       LineStyleThicknessModifier_CreaseAngle *p = (LineStyleThicknessModifier_CreaseAngle *)m;
       LineStyleThicknessModifier_CreaseAngle *q = (LineStyleThicknessModifier_CreaseAngle *)new_m;
-      q->curve = curvemapping_copy(p->curve);
+      q->curve = BKE_curvemapping_copy(p->curve);
       q->flags = p->flags;
       q->min_angle = p->min_angle;
       q->max_angle = p->max_angle;
@@ -965,21 +965,21 @@ int BKE_linestyle_thickness_modifier_remove(FreestyleLineStyle *linestyle, LineS
   }
   switch (m->type) {
     case LS_MODIFIER_ALONG_STROKE:
-      curvemapping_free(((LineStyleThicknessModifier_AlongStroke *)m)->curve);
+      BKE_curvemapping_free(((LineStyleThicknessModifier_AlongStroke *)m)->curve);
       break;
     case LS_MODIFIER_DISTANCE_FROM_CAMERA:
-      curvemapping_free(((LineStyleThicknessModifier_DistanceFromCamera *)m)->curve);
+      BKE_curvemapping_free(((LineStyleThicknessModifier_DistanceFromCamera *)m)->curve);
       break;
     case LS_MODIFIER_DISTANCE_FROM_OBJECT:
-      curvemapping_free(((LineStyleThicknessModifier_DistanceFromObject *)m)->curve);
+      BKE_curvemapping_free(((LineStyleThicknessModifier_DistanceFromObject *)m)->curve);
       break;
     case LS_MODIFIER_MATERIAL:
-      curvemapping_free(((LineStyleThicknessModifier_Material *)m)->curve);
+      BKE_curvemapping_free(((LineStyleThicknessModifier_Material *)m)->curve);
       break;
     case LS_MODIFIER_CALLIGRAPHY:
       break;
     case LS_MODIFIER_TANGENT:
-      curvemapping_free(((LineStyleThicknessModifier_Tangent *)m)->curve);
+      BKE_curvemapping_free(((LineStyleThicknessModifier_Tangent *)m)->curve);
       break;
     case LS_MODIFIER_NOISE:
       break;
index 0e93c80ecb591350628dc4fc52cc3386405802d5..4a41ffbfa8c07ac7c5cf6730d3df1a11d8d11f4e 100644 (file)
@@ -658,15 +658,16 @@ void BKE_paint_cavity_curve_preset(Paint *p, int preset)
   CurveMap *cm = NULL;
 
   if (!p->cavity_curve) {
-    p->cavity_curve = curvemapping_add(1, 0, 0, 1, 1);
+    p->cavity_curve = BKE_curvemapping_add(1, 0, 0, 1, 1);
   }
 
   cm = p->cavity_curve->cm;
   cm->flag &= ~CUMA_EXTEND_EXTRAPOLATE;
 
   p->cavity_curve->preset = preset;
-  curvemap_reset(cm, &p->cavity_curve->clipr, p->cavity_curve->preset, CURVEMAP_SLOPE_POSITIVE);
-  curvemapping_changed(p->cavity_curve, false);
+  BKE_curvemap_reset(
+      cm, &p->cavity_curve->clipr, p->cavity_curve->preset, CURVEMAP_SLOPE_POSITIVE);
+  BKE_curvemapping_changed(p->cavity_curve, false);
 }
 
 eObjectMode BKE_paint_object_mode_from_paintmode(ePaintMode mode)
@@ -778,7 +779,7 @@ void BKE_paint_init(Main *bmain, Scene *sce, ePaintMode mode, const char col[3])
 
 void BKE_paint_free(Paint *paint)
 {
-  curvemapping_free(paint->cavity_curve);
+  BKE_curvemapping_free(paint->cavity_curve);
   MEM_SAFE_FREE(paint->tool_slots);
 }
 
@@ -789,7 +790,7 @@ void BKE_paint_free(Paint *paint)
 void BKE_paint_copy(Paint *src, Paint *tar, const int flag)
 {
   tar->brush = src->brush;
-  tar->cavity_curve = curvemapping_copy(src->cavity_curve);
+  tar->cavity_curve = BKE_curvemapping_copy(src->cavity_curve);
   tar->tool_slots = MEM_dupallocN(src->tool_slots);
 
   if ((flag & LIB_ID_CREATE_NO_USER_REFCOUNT) == 0) {
index 9cc49e39231eb4a522188759cf3befe2896ab17e..da00a0440095a47353e1437a70d961607d5e112c 100644 (file)
@@ -494,13 +494,13 @@ void BKE_particlesettings_free(ParticleSettings *part)
   }
 
   if (part->clumpcurve) {
-    curvemapping_free(part->clumpcurve);
+    BKE_curvemapping_free(part->clumpcurve);
   }
   if (part->roughcurve) {
-    curvemapping_free(part->roughcurve);
+    BKE_curvemapping_free(part->roughcurve);
   }
   if (part->twistcurve) {
-    curvemapping_free(part->twistcurve);
+    BKE_curvemapping_free(part->twistcurve);
   }
 
   BKE_partdeflect_free(part->pd);
@@ -2060,10 +2060,10 @@ int do_guides(Depsgraph *depsgraph,
       }
 
       if (clumpcurve) {
-        curvemapping_changed_all(clumpcurve);
+        BKE_curvemapping_changed_all(clumpcurve);
       }
       if (roughcurve) {
-        curvemapping_changed_all(roughcurve);
+        BKE_curvemapping_changed_all(roughcurve);
       }
 
       {
@@ -2368,22 +2368,22 @@ static bool psys_thread_context_init_path(ParticleThreadContext *ctx,
 
   /* prepare curvemapping tables */
   if ((part->child_flag & PART_CHILD_USE_CLUMP_CURVE) && part->clumpcurve) {
-    ctx->clumpcurve = curvemapping_copy(part->clumpcurve);
-    curvemapping_changed_all(ctx->clumpcurve);
+    ctx->clumpcurve = BKE_curvemapping_copy(part->clumpcurve);
+    BKE_curvemapping_changed_all(ctx->clumpcurve);
   }
   else {
     ctx->clumpcurve = NULL;
   }
   if ((part->child_flag & PART_CHILD_USE_ROUGH_CURVE) && part->roughcurve) {
-    ctx->roughcurve = curvemapping_copy(part->roughcurve);
-    curvemapping_changed_all(ctx->roughcurve);
+    ctx->roughcurve = BKE_curvemapping_copy(part->roughcurve);
+    BKE_curvemapping_changed_all(ctx->roughcurve);
   }
   else {
     ctx->roughcurve = NULL;
   }
   if ((part->child_flag & PART_CHILD_USE_TWIST_CURVE) && part->twistcurve) {
-    ctx->twistcurve = curvemapping_copy(part->twistcurve);
-    curvemapping_changed_all(ctx->twistcurve);
+    ctx->twistcurve = BKE_curvemapping_copy(part->twistcurve);
+    BKE_curvemapping_changed_all(ctx->twistcurve);
   }
   else {
     ctx->twistcurve = NULL;
@@ -3719,42 +3719,42 @@ ParticleSettings *BKE_particlesettings_add(Main *bmain, const char *name)
 
 void BKE_particlesettings_clump_curve_init(ParticleSettings *part)
 {
-  CurveMapping *cumap = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+  CurveMapping *cumap = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
 
   cumap->cm[0].curve[0].x = 0.0f;
   cumap->cm[0].curve[0].y = 1.0f;
   cumap->cm[0].curve[1].x = 1.0f;
   cumap->cm[0].curve[1].y = 1.0f;
 
-  curvemapping_initialize(cumap);
+  BKE_curvemapping_initialize(cumap);
 
   part->clumpcurve = cumap;
 }
 
 void BKE_particlesettings_rough_curve_init(ParticleSettings *part)
 {
-  CurveMapping *cumap = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+  CurveMapping *cumap = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
 
   cumap->cm[0].curve[0].x = 0.0f;
   cumap->cm[0].curve[0].y = 1.0f;
   cumap->cm[0].curve[1].x = 1.0f;
   cumap->cm[0].curve[1].y = 1.0f;
 
-  curvemapping_initialize(cumap);
+  BKE_curvemapping_initialize(cumap);
 
   part->roughcurve = cumap;
 }
 
 void BKE_particlesettings_twist_curve_init(ParticleSettings *part)
 {
-  CurveMapping *cumap = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+  CurveMapping *cumap = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
 
   cumap->cm[0].curve[0].x = 0.0f;
   cumap->cm[0].curve[0].y = 1.0f;
   cumap->cm[0].curve[1].x = 1.0f;
   cumap->cm[0].curve[1].y = 1.0f;
 
-  curvemapping_initialize(cumap);
+  BKE_curvemapping_initialize(cumap);
 
   part->twistcurve = cumap;
 }
@@ -3780,13 +3780,13 @@ void BKE_particlesettings_copy_data(Main *UNUSED(bmain),
   part_dst->fluid = MEM_dupallocN(part_src->fluid);
 
   if (part_src->clumpcurve) {
-    part_dst->clumpcurve = curvemapping_copy(part_src->clumpcurve);
+    part_dst->clumpcurve = BKE_curvemapping_copy(part_src->clumpcurve);
   }
   if (part_src->roughcurve) {
-    part_dst->roughcurve = curvemapping_copy(part_src->roughcurve);
+    part_dst->roughcurve = BKE_curvemapping_copy(part_src->roughcurve);
   }
   if (part_src->twistcurve) {
-    part_dst->twistcurve = curvemapping_copy(part_src->twistcurve);
+    part_dst->twistcurve = BKE_curvemapping_copy(part_src->twistcurve);
   }
 
   part_dst->boids = boid_copy_settings(part_src->boids);
index b74fd3ff6846bf1a994e9130d7e008a55fe8faa5..3b02e010e7f2fb096b1e0790ece30020ceb0ddec 100644 (file)
@@ -597,7 +597,8 @@ static float do_clump_level(float result[3],
   float clump = 0.0f;
 
   if (clumpcurve) {
-    clump = pa_clump * (1.0f - clamp_f(curvemapping_evaluateF(clumpcurve, 0, time), 0.0f, 1.0f));
+    clump = pa_clump *
+            (1.0f - clamp_f(BKE_curvemapping_evaluateF(clumpcurve, 0, time), 0.0f, 1.0f));
 
     interp_v3_v3v3(result, co, par_co, clump);
   }
@@ -714,7 +715,7 @@ static void do_rough_curve(const float loc[3],
     return;
   }
 
-  fac *= clamp_f(curvemapping_evaluateF(roughcurve, 0, time), 0.0f, 1.0f);
+  fac *= clamp_f(BKE_curvemapping_evaluateF(roughcurve, 0, time), 0.0f, 1.0f);
 
   copy_v3_v3(rco, loc);
   mul_v3_fl(rco, time);
@@ -749,15 +750,15 @@ static void twist_get_axis(const ParticleChildModifierContext *modifier_ctx,
   }
 }
 
-static float curvemapping_integrate_clamped(CurveMapping *curve,
-                                            float start,
-                                            float end,
-                                            float step)
+static float BKE_curvemapping_integrate_clamped(CurveMapping *curve,
+                                                float start,
+                                                float end,
+                                                float step)
 {
   float integral = 0.0f;
   float x = start;
   while (x < end) {
-    float y = curvemapping_evaluateF(curve, 0, x);
+    float y = BKE_curvemapping_evaluateF(curve, 0, x);
     y = clamp_f(y, 0.0f, 1.0f);
     /* TODO(sergey): Clamp last step to end. */
     integral += y * step;
@@ -804,7 +805,7 @@ static void do_twist(const ParticleChildModifierContext *modifier_ctx,
   }
   if (twist_curve != NULL) {
     const int num_segments = twist_num_segments(modifier_ctx);
-    angle *= curvemapping_integrate_clamped(twist_curve, 0.0f, time, 1.0f / num_segments);
+    angle *= BKE_curvemapping_integrate_clamped(twist_curve, 0.0f, time, 1.0f / num_segments);
   }
   else {
     angle *= time;
index 615870d099f9cb7e9e987c8cb163ac24df1691e4..31484b59127e4babbafc0e2183754a1c2a0915f4 100644 (file)
@@ -563,13 +563,13 @@ void psys_thread_context_free(ParticleThreadContext *ctx)
   BLI_kdtree_3d_free(ctx->tree);
 
   if (ctx->clumpcurve != NULL) {
-    curvemapping_free(ctx->clumpcurve);
+    BKE_curvemapping_free(ctx->clumpcurve);
   }
   if (ctx->roughcurve != NULL) {
-    curvemapping_free(ctx->roughcurve);
+    BKE_curvemapping_free(ctx->roughcurve);
   }
   if (ctx->twistcurve != NULL) {
-    curvemapping_free(ctx->twistcurve);
+    BKE_curvemapping_free(ctx->twistcurve);
   }
 }
 
index b582b4f54bdb6288debc261d1f1aa652f3398607..1ef934272533c44ed00726f2fceb8a0ee7a4d50b 100644 (file)
@@ -176,10 +176,10 @@ ToolSettings *BKE_toolsettings_copy(ToolSettings *toolsettings, const int flag)
   ts->particle.object = NULL;
 
   /* duplicate Grease Pencil interpolation curve */
-  ts->gp_interpolate.custom_ipo = curvemapping_copy(ts->gp_interpolate.custom_ipo);
+  ts->gp_interpolate.custom_ipo = BKE_curvemapping_copy(ts->gp_interpolate.custom_ipo);
   /* duplicate Grease Pencil multiframe fallof */
-  ts->gp_sculpt.cur_falloff = curvemapping_copy(ts->gp_sculpt.cur_falloff);
-  ts->gp_sculpt.cur_primitive = curvemapping_copy(ts->gp_sculpt.cur_primitive);
+  ts->gp_sculpt.cur_falloff = BKE_curvemapping_copy(ts->gp_sculpt.cur_falloff);
+  ts->gp_sculpt.cur_primitive = BKE_curvemapping_copy(ts->gp_sculpt.cur_primitive);
   return ts;
 }
 
@@ -212,14 +212,14 @@ void BKE_toolsettings_free(ToolSettings *toolsettings)
 
   /* free Grease Pencil interpolation curve */
   if (toolsettings->gp_interpolate.custom_ipo) {
-    curvemapping_free(toolsettings->gp_interpolate.custom_ipo);
+    BKE_curvemapping_free(toolsettings->gp_interpolate.custom_ipo);
   }
   /* free Grease Pencil multiframe falloff curve */
   if (toolsettings->gp_sculpt.cur_falloff) {
-    curvemapping_free(toolsettings->gp_sculpt.cur_falloff);
+    BKE_curvemapping_free(toolsettings->gp_sculpt.cur_falloff);
   }
   if (toolsettings->gp_sculpt.cur_primitive) {
-    curvemapping_free(toolsettings->gp_sculpt.cur_primitive);
+    BKE_curvemapping_free(toolsettings->gp_sculpt.cur_primitive);
   }
 
   MEM_freeN(toolsettings);
@@ -291,7 +291,7 @@ void BKE_scene_copy_data(Main *bmain, Scene *sce_dst, const Scene *sce_src, cons
   BKE_color_managed_view_settings_copy(&sce_dst->r.bake.im_format.view_settings,
                                        &sce_src->r.bake.im_format.view_settings);
 
-  curvemapping_copy_data(&sce_dst->r.mblur_shutter_curve, &sce_src->r.mblur_shutter_curve);
+  BKE_curvemapping_copy_data(&sce_dst->r.mblur_shutter_curve, &sce_src->r.mblur_shutter_curve);
 
   /* tool settings */
   sce_dst->toolsettings = BKE_toolsettings_copy(sce_dst->toolsettings, flag_subdata);
@@ -347,7 +347,7 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type)
     sce_copy = BKE_scene_add(bmain, sce->id.name + 2);
 
     rv = sce_copy->r.views;
-    curvemapping_free_data(&sce_copy->r.mblur_shutter_curve);
+    BKE_curvemapping_free_data(&sce_copy->r.mblur_shutter_curve);
     sce_copy->r = sce->r;
     sce_copy->r.views = rv;
     sce_copy->unit = sce->unit;
@@ -380,7 +380,7 @@ Scene *BKE_scene_copy(Main *bmain, Scene *sce, int type)
     BKE_color_managed_view_settings_copy(&sce_copy->r.bake.im_format.view_settings,
                                          &sce->r.bake.im_format.view_settings);
 
-    curvemapping_copy_data(&sce_copy->r.mblur_shutter_curve, &sce->r.mblur_shutter_curve);
+    BKE_curvemapping_copy_data(&sce_copy->r.mblur_shutter_curve, &sce->r.mblur_shutter_curve);
 
     /* viewport display settings */
     sce_copy->display = sce->display;
@@ -515,7 +515,7 @@ void BKE_scene_free_ex(Scene *sce, const bool do_id_user)
   BKE_color_managed_view_settings_free(&sce->view_settings);
 
   BKE_previewimg_free(&sce->preview);
-  curvemapping_free_data(&sce->r.mblur_shutter_curve);
+  BKE_curvemapping_free_data(&sce->r.mblur_shutter_curve);
 
   for (ViewLayer *view_layer = sce->view_layers.first, *view_layer_next; view_layer;
        view_layer = view_layer_next) {
@@ -653,12 +653,12 @@ void BKE_scene_init(Scene *sce)
   sce->r.unit_line_thickness = 1.0f;
 
   mblur_shutter_curve = &sce->r.mblur_shutter_curve;
-  curvemapping_set_defaults(mblur_shutter_curve, 1, 0.0f, 0.0f, 1.0f, 1.0f);
-  curvemapping_initialize(mblur_shutter_curve);
-  curvemap_reset(mblur_shutter_curve->cm,
-                 &mblur_shutter_curve->clipr,
-                 CURVE_PRESET_MAX,
-                 CURVEMAP_SLOPE_POS_NEG);
+  BKE_curvemapping_set_defaults(mblur_shutter_curve, 1, 0.0f, 0.0f, 1.0f, 1.0f);
+  BKE_curvemapping_initialize(mblur_shutter_curve);
+  BKE_curvemap_reset(mblur_shutter_curve->cm,
+                     &mblur_shutter_curve->clipr,
+                     CURVE_PRESET_MAX,
+                     CURVEMAP_SLOPE_POS_NEG);
 
   sce->toolsettings = MEM_callocN(sizeof(struct ToolSettings), "Tool Settings Struct");
 
@@ -704,19 +704,19 @@ void BKE_scene_init(Scene *sce)
   sce->toolsettings->imapaint.seam_bleed = 2;
 
   /* grease pencil multiframe falloff curve */
-  sce->toolsettings->gp_sculpt.cur_falloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+  sce->toolsettings->gp_sculpt.cur_falloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
   CurveMapping *gp_falloff_curve = sce->toolsettings->gp_sculpt.cur_falloff;
-  curvemapping_initialize(gp_falloff_curve);
-  curvemap_reset(
+  BKE_curvemapping_initialize(gp_falloff_curve);
+  BKE_curvemap_reset(
       gp_falloff_curve->cm, &gp_falloff_curve->clipr, CURVE_PRESET_GAUSS, CURVEMAP_SLOPE_POSITIVE);
 
-  sce->toolsettings->gp_sculpt.cur_primitive = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+  sce->toolsettings->gp_sculpt.cur_primitive = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
   CurveMapping *gp_primitive_curve = sce->toolsettings->gp_sculpt.cur_primitive;
-  curvemapping_initialize(gp_primitive_curve);
-  curvemap_reset(gp_primitive_curve->cm,
-                 &gp_primitive_curve->clipr,
-                 CURVE_PRESET_BELL,
-                 CURVEMAP_SLOPE_POSITIVE);
+  BKE_curvemapping_initialize(gp_primitive_curve);
+  BKE_curvemap_reset(gp_primitive_curve->cm,
+                     &gp_primitive_curve->clipr,
+                     CURVE_PRESET_BELL,
+                     CURVEMAP_SLOPE_POSITIVE);
 
   sce->toolsettings->gp_sculpt.guide.spacing = 20.0f;
 
index aceb8b7e4adb178a20ffa5b27c4cdda768b19507..a7543881dadfdb9683991b3b096dbe61134348fe 100644 (file)
@@ -293,14 +293,14 @@ static void curves_init_data(SequenceModifierData *smd)
 {
   CurvesModifierData *cmd = (CurvesModifierData *)smd;
 
-  curvemapping_set_defaults(&cmd->curve_mapping, 4, 0.0f, 0.0f, 1.0f, 1.0f);
+  BKE_curvemapping_set_defaults(&cmd->curve_mapping, 4, 0.0f, 0.0f, 1.0f, 1.0f);
 }
 
 static void curves_free_data(SequenceModifierData *smd)
 {
   CurvesModifierData *cmd = (CurvesModifierData *)smd;
 
-  curvemapping_free_data(&cmd->curve_mapping);
+  BKE_curvemapping_free_data(&cmd->curve_mapping);
 }
 
 static void curves_copy_data(SequenceModifierData *target, SequenceModifierData *smd)
@@ -308,7 +308,7 @@ static void curves_copy_data(SequenceModifierData *target, SequenceModifierData
   CurvesModifierData *cmd = (CurvesModifierData *)smd;
   CurvesModifierData *cmd_target = (CurvesModifierData *)target;
 
-  curvemapping_copy_data(&cmd_target->curve_mapping, &cmd->curve_mapping);
+  BKE_curvemapping_copy_data(&cmd_target->curve_mapping, &cmd->curve_mapping);
 }
 
 static void curves_apply_threaded(int width,
@@ -330,7 +330,7 @@ static void curves_apply_threaded(int width,
         float *pixel = rect_float + pixel_index;
         float result[3];
 
-        curvemapping_evaluate_premulRGBF(curve_mapping, result, pixel);
+        BKE_curvemapping_evaluate_premulRGBF(curve_mapping, result, pixel);
 
         if (mask_rect_float) {
           const float *m = mask_rect_float + pixel_index;
@@ -351,7 +351,7 @@ static void curves_apply_threaded(int width,
 
         straight_uchar_to_premul_float(tempc, pixel);
 
-        curvemapping_evaluate_premulRGBF(curve_mapping, result, tempc);
+        BKE_curvemapping_evaluate_premulRGBF(curve_mapping, result, tempc);
 
         if (mask_rect) {
           float t[3];
@@ -381,14 +381,14 @@ static void curves_apply(struct SequenceModifierData *smd, ImBuf *ibuf, ImBuf *m
   float black[3] = {0.0f, 0.0f, 0.0f};
   float white[3] = {1.0f, 1.0f, 1.0f};
 
-  curvemapping_initialize(&cmd->curve_mapping);
+  BKE_curvemapping_initialize(&cmd->curve_mapping);
 
-  curvemapping_premultiply(&cmd->curve_mapping, 0);
-  curvemapping_set_black_white(&cmd->curve_mapping, black, white);
+  BKE_curvemapping_premultiply(&cmd->curve_mapping, 0);
+  BKE_curvemapping_set_black_white(&cmd->curve_mapping, black, white);
 
   modifier_apply_threaded(ibuf, mask, curves_apply_threaded, &cmd->curve_mapping);
 
-  curvemapping_premultiply(&cmd->curve_mapping, 1);
+  BKE_curvemapping_premultiply(&cmd->curve_mapping, 1);
 }
 
 static SequenceModifierTypeInfo seqModifier_Curves = {
@@ -408,13 +408,13 @@ static void hue_correct_init_data(SequenceModifierData *smd)
   HueCorrectModifierData *hcmd = (HueCorrectModifierData *)smd;
   int c;
 
-  curvemapping_set_defaults(&hcmd->curve_mapping, 1, 0.0f, 0.0f, 1.0f, 1.0f);
+  BKE_curvemapping_set_defaults(&hcmd->curve_mapping, 1, 0.0f, 0.0f, 1.0f, 1.0f);
   hcmd->curve_mapping.preset = CURVE_PRESET_MID9;
 
   for (c = 0; c < 3; c++) {
     CurveMap *cuma = &hcmd->curve_mapping.cm[c];
 
-    curvemap_reset(
+    BKE_curvemap_reset(
         cuma, &hcmd->curve_mapping.clipr, hcmd->curve_mapping.preset, CURVEMAP_SLOPE_POSITIVE);
   }
 
@@ -426,7 +426,7 @@ static void hue_correct_free_data(SequenceModifierData *smd)
 {
   HueCorrectModifierData *hcmd = (HueCorrectModifierData *)smd;
 
-  curvemapping_free_data(&hcmd->curve_mapping);
+  BKE_curvemapping_free_data(&hcmd->curve_mapping);
 }
 
 static void hue_correct_copy_data(SequenceModifierData *target, SequenceModifierData *smd)
@@ -434,7 +434,7 @@ static void hue_correct_copy_data(SequenceModifierData *target, SequenceModifier
   HueCorrectModifierData *hcmd = (HueCorrectModifierData *)smd;
   HueCorrectModifierData *hcmd_target = (HueCorrectModifierData *)target;
 
-  curvemapping_copy_data(&hcmd_target->curve_mapping, &hcmd->curve_mapping);
+  BKE_curvemapping_copy_data(&hcmd_target->curve_mapping, &hcmd->curve_mapping);
 }
 
 static void hue_correct_apply_threaded(int width,
@@ -464,15 +464,15 @@ static void hue_correct_apply_threaded(int width,
       rgb_to_hsv(pixel[0], pixel[1], pixel[2], hsv, hsv + 1, hsv + 2);
 
       /* adjust hue, scaling returned default 0.5 up to 1 */
-      f = curvemapping_evaluateF(curve_mapping, 0, hsv[0]);
+      f = BKE_curvemapping_evaluateF(curve_mapping, 0, hsv[0]);
       hsv[0] += f - 0.5f;
 
       /* adjust saturation, scaling returned default 0.5 up to 1 */
-      f = curvemapping_evaluateF(curve_mapping, 1, hsv[0]);
+      f = BKE_curvemapping_evaluateF(curve_mapping, 1, hsv[0]);
       hsv[1] *= (f * 2.0f);
 
       /* adjust value, scaling returned default 0.5 up to 1 */
-      f = curvemapping_evaluateF(curve_mapping, 2, hsv[0]);
+      f = BKE_curvemapping_evaluateF(curve_mapping, 2, hsv[0]);
       hsv[2] *= (f * 2.f);
 
       hsv[0] = hsv[0] - floorf(hsv[0]); /* mod 1.0 */
@@ -506,7 +506,7 @@ static void hue_correct_apply(struct SequenceModifierData *smd, ImBuf *ibuf, ImB
 {
   HueCorrectModifierData *hcmd = (HueCorrectModifierData *)smd;
 
-  curvemapping_initialize(&hcmd->curve_mapping);
+  BKE_curvemapping_initialize(&hcmd->curve_mapping);
 
   modifier_apply_threaded(ibuf, mask, hue_correct_apply_threaded, &hcmd->curve_mapping);
 }
index 688af539bbb38bc0b1a145cb9c1e3ce09ade0c96..74873db179dde1a6cfe5a90280f6ecbae3e21c9a 100644 (file)
@@ -1428,13 +1428,13 @@ static void emit_from_particles(Object *flow_ob,
 
     /* prepare curvemapping tables */
     if ((psys->part->child_flag & PART_CHILD_USE_CLUMP_CURVE) && psys->part->clumpcurve) {
-      curvemapping_changed_all(psys->part->clumpcurve);
+      BKE_curvemapping_changed_all(psys->part->clumpcurve);
     }
     if ((psys->part->child_flag & PART_CHILD_USE_ROUGH_CURVE) && psys->part->roughcurve) {
-      curvemapping_changed_all(psys->part->roughcurve);
+      BKE_curvemapping_changed_all(psys->part->roughcurve);
     }
     if ((psys->part->child_flag & PART_CHILD_USE_TWIST_CURVE) && psys->part->twistcurve) {
-      curvemapping_changed_all(psys->part->twistcurve);
+      BKE_curvemapping_changed_all(psys->part->twistcurve);
     }
 
     /* initialize particle cache */
index 9baa8bd20e17f9bcc6c7efb44962b14ecc39ca71..ad7c5e3f660ba11f2f4fc5e6e71e9859fb2d4cc2 100644 (file)
@@ -659,15 +659,15 @@ void BKE_texture_pointdensity_init_data(PointDensity *pd)
   pd->object = NULL;
   pd->psys = 0;
   pd->psys_cache_space = TEX_PD_WORLDSPACE;
-  pd->falloff_curve = curvemapping_add(1, 0, 0, 1, 1);
+  pd->falloff_curve = BKE_curvemapping_add(1, 0, 0, 1, 1);
 
   pd->falloff_curve->preset = CURVE_PRESET_LINE;
   pd->falloff_curve->cm->flag &= ~CUMA_EXTEND_EXTRAPOLATE;
-  curvemap_reset(pd->falloff_curve->cm,
-                 &pd->falloff_curve->clipr,
-                 pd->falloff_curve->preset,
-                 CURVEMAP_SLOPE_POSITIVE);
-  curvemapping_changed(pd->falloff_curve, false);
+  BKE_curvemap_reset(pd->falloff_curve->cm,
+                     &pd->falloff_curve->clipr,
+                     pd->falloff_curve->preset,
+                     CURVEMAP_SLOPE_POSITIVE);
+  BKE_curvemapping_changed(pd->falloff_curve, false);
 }
 
 PointDensity *BKE_texture_pointdensity_add(void)
@@ -687,7 +687,7 @@ PointDensity *BKE_texture_pointdensity_copy(const PointDensity *pd, const int UN
   if (pdn->coba) {
     pdn->coba = MEM_dupallocN(pdn->coba);
   }
-  pdn->falloff_curve = curvemapping_copy(pdn->falloff_curve); /* can be NULL */
+  pdn->falloff_curve = BKE_curvemapping_copy(pdn->falloff_curve); /* can be NULL */
   return pdn;
 }
 
@@ -706,7 +706,7 @@ void BKE_texture_pointdensity_free_data(PointDensity *pd)
     pd->coba = NULL;
   }
 
-  curvemapping_free(pd->falloff_curve); /* can be NULL */
+  BKE_curvemapping_free(pd->falloff_curve); /* can be NULL */
 }
 
 void BKE_texture_pointdensity_free(PointDensity *pd)
index 516cead37c1a7db49d8ff60d367a030121b4eda1..737a70615aea59e2c52e66b02e8887cf83a1902b 100644 (file)
@@ -5841,7 +5841,7 @@ static void direct_link_gpencil_modifiers(FileData *fd, ListBase *lb)
       if (gpmd->curve_thickness) {
         direct_link_curvemapping(fd, gpmd->curve_thickness);
         /* initialize the curve. Maybe this could be moved to modififer logic */
-        curvemapping_initialize(gpmd->curve_thickness);
+        BKE_curvemapping_initialize(gpmd->curve_thickness);
       }
     }
   }
index 81751a6ed070830461567b0880081c3699bc665c..6a5cfc45628446de6e71288ef993837b7b40d354 100644 (file)
@@ -1555,7 +1555,7 @@ void blo_do_versions_250(FileData *fd, Library *lib, Main *bmain)
         for (sl = sa->spacedata.first; sl; sl = sl->next) {
           if (sl->spacetype == SPACE_IMAGE) {
             SpaceImage *sima = (SpaceImage *)sl;
-            scopes_new(&sima->scopes);
+            BKE_scopes_new(&sima->scopes);
           }
         }
       }
index 3dc79308f64ca632ab5dce7aea87d5ff2eda09dc..b61692799edb1351000723b3d3cc81ec4242dc62 100644 (file)
@@ -1103,9 +1103,9 @@ void blo_do_versions_270(FileData *fd, Library *UNUSED(lib), Main *bmain)
       Scene *scene;
       for (scene = bmain->scenes.first; scene != NULL; scene = scene->id.next) {
         CurveMapping *curve_mapping = &scene->r.mblur_shutter_curve;
-        curvemapping_set_defaults(curve_mapping, 1, 0.0f, 0.0f, 1.0f, 1.0f);
-        curvemapping_initialize(curve_mapping);
-        curvemap_reset(
+        BKE_curvemapping_set_defaults(curve_mapping, 1, 0.0f, 0.0f, 1.0f, 1.0f);
+        BKE_curvemapping_initialize(curve_mapping);
+        BKE_curvemap_reset(
             curve_mapping->cm, &curve_mapping->clipr, CURVE_PRESET_MAX, CURVEMAP_SLOPE_POS_NEG);
       }
     }
index 0dbb1a92f309babaac465edf47ec7e9f676f7e1e..15b4f513050eaa9921df777fffe6f912e2c701a2 100644 (file)
@@ -1347,12 +1347,12 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
           /* sculpt brushes */
           GP_Sculpt_Settings *gset = &scene->toolsettings->gp_sculpt;
           if ((gset) && (gset->cur_falloff == NULL)) {
-            gset->cur_falloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
-            curvemapping_initialize(gset->cur_falloff);
-            curvemap_reset(gset->cur_falloff->cm,
-                           &gset->cur_falloff->clipr,
-                           CURVE_PRESET_GAUSS,
-                           CURVEMAP_SLOPE_POSITIVE);
+            gset->cur_falloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+            BKE_curvemapping_initialize(gset->cur_falloff);
+            BKE_curvemap_reset(gset->cur_falloff->cm,
+                               &gset->cur_falloff->clipr,
+                               CURVE_PRESET_GAUSS,
+                               CURVEMAP_SLOPE_POSITIVE);
           }
         }
       }
@@ -2748,12 +2748,12 @@ void blo_do_versions_280(FileData *fd, Library *UNUSED(lib), Main *bmain)
       for (Scene *scene = bmain->scenes.first; scene; scene = scene->id.next) {
         GP_Sculpt_Settings *gset = &scene->toolsettings->gp_sculpt;
         if ((gset) && (gset->cur_primitive == NULL)) {
-          gset->cur_primitive = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
-          curvemapping_initialize(gset->cur_primitive);
-          curvemap_reset(gset->cur_primitive->cm,
-                         &gset->cur_primitive->clipr,
-                         CURVE_PRESET_BELL,
-                         CURVEMAP_SLOPE_POSITIVE);
+          gset->cur_primitive = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+          BKE_curvemapping_initialize(gset->cur_primitive);
+          BKE_curvemap_reset(gset->cur_primitive->cm,
+                             &gset->cur_primitive->clipr,
+                             CURVE_PRESET_BELL,
+                             CURVEMAP_SLOPE_POSITIVE);
         }
       }
     }
index 92113723aabb32d0e6844ade36c544dd17bed112..cebe15e2719572f044b66037347c147e3df80f0b 100644 (file)
@@ -231,7 +231,7 @@ static void vector_curve_node_remap(bNode *node)
       }
     }
 
-    curvemapping_changed_all(mapping);
+    BKE_curvemapping_changed_all(mapping);
   }
 }
 
index 14230752d1f325834dcd5b020423f1cd8adbbb2d..fa69892584a76dc00eeeec2e8fb28a157a6c139e 100644 (file)
@@ -268,22 +268,22 @@ static void blo_update_defaults_scene(Main *bmain, Scene *scene)
   /* Be sure curfalloff and primitive are initializated */
   ToolSettings *ts = scene->toolsettings;
   if (ts->gp_sculpt.cur_falloff == NULL) {
-    ts->gp_sculpt.cur_falloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+    ts->gp_sculpt.cur_falloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
     CurveMapping *gp_falloff_curve = ts->gp_sculpt.cur_falloff;
-    curvemapping_initialize(gp_falloff_curve);
-    curvemap_reset(gp_falloff_curve->cm,
-                   &gp_falloff_curve->clipr,
-                   CURVE_PRESET_GAUSS,
-                   CURVEMAP_SLOPE_POSITIVE);
+    BKE_curvemapping_initialize(gp_falloff_curve);
+    BKE_curvemap_reset(gp_falloff_curve->cm,
+                       &gp_falloff_curve->clipr,
+                       CURVE_PRESET_GAUSS,
+                       CURVEMAP_SLOPE_POSITIVE);
   }
   if (ts->gp_sculpt.cur_primitive == NULL) {
-    ts->gp_sculpt.cur_primitive = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+    ts->gp_sculpt.cur_primitive = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
     CurveMapping *gp_primitive_curve = ts->gp_sculpt.cur_primitive;
-    curvemapping_initialize(gp_primitive_curve);
-    curvemap_reset(gp_primitive_curve->cm,
-                   &gp_primitive_curve->clipr,
-                   CURVE_PRESET_BELL,
-                   CURVEMAP_SLOPE_POSITIVE);
+    BKE_curvemapping_initialize(gp_primitive_curve);
+    BKE_curvemap_reset(gp_primitive_curve->cm,
+                       &gp_primitive_curve->clipr,
+                       CURVE_PRESET_BELL,
+                       CURVEMAP_SLOPE_POSITIVE);
   }
 
   /* Correct default startup UV's. */
index 0f1d7cbf70f4ec34b09694f134bbed68e6acb9cc..9b6f252f62d030fb4af8997c23189bac50d76815 100644 (file)
@@ -2094,8 +2094,8 @@ void blo_do_versions_pre250(FileData *fd, Library *lib, Main *bmain)
         la->falloff_type = LA_FALLOFF_INVLINEAR;
 
         if (la->curfalloff == NULL) {
-          la->curfalloff = curvemapping_add(1, 0.0f, 1.0f, 1.0f, 0.0f);
-          curvemapping_initialize(la->curfalloff);
+          la->curfalloff = BKE_curvemapping_add(1, 0.0f, 1.0f, 1.0f, 0.0f);
+          BKE_curvemapping_initialize(la->curfalloff);
         }
       }
     }
index 45604882992827e3cffde435f4b2dc023ca405ee..2a30ee9c574b8c70be6be3dcb3a273870f06a6a5 100644 (file)
@@ -49,8 +49,8 @@ void TimeNode::convertToOperations(NodeConverter &converter,
     fac = (context.getFramenumber() - node->custom1) / (float)(node->custom2 - node->custom1);
   }
 
-  curvemapping_initialize((CurveMapping *)node->storage);
-  fac = curvemapping_evaluateF((CurveMapping *)node->storage, 0, fac);
+  BKE_curvemapping_initialize((CurveMapping *)node->storage);
+  fac = BKE_curvemapping_evaluateF((CurveMapping *)node->storage, 0, fac);
   operation->setValue(clamp_f(fac, 0.0f, 1.0f));
   converter.addOperation(operation);
 
index e25ef49cf28b5ecb0802b4697eea9cf1a7d42661..90d3a60abd0b208609dbaabe94bcb3d73249535b 100644 (file)
@@ -50,7 +50,7 @@ void ColorCurveOperation::initExecution()
   this->m_inputBlackProgram = this->getInputSocketReader(2);
   this->m_inputWhiteProgram = this->getInputSocketReader(3);
 
-  curvemapping_premultiply(this->m_curveMapping, 0);
+  BKE_curvemapping_premultiply(this->m_curveMapping, 0);
 }
 
 void ColorCurveOperation::executePixelSampled(float output[4],
@@ -73,20 +73,20 @@ void ColorCurveOperation::executePixelSampled(float output[4],
 
   /* get our own local bwmul value,
    * since we can't be threadsafe and use cumap->bwmul & friends */
-  curvemapping_set_black_white_ex(black, white, bwmul);
+  BKE_curvemapping_set_black_white_ex(black, white, bwmul);
 
   this->m_inputFacProgram->readSampled(fac, x, y, sampler);
   this->m_inputImageProgram->readSampled(image, x, y, sampler);
 
   if (*fac >= 1.0f) {
-    curvemapping_evaluate_premulRGBF_ex(cumap, output, image, black, bwmul);
+    BKE_curvemapping_evaluate_premulRGBF_ex(cumap, output, image, black, bwmul);
   }
   else if (*fac <= 0.0f) {
     copy_v3_v3(output, image);
   }
   else {
     float col[4];
-    curvemapping_evaluate_premulRGBF_ex(cumap, col, image, black, bwmul);
+    BKE_curvemapping_evaluate_premulRGBF_ex(cumap, col, image, black, bwmul);
     interp_v3_v3v3(output, image, col, *fac);
   }
   output[3] = image[3];
@@ -120,9 +120,9 @@ void ConstantLevelColorCurveOperation::initExecution()
   this->m_inputFacProgram = this->getInputSocketReader(0);
   this->m_inputImageProgram = this->getInputSocketReader(1);
 
-  curvemapping_premultiply(this->m_curveMapping, 0);
+  BKE_curvemapping_premultiply(this->m_curveMapping, 0);
 
-  curvemapping_set_black_white(this->m_curveMapping, this->m_black, this->m_white);
+  BKE_curvemapping_set_black_white(this->m_curveMapping, this->m_black, this->m_white);
 }
 
 void ConstantLevelColorCurveOperation::executePixelSampled(float output[4],
@@ -137,14 +137,14 @@ void ConstantLevelColorCurveOperation::executePixelSampled(float output[4],
   this->m_inputImageProgram->readSampled(image, x, y, sampler);
 
   if (*fac >= 1.0f) {
-    curvemapping_evaluate_premulRGBF(this->m_curveMapping, output, image);
+    BKE_curvemapping_evaluate_premulRGBF(this->m_curveMapping, output, image);
   }
   else if (*fac <= 0.0f) {
     copy_v3_v3(output, image);
   }
   else {
     float col[4];
-    curvemapping_evaluate_premulRGBF(this->m_curveMapping, col, image);
+    BKE_curvemapping_evaluate_premulRGBF(this->m_curveMapping, col, image);
     interp_v3_v3v3(output, image, col, *fac);
   }
   output[3] = image[3];
index d84af71d8d83f490a26c026de022ea0cd70b69fa..858931ad46def013e10773a89de80301832d0073 100644 (file)
@@ -34,19 +34,19 @@ CurveBaseOperation::CurveBaseOperation() : NodeOperation()
 CurveBaseOperation::~CurveBaseOperation()
 {
   if (this->m_curveMapping) {
-    curvemapping_free(this->m_curveMapping);
+    BKE_curvemapping_free(this->m_curveMapping);
     this->m_curveMapping = NULL;
   }
 }
 
 void CurveBaseOperation::initExecution()
 {
-  curvemapping_initialize(this->m_curveMapping);
+  BKE_curvemapping_initialize(this->m_curveMapping);
 }
 void CurveBaseOperation::deinitExecution()
 {
   if (this->m_curveMapping) {
-    curvemapping_free(this->m_curveMapping);
+    BKE_curvemapping_free(this->m_curveMapping);
     this->m_curveMapping = NULL;
   }
 }
@@ -55,7 +55,7 @@ void CurveBaseOperation::setCurveMapping(CurveMapping *mapping)
 {
   /* duplicate the curve to avoid glitches while drawing, see bug [#32374] */
   if (this->m_curveMapping) {
-    curvemapping_free(this->m_curveMapping);
+    BKE_curvemapping_free(this->m_curveMapping);
   }
-  this->m_curveMapping = curvemapping_copy(mapping);
+  this->m_curveMapping = BKE_curvemapping_copy(mapping);
 }
index 61ad4248fb031905db0fb9112c1e5f9851bc7f59..fae280249de968a61ceba91f3fde90477572df4c 100644 (file)
@@ -51,15 +51,15 @@ void HueSaturationValueCorrectOperation::executePixelSampled(float output[4],
   this->m_inputProgram->readSampled(hsv, x, y, sampler);
 
   /* adjust hue, scaling returned default 0.5 up to 1 */
-  f = curvemapping_evaluateF(this->m_curveMapping, 0, hsv[0]);
+  f = BKE_curvemapping_evaluateF(this->m_curveMapping, 0, hsv[0]);
   hsv[0] += f - 0.5f;
 
   /* adjust saturation, scaling returned default 0.5 up to 1 */
-  f = curvemapping_evaluateF(this->m_curveMapping, 1, hsv[0]);
+  f = BKE_curvemapping_evaluateF(this->m_curveMapping, 1, hsv[0]);
   hsv[1] *= (f * 2.0f);
 
   /* adjust value, scaling returned default 0.5 up to 1 */
-  f = curvemapping_evaluateF(this->m_curveMapping, 2, hsv[0]);
+  f = BKE_curvemapping_evaluateF(this->m_curveMapping, 2, hsv[0]);
   hsv[2] *= (f * 2.0f);
 
   hsv[0] = hsv[0] - floorf(hsv[0]); /* mod 1.0 */
index 850aef122f4b1001648450d5e2a982eac68a74a1..6996c7ecb71ccad15f1c53680f09d901d4e990ba 100644 (file)
@@ -48,7 +48,7 @@ void VectorCurveOperation::executePixelSampled(float output[4],
 
   this->m_inputProgram->readSampled(input, x, y, sampler);
 
-  curvemapping_evaluate_premulRGBF(this->m_curveMapping, output, input);
+  BKE_curvemapping_evaluate_premulRGBF(this->m_curveMapping, output, input);
 }
 
 void VectorCurveOperation::deinitExecution()
index 1a7422cd1749ce21b058451858d08f6fe7ef3afb..8e4d2655ef0a88385f4a91ffc0820c827e37cdeb 100644 (file)
@@ -1283,7 +1283,7 @@ static bool gpsculpt_brush_init(bContext *C, wmOperator *op)
   /* Init multi-edit falloff curve data before doing anything,
    * so we won't have to do it again later. */
   if (gso->is_multiframe) {
-    curvemapping_initialize(ts->gp_sculpt.cur_falloff);
+    BKE_curvemapping_initialize(ts->gp_sculpt.cur_falloff);
   }
 
   /* initialise custom data for brushes */
index 698e508a2a5291d4bb51ec4e1226c4ea85c26d90..86de9a75a5620f89232c822e227e13f7225835fa 100644 (file)
@@ -1003,7 +1003,7 @@ static int gpencil_interpolate_seq_exec(bContext *C, wmOperator *op)
       if (ipo_settings->type == GP_IPO_CURVEMAP) {
         /* custom curvemap */
         if (ipo_settings->custom_ipo) {
-          factor = curvemapping_evaluateF(ipo_settings->custom_ipo, 0, factor);
+          factor = BKE_curvemapping_evaluateF(ipo_settings->custom_ipo, 0, factor);
         }
         else {
           BKE_report(op->reports, RPT_ERROR, "Custom interpolation curve does not exist");
index a271274fa71d2b4e861036e1c73d5ec6ffe52b41..06ff0e744b92b9ac5433a189366d1a45e6d3ccb6 100644 (file)
@@ -476,7 +476,7 @@ static void gp_brush_jitter(bGPdata *gpd,
 {
   float tmp_pressure = pressure;
   if (brush->gpencil_settings->draw_jitter > 0.0f) {
-    float curvef = curvemapping_evaluateF(brush->gpencil_settings->curve_jitter, 0, pressure);
+    float curvef = BKE_curvemapping_evaluateF(brush->gpencil_settings->curve_jitter, 0, pressure);
     tmp_pressure = curvef * brush->gpencil_settings->draw_sensitivity;
   }
   /* exponential value */
@@ -671,7 +671,7 @@ static short gp_stroke_addpoint(tGPsdata *p, const float mval[2], float pressure
     /* store settings */
     /* pressure */
     if (brush->gpencil_settings->flag & GP_BRUSH_USE_PRESSURE) {
-      float curvef = curvemapping_evaluateF(
+      float curvef = BKE_curvemapping_evaluateF(
           brush->gpencil_settings->curve_sensitivity, 0, pressure);
       pt->pressure = curvef * brush->gpencil_settings->draw_sensitivity;
     }
@@ -695,7 +695,7 @@ static short gp_stroke_addpoint(tGPsdata *p, const float mval[2], float pressure
     /* apply randomness to pressure */
     if ((brush->gpencil_settings->flag & GP_BRUSH_GROUP_RANDOM) &&
         (brush->gpencil_settings->draw_random_press > 0.0f)) {
-      float curvef = curvemapping_evaluateF(
+      float curvef = BKE_curvemapping_evaluateF(
           brush->gpencil_settings->curve_sensitivity, 0, pressure);
       float tmp_pressure = curvef * brush->gpencil_settings->draw_sensitivity;
       if (BLI_rng_get_float(p->rng) > 0.5f) {
@@ -731,7 +731,8 @@ static short gp_stroke_addpoint(tGPsdata *p, const float mval[2], float pressure
 
     /* color strength */
     if (brush->gpencil_settings->flag & GP_BRUSH_USE_STENGTH_PRESSURE) {
-      float curvef = curvemapping_evaluateF(brush->gpencil_settings->curve_strength, 0, pressure);
+      float curvef = BKE_curvemapping_evaluateF(
+          brush->gpencil_settings->curve_strength, 0, pressure);
       float tmp_pressure = curvef * brush->gpencil_settings->draw_sensitivity;
 
       pt->strength = tmp_pressure * brush->gpencil_settings->draw_strength;
@@ -1809,9 +1810,9 @@ static void gp_init_drawing_brush(bContext *C, tGPsdata *p)
     changed = true;
   }
   /* be sure curves are initializated */
-  curvemapping_initialize(paint->brush->gpencil_settings->curve_sensitivity);
-  curvemapping_initialize(paint->brush->gpencil_settings->curve_strength);
-  curvemapping_initialize(paint->brush->gpencil_settings->curve_jitter);
+  BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_sensitivity);
+  BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_strength);
+  BKE_curvemapping_initialize(paint->brush->gpencil_settings->curve_jitter);
 
   /* assign to temp tGPsdata */
   p->brush = paint->brush;
index 816517d6ef9bff47bc9a88bf7487eaf774e48b85..25913fe821a206f83610a20a0dd6c9a56d3ef59b 100644 (file)
@@ -704,13 +704,13 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi)
   gp_session_validatebuffer(tgpi);
   gp_init_colors(tgpi);
   if (gset->flag & GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE) {
-    curvemapping_initialize(ts->gp_sculpt.cur_primitive);
+    BKE_curvemapping_initialize(ts->gp_sculpt.cur_primitive);
   }
   if (tgpi->brush->gpencil_settings->flag & GP_BRUSH_USE_JITTER_PRESSURE) {
-    curvemapping_initialize(tgpi->brush->gpencil_settings->curve_jitter);
+    BKE_curvemapping_initialize(tgpi->brush->gpencil_settings->curve_jitter);
   }
   if (tgpi->brush->gpencil_settings->flag & GP_BRUSH_USE_STENGTH_PRESSURE) {
-    curvemapping_initialize(tgpi->brush->gpencil_settings->curve_strength);
+    BKE_curvemapping_initialize(tgpi->brush->gpencil_settings->curve_strength);
   }
 
   /* get an array of depths, far depths are blended */
@@ -834,7 +834,7 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi)
     /* normalize value to evaluate curve */
     if (gset->flag & GP_SCULPT_SETT_FLAG_PRIMITIVE_CURVE) {
       float value = (float)i / (gps->totpoints - 1);
-      curve_pressure = curvemapping_evaluateF(gset->cur_primitive, 0, value);
+      curve_pressure = BKE_curvemapping_evaluateF(gset->cur_primitive, 0, value);
       pressure = curve_pressure;
     }
 
@@ -844,7 +844,8 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi)
       float jitter;
 
       if (brush->gpencil_settings->flag & GP_BRUSH_USE_JITTER_PRESSURE) {
-        jitter = curvemapping_evaluateF(brush->gpencil_settings->curve_jitter, 0, curve_pressure);
+        jitter = BKE_curvemapping_evaluateF(
+            brush->gpencil_settings->curve_jitter, 0, curve_pressure);
         jitter *= brush->gpencil_settings->draw_sensitivity;
       }
       else {
@@ -890,7 +891,7 @@ static void gp_primitive_update_strokes(bContext *C, tGPDprimitive *tgpi)
 
     /* color strength */
     if (brush->gpencil_settings->flag & GP_BRUSH_USE_STENGTH_PRESSURE) {
-      float curvef = curvemapping_evaluateF(
+      float curvef = BKE_curvemapping_evaluateF(
           brush->gpencil_settings->curve_strength, 0, curve_pressure);
       strength *= curvef * brush->gpencil_settings->draw_sensitivity;
       strength *= brush->gpencil_settings->draw_strength;
index a475e43755c910144e9eaed3182a534450b17545..2a0f16a4bbf56bb1563e270ed649cd675fb1e5e2 100644 (file)
@@ -1396,13 +1396,13 @@ void ED_gpencil_add_defaults(bContext *C, Object *ob)
 
   /* ensure multiframe falloff curve */
   if (ts->gp_sculpt.cur_falloff == NULL) {
-    ts->gp_sculpt.cur_falloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+    ts->gp_sculpt.cur_falloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
     CurveMapping *gp_falloff_curve = ts->gp_sculpt.cur_falloff;
-    curvemapping_initialize(gp_falloff_curve);
-    curvemap_reset(gp_falloff_curve->cm,
-                   &gp_falloff_curve->clipr,
-                   CURVE_PRESET_GAUSS,
-                   CURVEMAP_SLOPE_POSITIVE);
+    BKE_curvemapping_initialize(gp_falloff_curve);
+    BKE_curvemap_reset(gp_falloff_curve->cm,
+                       &gp_falloff_curve->clipr,
+                       CURVE_PRESET_GAUSS,
+                       CURVEMAP_SLOPE_POSITIVE);
   }
 }
 
index aa5d392e08ea95bf8fb3ee892ee8b5dfb972c3e9..76630de96dbcfefa7b1a83120e38475f0771ca5e 100644 (file)
@@ -1997,7 +1997,7 @@ void ui_draw_but_CURVE(ARegion *ar, uiBut *but, const uiWidgetColors *wcol, cons
   immUnbindProgram();
 
   if (cuma->table == NULL) {
-    curvemapping_changed(cumap, false);
+    BKE_curvemapping_changed(cumap, false);
   }
 
   CurveMapPoint *cmp = cuma->table;
index 245277c8d227d6daf9cd3d4b3fdef84cbe4a3521..52933a890450887a29f7093bb0e53a936111be80 100644 (file)
@@ -2386,8 +2386,8 @@ static void ui_but_copy_curvemapping(uiBut *but)
 {
   if (but->poin != NULL) {
     but_copypaste_curve_alive = true;
-    curvemapping_free_data(&but_copypaste_curve);
-    curvemapping_copy_data(&but_copypaste_curve, (CurveMapping *)but->poin);
+    BKE_curvemapping_free_data(&but_copypaste_curve);
+    BKE_curvemapping_copy_data(&but_copypaste_curve, (CurveMapping *)but->poin);
   }
 }
 
@@ -2399,8 +2399,8 @@ static void ui_but_paste_curvemapping(bContext *C, uiBut *but)
     }
 
     button_activate_state(C, but, BUTTON_STATE_NUM_EDITING);
-    curvemapping_free_data((CurveMapping *)but->poin);
-    curvemapping_copy_data((CurveMapping *)but->poin, &but_copypaste_curve);
+    BKE_curvemapping_free_data((CurveMapping *)but->poin);
+    BKE_curvemapping_copy_data((CurveMapping *)but->poin, &but_copypaste_curve);
     button_activate_state(C, but, BUTTON_STATE_EXIT);
   }
 }
@@ -2588,7 +2588,7 @@ static void ui_but_paste(bContext *C, uiBut *but, uiHandleButtonData *data, cons
 
 void ui_but_clipboard_free(void)
 {
-  curvemapping_free_data(&but_copypaste_curve);
+  BKE_curvemapping_free_data(&but_copypaste_curve);
 }
 
 /** \} */
@@ -6479,7 +6479,7 @@ static bool ui_numedit_but_CURVE(uiBlock *block,
       }
     }
 
-    curvemapping_changed(cumap, false);
+    BKE_curvemapping_changed(cumap, false);
 
     if (moved_point) {
       data->draglastx = evtx;
@@ -6559,8 +6559,8 @@ static int ui_do_but_CURVE(
         float f_xy[2];
         BLI_rctf_transform_pt_v(&cumap->curr, &but->rect, f_xy, m_xy);
 
-        curvemap_insert(cuma, f_xy[0], f_xy[1]);
-        curvemapping_changed(cumap, false);
+        BKE_curvemap_insert(cuma, f_xy[0], f_xy[1]);
+        BKE_curvemapping_changed(cumap, false);
         changed = true;
       }
 
@@ -6597,8 +6597,8 @@ static int ui_do_but_CURVE(
           if (dist_squared_to_line_segment_v2(m_xy, f_xy_prev, f_xy) < dist_min_sq) {
             BLI_rctf_transform_pt_v(&cumap->curr, &but->rect, f_xy, m_xy);
 
-            curvemap_insert(cuma, f_xy[0], f_xy[1]);
-            curvemapping_changed(cumap, false);
+            BKE_curvemap_insert(cuma, f_xy[0], f_xy[1]);
+            BKE_curvemapping_changed(cumap, false);
 
             changed = true;
 
@@ -6672,7 +6672,7 @@ static int ui_do_but_CURVE(
           }
         }
         else {
-          curvemapping_changed(cumap, true); /* remove doubles */
+          BKE_curvemapping_changed(cumap, true); /* remove doubles */
           BKE_paint_invalidate_cursor_overlay(scene, view_layer, cumap);
         }
       }
index fb8c2f597485cb939bc19aaa70b2fe793d493c9a..37eb1770f68c0fad09476e9b70d4000b891039e6 100644 (file)
@@ -3723,15 +3723,15 @@ static void curvemap_buttons_setclip(bContext *UNUSED(C), void *cumap_v, void *U
 {
   CurveMapping *cumap = cumap_v;
 
-  curvemapping_changed(cumap, false);
+  BKE_curvemapping_changed(cumap, false);
 }
 
 static void curvemap_buttons_delete(bContext *C, void *cb_v, void *cumap_v)
 {
   CurveMapping *cumap = cumap_v;
 
-  curvemap_remove(cumap->cm + cumap->cur, SELECT);
-  curvemapping_changed(cumap, false);
+  BKE_curvemap_remove(cumap->cm + cumap->cur, SELECT);
+  BKE_curvemapping_changed(cumap, false);
 
   rna_update_cb(C, cb_v, NULL);
 }
@@ -3829,7 +3829,7 @@ static uiBlock *curvemap_clipping_func(bContext *C, ARegion *ar, void *cumap_v)
   return block;
 }
 
-/* only for curvemap_tools_dofunc */
+/* only for BKE_curvemap_tools_dofunc */
 enum {
   UICURVE_FUNC_RESET_NEG,
   UICURVE_FUNC_RESET_POS,
@@ -3849,35 +3849,35 @@ static void curvemap_tools_dofunc(bContext *C, void *cumap_v, int event)
   switch (event) {
     case UICURVE_FUNC_RESET_NEG:
     case UICURVE_FUNC_RESET_POS: /* reset */
-      curvemap_reset(cuma,
-                     &cumap->clipr,
-                     cumap->preset,
-                     (event == UICURVE_FUNC_RESET_NEG) ? CURVEMAP_SLOPE_NEGATIVE :
-                                                         CURVEMAP_SLOPE_POSITIVE);
-      curvemapping_changed(cumap, false);
+      BKE_curvemap_reset(cuma,
+                         &cumap->clipr,
+                         cumap->preset,
+                         (event == UICURVE_FUNC_RESET_NEG) ? CURVEMAP_SLOPE_NEGATIVE :
+                                                             CURVEMAP_SLOPE_POSITIVE);
+      BKE_curvemapping_changed(cumap, false);
       break;
     case UICURVE_FUNC_RESET_VIEW:
       cumap->curr = cumap->clipr;
       break;
     case UICURVE_FUNC_HANDLE_VECTOR: /* set vector */
-      curvemap_handle_set(cuma, HD_VECT);
-      curvemapping_changed(cumap, false);
+      BKE_curvemap_handle_set(cuma, HD_VECT);
+      BKE_curvemapping_changed(cumap, false);
       break;
     case UICURVE_FUNC_HANDLE_AUTO: /* set auto */
-      curvemap_handle_set(cuma, HD_AUTO);
-      curvemapping_changed(cumap, false);
+      BKE_curvemap_handle_set(cuma, HD_AUTO);
+      BKE_curvemapping_changed(cumap, false);
       break;
     case UICURVE_FUNC_HANDLE_AUTO_ANIM: /* set auto-clamped */
-      curvemap_handle_set(cuma, HD_AUTO_ANIM);
-      curvemapping_changed(cumap, false);
+      BKE_curvemap_handle_set(cuma, HD_AUTO_ANIM);
+      BKE_curvemapping_changed(cumap, false);
       break;
     case UICURVE_FUNC_EXTEND_HOZ: /* extend horiz */
       cuma->flag &= ~CUMA_EXTEND_EXTRAPOLATE;
-      curvemapping_changed(cumap, false);
+      BKE_curvemapping_changed(cumap, false);
       break;
     case UICURVE_FUNC_EXTEND_EXP: /* extend extrapolate */
       cuma->flag |= CUMA_EXTEND_EXTRAPOLATE;
-      curvemapping_changed(cumap, false);
+      BKE_curvemapping_changed(cumap, false);
       break;
   }
   ED_undo_push(C, "CurveMap tools");
@@ -4041,7 +4041,7 @@ static void curvemap_buttons_redraw(bContext *C, void *UNUSED(arg1), void *UNUSE
 static void curvemap_buttons_update(bContext *C, void *arg1_v, void *cumap_v)
 {
   CurveMapping *cumap = cumap_v;
-  curvemapping_changed(cumap, true);
+  BKE_curvemapping_changed(cumap, true);
   rna_update_cb(C, arg1_v, NULL);
 }
 
@@ -4052,14 +4052,14 @@ static void curvemap_buttons_reset(bContext *C, void *cb_v, void *cumap_v)
 
   cumap->preset = CURVE_PRESET_LINE;
   for (a = 0; a < CM_TOT; a++) {
-    curvemap_reset(cumap->cm + a, &cumap->clipr, cumap->preset, CURVEMAP_SLOPE_POSITIVE);
+    BKE_curvemap_reset(cumap->cm + a, &cumap->clipr, cumap->preset, CURVEMAP_SLOPE_POSITIVE);
   }
 
   cumap->black[0] = cumap->black[1] = cumap->black[2] = 0.0f;
   cumap->white[0] = cumap->white[1] = cumap->white[2] = 1.0f;
-  curvemapping_set_black_white(cumap, NULL, NULL);
+  BKE_curvemapping_set_black_white(cumap, NULL, NULL);
 
-  curvemapping_changed(cumap, false);
+  BKE_curvemapping_changed(cumap, false);
 
   rna_update_cb(C, cb_v, NULL);
 }
index acd7126e56a7c321ba29285ffa6629abb9a04674..55a71ee89893087158c6760557351fd8786af466 100644 (file)
@@ -1177,9 +1177,9 @@ static int render_shutter_curve_preset_exec(bContext *C, wmOperator *op)
 
   cm->flag &= ~CUMA_EXTEND_EXTRAPOLATE;
   mblur_shutter_curve->preset = preset;
-  curvemap_reset(
+  BKE_curvemap_reset(
       cm, &mblur_shutter_curve->clipr, mblur_shutter_curve->preset, CURVEMAP_SLOPE_POS_NEG);
-  curvemapping_changed(mblur_shutter_curve, false);
+  BKE_curvemapping_changed(mblur_shutter_curve, false);
 
   return OPERATOR_FINISHED;
 }
index 576baf5794bb09ade150c39a191e3b05de2817ec..65e10f9875382ae9f63f100b9e14b7bc93eaff7f 100644 (file)
@@ -460,7 +460,7 @@ static int load_tex_cursor(Brush *br, ViewContext *vc, float zoom)
     }
     buffer = MEM_mallocN(sizeof(GLubyte) * size * size, "load_tex");
 
-    curvemapping_initialize(br->curve);
+    BKE_curvemapping_initialize(br->curve);
 
     LoadTexData data = {
         .br = br,
index 5828365527013ad8db0720624789a478721411d0..342d0b6e820763cbb2aaf14ffad625886f56c92a 100644 (file)
@@ -1695,7 +1695,7 @@ static float project_paint_uvpixel_mask(const ProjPaintState *ps,
     ca3 = ps->cavities[lt_vtri[2]];
 
     ca_mask = w[0] * ca1 + w[1] * ca2 + w[2] * ca3;
-    ca_mask = curvemapping_evaluateF(ps->cavity_curve, 0, ca_mask);
+    ca_mask = BKE_curvemapping_evaluateF(ps->cavity_curve, 0, ca_mask);
     CLAMP(ca_mask, 0.0f, 1.0f);
     mask *= ca_mask;
   }
index f073877ebcf2049a691908914bd22d83cfd3a8ea..6144f5751f266f4f762f831315eaf2886ce8f0e9 100644 (file)
@@ -784,9 +784,9 @@ PaintStroke *paint_stroke_new(bContext *C,
   ups->average_stroke_counter = 0;
 
   /* initialize here to avoid initialization conflict with threaded strokes */
-  curvemapping_initialize(br->curve);
+  BKE_curvemapping_initialize(br->curve);
   if (p->flags & PAINT_USE_CAVITY_MASK) {
-    curvemapping_initialize(p->cavity_curve);
+    BKE_curvemapping_initialize(p->cavity_curve);
   }
 
   BKE_paint_set_overlay_override(br->overlay_flags);
index 1dc283282448b95a5e282de55a718be5271a0e51..72fc08cc38d1f55823890d4b3b48e473a192bbb2 100644 (file)
@@ -796,7 +796,7 @@ static int paint_weight_gradient_exec(bContext *C, wmOperator *op)
     VPaint *wp = ts->wpaint;
     struct Brush *brush = BKE_paint_brush(&wp->paint);
 
-    curvemapping_initialize(brush->curve);
+    BKE_curvemapping_initialize(brush->curve);
 
     data.brush = brush;
     data.weightpaint = BKE_brush_weight_get(scene, brush);
index eeda7a7aeaf56504c50e86e38eac62783fee2c61..3567625819f057d6d2fdbb0e5d3f4137da06a9ea 100644 (file)
@@ -2308,7 +2308,7 @@ static void do_draw_brush(Sculpt *sd, Object *ob, PBVHNode **nodes, int totnode)
 
   /* XXX - this shouldn't be necessary, but sculpting crashes in blender2.8 otherwise
    * initialize before threads so they can do curve mapping */
-  curvemapping_initialize(brush->curve);
+  BKE_curvemapping_initialize(brush->curve);
 
   /* threaded loop over nodes */
   SculptThreadedTaskData data = {
@@ -4604,7 +4604,7 @@ static void sculpt_update_cache_invariants(
         brush = br;
         cache->saved_smooth_size = BKE_brush_size_get(scene, brush);
         BKE_brush_size_set(scene, brush, size);
-        curvemapping_initialize(brush->curve);
+        BKE_curvemapping_initialize(brush->curve);
       }
     }
   }
index 36cc36052736458a5b2e4f7226aa392a295628ee..91ed905766798d9a9e9997782b91b27c862ac39b 100644 (file)
@@ -497,7 +497,7 @@ static UvSculptData *uv_sculpt_stroke_init(bContext *C, wmOperator *op, const wm
 
   op->customdata = data;
 
-  curvemapping_initialize(ts->uvsculpt->paint.brush->curve);
+  BKE_curvemapping_initialize(ts->uvsculpt->paint.brush->curve);
 
   if (data) {
     int counter = 0, i;
index 829a78b2bfa090a4cab03b7faf6e940f18ef3975..ccd0a2bfd792cbbcf423ba006209cf3ee78cd957 100644 (file)
@@ -385,10 +385,10 @@ void ED_space_image_scopes_update(const struct bContext *C,
     }
   }
 
-  scopes_update(&sima->scopes,
-                ibuf,
-                use_view_settings ? &scene->view_settings : NULL,
-                &scene->display_settings);
+  BKE_scopes_update(&sima->scopes,
+                    ibuf,
+                    use_view_settings ? &scene->view_settings : NULL,
+                    &scene->display_settings);
 }
 
 bool ED_space_image_show_render(SpaceImage *sima)
index 374a58d18087d26a9dddf7e6f28d52fa546bfa6b..1aa8c4c988bd144ae56cfbd7f8390ed6ed77402f 100644 (file)
@@ -3217,10 +3217,10 @@ static void image_sample_apply(bContext *C, wmOperator *op, const wmEvent *event
         int point = RNA_enum_get(op->ptr, "point");
 
         if (point == 1) {
-          curvemapping_set_black_white(curve_mapping, NULL, info->linearcol);
+          BKE_curvemapping_set_black_white(curve_mapping, NULL, info->linearcol);
         }
         else if (point == 0) {
-          curvemapping_set_black_white(curve_mapping, info->linearcol, NULL);
+          BKE_curvemapping_set_black_white(curve_mapping, info->linearcol, NULL);
         }
         WM_event_add_notifier(C, NC_WINDOW, NULL);
       }
index 7ff075bf819e7a84120a3a0cd7a28db47397cecc..17f808f727d617ec6ccd423fd9f309c85f0297f5 100644 (file)
@@ -131,7 +131,7 @@ static SpaceLink *image_new(const ScrArea *UNUSED(area), const Scene *UNUSED(sce
   BKE_imageuser_default(&simage->iuser);
   simage->iuser.flag = IMA_SHOW_STEREO | IMA_ANIM_ALWAYS;
 
-  scopes_new(&simage->scopes);
+  BKE_scopes_new(&simage->scopes);
   simage->sample_line_hist.height = 100;
 
   /* tool header */
@@ -179,7 +179,7 @@ static void image_free(SpaceLink *sl)
 {
   SpaceImage *simage = (SpaceImage *)sl;
 
-  scopes_free(&simage->scopes);
+  BKE_scopes_free(&simage->scopes);
 }
 
 /* spacetype; init callback, add handlers */
@@ -197,7 +197,7 @@ static SpaceLink *image_duplicate(SpaceLink *sl)
 
   /* clear or remove stuff from old */
 
-  scopes_new(&simagen->scopes);
+  BKE_scopes_new(&simagen->scopes);
 
   return (SpaceLink *)simagen;
 }
index 4eccf4c50717334e441a7962d94db70c1b355417..ef9d23d1db8e48dc2bf3ccdb63ece97e7760b7f0 100644 (file)
@@ -9049,7 +9049,7 @@ static void createTransGPencil(bContext *C, TransInfo *t)
 
   /* initialize falloff curve */
   if (is_multiedit) {
-    curvemapping_initialize(ts->gp_sculpt.cur_falloff);
+    BKE_curvemapping_initialize(ts->gp_sculpt.cur_falloff);
   }
 
   /* First Pass: Count the number of data-points required for the strokes,
index 71cdbafba45e476b3e46c2f497425ad03e51cacf..367ad556d02ccd7f7dd28e8df757f8a93fd0afcc 100644 (file)
@@ -229,7 +229,7 @@ static PyObject *Freestyle_evaluateColorRamp(PyObject * /*self*/, PyObject *args
 }
 
 #include "DNA_color_types.h"
-#include "BKE_colortools.h" /* curvemapping_evaluateF() */
+#include "BKE_colortools.h" /* BKE_curvemapping_evaluateF() */
 
 static char Freestyle_evaluateCurveMappingF___doc__[] =
     ".. function:: evaluateCurveMappingF(cumap, cur, value)\n"
@@ -264,13 +264,13 @@ static PyObject *Freestyle_evaluateCurveMappingF(PyObject * /*self*/, PyObject *
     return NULL;
   }
   cumap = (CurveMapping *)py_srna->ptr.data;
-  curvemapping_initialize(cumap);
+  BKE_curvemapping_initialize(cumap);
   /* disable extrapolation if enabled */
   if ((cumap->cm[cur].flag & CUMA_EXTEND_EXTRAPOLATE)) {
     cumap->cm[cur].flag &= ~(CUMA_EXTEND_EXTRAPOLATE);
-    curvemapping_changed(cumap, 0);
+    BKE_curvemapping_changed(cumap, 0);
   }
-  return PyFloat_FromDouble(curvemapping_evaluateF(cumap, cur, value));
+  return PyFloat_FromDouble(BKE_curvemapping_evaluateF(cumap, cur, value));
 }
 
 /*-----------------------Freestyle module docstring----------------------------*/
index d56b3217c9f4ca0c89a64ecd2e6212c5be782f80..a3dbcdf23de166b41c47c1e855f726aa6bb2d0df 100644 (file)
@@ -81,9 +81,9 @@ static void initData(GpencilModifierData *md)
   gpmd->object = NULL;
   gpmd->force = 0.5f;
   gpmd->falloff_type = eGPHook_Falloff_Smooth;
-  gpmd->curfalloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+  gpmd->curfalloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
   if (gpmd->curfalloff) {
-    curvemapping_initialize(gpmd->curfalloff);
+    BKE_curvemapping_initialize(gpmd->curfalloff);
   }
 }
 
@@ -93,13 +93,13 @@ static void copyData(const GpencilModifierData *md, GpencilModifierData *target)
   HookGpencilModifierData *tgmd = (HookGpencilModifierData *)target;
 
   if (tgmd->curfalloff != NULL) {
-    curvemapping_free(tgmd->curfalloff);
+    BKE_curvemapping_free(tgmd->curfalloff);
     tgmd->curfalloff = NULL;
   }
 
   BKE_gpencil_modifier_copyData_generic(md, target);
 
-  tgmd->curfalloff = curvemapping_copy(gmd->curfalloff);
+  tgmd->curfalloff = BKE_curvemapping_copy(gmd->curfalloff);
 }
 
 /* calculate factor of fallof */
@@ -126,7 +126,7 @@ static float gp_hook_falloff(const struct GPHookData_cb *tData, const float len_
 
     switch (tData->falloff_type) {
       case eGPHook_Falloff_Curve:
-        fac = curvemapping_evaluateF(tData->curfalloff, 0, fac);
+        fac = BKE_curvemapping_evaluateF(tData->curfalloff, 0, fac);
         break;
       case eGPHook_Falloff_Sharp:
         fac = fac * fac;
@@ -301,7 +301,7 @@ static void freeData(GpencilModifierData *md)
   HookGpencilModifierData *mmd = (HookGpencilModifierData *)md;
 
   if (mmd->curfalloff) {
-    curvemapping_free(mmd->curfalloff);
+    BKE_curvemapping_free(mmd->curfalloff);
   }
 }
 
index bf4f45b10afb131b935aba292dc3fc2ce009be00..357e36a06b28b4053196ced036b9148ca2d3b628 100644 (file)
@@ -48,9 +48,9 @@ static void initData(GpencilModifierData *md)
   gpmd->thickness = 2;
   gpmd->layername[0] = '\0';
   gpmd->vgname[0] = '\0';
-  gpmd->curve_thickness = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+  gpmd->curve_thickness = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
   if (gpmd->curve_thickness) {
-    curvemapping_initialize(gpmd->curve_thickness);
+    BKE_curvemapping_initialize(gpmd->curve_thickness);
   }
 }
 
@@ -59,7 +59,7 @@ static void freeData(GpencilModifierData *md)
   ThickGpencilModifierData *gpmd = (ThickGpencilModifierData *)md;
 
   if (gpmd->curve_thickness) {
-    curvemapping_free(gpmd->curve_thickness);
+    BKE_curvemapping_free(gpmd->curve_thickness);
   }
 }
 
@@ -69,13 +69,13 @@ static void copyData(const GpencilModifierData *md, GpencilModifierData *target)
   ThickGpencilModifierData *tgmd = (ThickGpencilModifierData *)target;
 
   if (tgmd->curve_thickness != NULL) {
-    curvemapping_free(tgmd->curve_thickness);
+    BKE_curvemapping_free(tgmd->curve_thickness);
     tgmd->curve_thickness = NULL;
   }
 
   BKE_gpencil_modifier_copyData_generic(md, target);
 
-  tgmd->curve_thickness = curvemapping_copy(gmd->curve_thickness);
+  tgmd->curve_thickness = BKE_curvemapping_copy(gmd->curve_thickness);
 }
 
 /* change stroke thickness */
@@ -125,7 +125,7 @@ static void deformStroke(GpencilModifierData *md,
       if ((mmd->flag & GP_THICK_CUSTOM_CURVE) && (mmd->curve_thickness)) {
         /* normalize value to evaluate curve */
         float value = (float)i / (gps->totpoints - 1);
-        curvef = curvemapping_evaluateF(mmd->curve_thickness, 0, value);
+        curvef = BKE_curvemapping_evaluateF(mmd->curve_thickness, 0, value);
       }
 
       pt->pressure += mmd->thickness * weight * curvef;
index 4509daac81f9710a39ea0dfa70fe566be4a0f7e3..36af7ab2571bddd75395fe4f1f244b70acd9272c 100644 (file)
@@ -716,7 +716,7 @@ void colormanagement_exit(void)
   }
 
   if (global_glsl_state.curve_mapping) {
-    curvemapping_free(global_glsl_state.curve_mapping);
+    BKE_curvemapping_free(global_glsl_state.curve_mapping);
   }
 
   if (global_glsl_state.curve_mapping_settings.lut) {
@@ -1029,14 +1029,14 @@ void IMB_colormanagement_init_default_view_settings(
 static void curve_mapping_apply_pixel(CurveMapping *curve_mapping, float *pixel, int channels)
 {
   if (channels == 1) {
-    pixel[0] = curvemap_evaluateF(curve_mapping->cm, pixel[0]);
+    pixel[0] = BKE_curvemap_evaluateF(curve_mapping->cm, pixel[0]);
   }
   else if (channels == 2) {
-    pixel[0] = curvemap_evaluateF(curve_mapping->cm, pixel[0]);
-    pixel[1] = curvemap_evaluateF(curve_mapping->cm, pixel[1]);
+    pixel[0] = BKE_curvemap_evaluateF(curve_mapping->cm, pixel[0]);
+    pixel[1] = BKE_curvemap_evaluateF(curve_mapping->cm, pixel[1]);
   }
   else {
-    curvemapping_evaluate_premulRGBF(curve_mapping, pixel, pixel);
+    BKE_curvemapping_evaluate_premulRGBF(curve_mapping, pixel, pixel);
   }
 }
 
@@ -3728,8 +3728,8 @@ ColormanageProcessor *IMB_colormanagement_display_processor_new(
                                                             global_role_scene_linear);
 
   if (applied_view_settings->flag & COLORMANAGE_VIEW_USE_CURVES) {
-    cm_processor->curve_mapping = curvemapping_copy(applied_view_settings->curve_mapping);
-    curvemapping_premultiply(cm_processor->curve_mapping, false);
+    cm_processor->curve_mapping = BKE_curvemapping_copy(applied_view_settings->curve_mapping);
+    BKE_curvemapping_premultiply(cm_processor->curve_mapping, false);
   }
 
   return cm_processor;
@@ -3754,7 +3754,7 @@ ColormanageProcessor *IMB_colormanagement_colorspace_processor_new(const char *f
 void IMB_colormanagement_processor_apply_v4(ColormanageProcessor *cm_processor, float pixel[4])
 {
   if (cm_processor->curve_mapping) {
-    curvemapping_evaluate_premulRGBF(cm_processor->curve_mapping, pixel, pixel);
+    BKE_curvemapping_evaluate_premulRGBF(cm_processor->curve_mapping, pixel, pixel);
   }
 
   if (cm_processor->processor) {
@@ -3766,7 +3766,7 @@ void IMB_colormanagement_processor_apply_v4_predivide(ColormanageProcessor *cm_p
                                                       float pixel[4])
 {
   if (cm_processor->curve_mapping) {
-    curvemapping_evaluate_premulRGBF(cm_processor->curve_mapping, pixel, pixel);
+    BKE_curvemapping_evaluate_premulRGBF(cm_processor->curve_mapping, pixel, pixel);
   }
 
   if (cm_processor->processor) {
@@ -3777,7 +3777,7 @@ void IMB_colormanagement_processor_apply_v4_predivide(ColormanageProcessor *cm_p
 void IMB_colormanagement_processor_apply_v3(ColormanageProcessor *cm_processor, float pixel[3])
 {
   if (cm_processor->curve_mapping) {
-    curvemapping_evaluate_premulRGBF(cm_processor->curve_mapping, pixel, pixel);
+    BKE_curvemapping_evaluate_premulRGBF(cm_processor->curve_mapping, pixel, pixel);
   }
 
   if (cm_processor->processor) {
@@ -3870,7 +3870,7 @@ void IMB_colormanagement_processor_apply_byte(
 void IMB_colormanagement_processor_free(ColormanageProcessor *cm_processor)
 {
   if (cm_processor->curve_mapping) {
-    curvemapping_free(cm_processor->curve_mapping);
+    BKE_curvemapping_free(cm_processor->curve_mapping);
   }
   if (cm_processor->processor) {
     OCIO_processorRelease(cm_processor->processor);
@@ -3899,9 +3899,9 @@ static void curve_mapping_to_ocio_settings(CurveMapping *curve_mapping,
 {
   int i;
 
-  curvemapping_initialize(curve_mapping);
-  curvemapping_premultiply(curve_mapping, false);
-  curvemapping_table_RGBA(
+  BKE_curvemapping_initialize(curve_mapping);
+  BKE_curvemapping_premultiply(curve_mapping, false);
+  BKE_curvemapping_table_RGBA(
       curve_mapping, &curve_mapping_settings->lut, &curve_mapping_settings->lut_size);
 
   for (i = 0; i < 4; i++) {
@@ -3964,11 +3964,11 @@ static void update_glsl_display_processor(const ColorManagedViewSettings *view_s
      * We do this by allocating new curve mapping before freeing ol one.
      */
     if (use_curve_mapping) {
-      new_curve_mapping = curvemapping_copy(view_settings->curve_mapping);
+      new_curve_mapping = BKE_curvemapping_copy(view_settings->curve_mapping);
     }
 
     if (global_glsl_state.curve_mapping) {
-      curvemapping_free(global_glsl_state.curve_mapping);
+      BKE_curvemapping_free(global_glsl_state.curve_mapping);
       MEM_freeN(curve_mapping_settings->lut);
       global_glsl_state.curve_mapping = NULL;
       curve_mapping_settings->lut = NULL;
index d221b7005f63cfcc5e6717a08e61a90daee58b63..6bfd2b9f63b922499962a34b9db38bf4e0adb501 100644 (file)
@@ -94,7 +94,7 @@ static void rna_CurveMapping_clip_set(PointerRNA *ptr, bool value)
     cumap->flag &= ~CUMA_DO_CLIP;
   }
 
-  curvemapping_changed(cumap, false);
+  BKE_curvemapping_changed(cumap, false);
 }
 
 static void rna_CurveMapping_black_level_set(PointerRNA *ptr, const float *values)
@@ -103,7 +103,7 @@ static void rna_CurveMapping_black_level_set(PointerRNA *ptr, const float *value
   cumap->black[0] = values[0];
   cumap->black[1] = values[1];
   cumap->black[2] = values[2];
-  curvemapping_set_black_white(cumap, NULL, NULL);
+  BKE_curvemapping_set_black_white(cumap, NULL, NULL);
 }
 
 static void rna_CurveMapping_white_level_set(PointerRNA *ptr, const float *values)
@@ -112,7 +112,7 @@ static void rna_CurveMapping_white_level_set(PointerRNA *ptr, const float *value
   cumap->white[0] = values[0];
   cumap->white[1] = values[1];
   cumap->white[2] = values[2];
-  curvemapping_set_black_white(cumap, NULL, NULL);
+  BKE_curvemapping_set_black_white(cumap, NULL, NULL);
 }
 
 static void rna_CurveMapping_tone_update(Main *UNUSED(bmain),
@@ -368,7 +368,7 @@ static void rna_ColorRampElement_remove(struct ColorBand *coba,
 static void rna_CurveMap_remove_point(CurveMap *cuma, ReportList *reports, PointerRNA *point_ptr)
 {
   CurveMapPoint *point = point_ptr->data;
-  if (curvemap_remove_point(cuma, point) == false) {
+  if (BKE_curvemap_remove_point(cuma, point) == false) {
     BKE_report(reports, RPT_ERROR, "Unable to remove curve point");
     return;
   }
@@ -518,7 +518,7 @@ static void rna_ColorManagedViewSettings_use_curves_set(PointerRNA *ptr, bool va
     view_settings->flag |= COLORMANAGE_VIEW_USE_CURVES;
 
     if (view_settings->curve_mapping == NULL) {
-      view_settings->curve_mapping = curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
+      view_settings->curve_mapping = BKE_curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
     }
   }
   else {
@@ -669,7 +669,7 @@ static void rna_ColorManagement_update(Main *UNUSED(bmain), Scene *UNUSED(scene)
   }
 }
 
-/* this function only exists because #curvemap_evaluateF uses a 'const' qualifier */
+/* this function only exists because #BKE_curvemap_evaluateF uses a 'const' qualifier */
 static float rna_CurveMap_evaluateF(struct CurveMap *cuma, ReportList *reports, float value)
 {
   if (!cuma->table) {
@@ -679,12 +679,12 @@ static float rna_CurveMap_evaluateF(struct CurveMap *cuma, ReportList *reports,
         "CurveMap table not initialized, call initialize() on CurveMapping owner of the CurveMap");
     return 0.0f;
   }
-  return curvemap_evaluateF(cuma, value);
+  return BKE_curvemap_evaluateF(cuma, value);
 }
 
 static void rna_CurveMap_initialize(struct CurveMapping *cumap)
 {
-  curvemapping_initialize(cumap);
+  BKE_curvemapping_initialize(cumap);
 }
 #else
 
@@ -729,7 +729,7 @@ static void rna_def_curvemap_points_api(BlenderRNA *brna, PropertyRNA *cprop)
   RNA_def_struct_sdna(srna, "CurveMap");
   RNA_def_struct_ui_text(srna, "Curve Map Point", "Collection of Curve Map Points");
 
-  func = RNA_def_function(srna, "new", "curvemap_insert");
+  func = RNA_def_function(srna, "new", "BKE_curvemap_insert");
   RNA_def_function_ui_description(func, "Add point to CurveMap");
   parm = RNA_def_float(func,
                        "position",
@@ -889,7 +889,7 @@ static void rna_def_curvemapping(BlenderRNA *brna)
       prop, "White Level", "For RGB curves, the color that white is mapped to");
   RNA_def_property_float_funcs(prop, NULL, "rna_CurveMapping_white_level_set", NULL);
 
-  func = RNA_def_function(srna, "update", "curvemapping_changed_all");
+  func = RNA_def_function(srna, "update", "BKE_curvemapping_changed_all");
   RNA_def_function_ui_description(func, "Update curve mapping after making changes");
 
   func = RNA_def_function(srna, "initialize", "rna_CurveMap_initialize");
index ef8b671116af66994d503c7a26d18733558e79d0..531ff27798d9afab3163b7617181203ea0b5c7ea 100644 (file)
@@ -735,7 +735,7 @@ static void rna_GPencilInterpolateSettings_type_set(PointerRNA *ptr, int value)
 
   /* init custom interpolation curve here now the first time it's used */
   if ((settings->type == GP_IPO_CURVEMAP) && (settings->custom_ipo == NULL)) {
-    settings->custom_ipo = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+    settings->custom_ipo = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
   }
 }
 
index c12fb9c1bd88ad52a44196ee5a48dc9f87b42894..2f902db9340ef87bcc5c8cd718e32963480129c5 100644 (file)
@@ -49,7 +49,7 @@ static void initData(ModifierData *md)
   HookModifierData *hmd = (HookModifierData *)md;
 
   hmd->force = 1.0;
-  hmd->curfalloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+  hmd->curfalloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
   hmd->falloff_type = eHook_Falloff_Smooth;
   hmd->flag = 0;
 }
@@ -61,7 +61,7 @@ static void copyData(const ModifierData *md, ModifierData *target, const int fla
 
   modifier_copyData_generic(md, target, flag);
 
-  thmd->curfalloff = curvemapping_copy(hmd->curfalloff);
+  thmd->curfalloff = BKE_curvemapping_copy(hmd->curfalloff);
 
   thmd->indexar = MEM_dupallocN(hmd->indexar);
 }
@@ -88,7 +88,7 @@ static void freeData(ModifierData *md)
 {
   HookModifierData *hmd = (HookModifierData *)md;
 
-  curvemapping_free(hmd->curfalloff);
+  BKE_curvemapping_free(hmd->curfalloff);
 
   MEM_SAFE_FREE(hmd->indexar);
 }
@@ -174,7 +174,7 @@ static float hook_falloff(const struct HookData_cb *hd, const float len_sq)
         break;
 #endif
       case eHook_Falloff_Curve:
-        fac = curvemapping_evaluateF(hd->curfalloff, 0, fac);
+        fac = BKE_curvemapping_evaluateF(hd->curfalloff, 0, fac);
         break;
       case eHook_Falloff_Sharp:
         fac = fac * fac;
@@ -262,11 +262,11 @@ static void deformVerts_do(HookModifierData *hmd,
 
   if (hmd->curfalloff == NULL) {
     /* should never happen, but bad lib linking could cause it */
-    hmd->curfalloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+    hmd->curfalloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
   }
 
   if (hmd->curfalloff) {
-    curvemapping_initialize(hmd->curfalloff);
+    BKE_curvemapping_initialize(hmd->curfalloff);
   }
 
   /* Generic data needed for applying per-vertex calculations (initialize all members) */
index 6441ab69391a210242e059992b7eb61d450b4610..7155498c942681a6688afc54d43c4b28148f5afe 100644 (file)
@@ -50,7 +50,7 @@ static void initData(ModifierData *md)
 {
   WarpModifierData *wmd = (WarpModifierData *)md;
 
-  wmd->curfalloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+  wmd->curfalloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
   wmd->texture = NULL;
   wmd->strength = 1.0f;
   wmd->falloff_radius = 1.0f;
@@ -65,7 +65,7 @@ static void copyData(const ModifierData *md, ModifierData *target, const int fla
 
   modifier_copyData_generic(md, target, flag);
 
-  twmd->curfalloff = curvemapping_copy(wmd->curfalloff);
+  twmd->curfalloff = BKE_curvemapping_copy(wmd->curfalloff);
 }
 
 static void requiredDataMask(Object *UNUSED(ob),
@@ -100,7 +100,7 @@ static bool dependsOnTime(ModifierData *md)
 static void freeData(ModifierData *md)
 {
   WarpModifierData *wmd = (WarpModifierData *)md;
-  curvemapping_free(wmd->curfalloff);
+  BKE_curvemapping_free(wmd->curfalloff);
 }
 
 static bool isDisabled(const struct Scene *UNUSED(scene),
@@ -188,11 +188,11 @@ static void warpModifier_do(WarpModifierData *wmd,
   }
 
   if (wmd->curfalloff == NULL) { /* should never happen, but bad lib linking could cause it */
-    wmd->curfalloff = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+    wmd->curfalloff = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
   }
 
   if (wmd->curfalloff) {
-    curvemapping_initialize(wmd->curfalloff);
+    BKE_curvemapping_initialize(wmd->curfalloff);
   }
 
   invert_m4_m4(obinv, ob->obmat);
@@ -247,7 +247,7 @@ static void warpModifier_do(WarpModifierData *wmd,
           fac = 1.0f;
           break;
         case eWarp_Falloff_Curve:
-          fac = curvemapping_evaluateF(wmd->curfalloff, 0, fac);
+          fac = BKE_curvemapping_evaluateF(wmd->curfalloff, 0, fac);
           break;
         case eWarp_Falloff_Sharp:
           fac = fac * fac;
index 61872cbe464c93c40ebb08d464077998c8a675ba..486d5c90bef352034440bc1b87c1dfb468ec62ba 100644 (file)
@@ -72,7 +72,7 @@ void weightvg_do_map(int num, float *new_w, short falloff_type, CurveMapping *cm
   }
 
   if (cmap && falloff_type == MOD_WVG_MAPPING_CURVE) {
-    curvemapping_initialize(cmap);
+    BKE_curvemapping_initialize(cmap);
   }
 
   /* Map each weight (vertex) to its new value, accordingly to the chosen mode. */
@@ -83,7 +83,7 @@ void weightvg_do_map(int num, float *new_w, short falloff_type, CurveMapping *cm
     /* Closely matches PROP_SMOOTH and similar. */
     switch (falloff_type) {
       case MOD_WVG_MAPPING_CURVE:
-        fac = curvemapping_evaluateF(cmap, 0, fac);
+        fac = BKE_curvemapping_evaluateF(cmap, 0, fac);
         break;
       case MOD_WVG_MAPPING_SHARP:
         fac = fac * fac;
index 207c58516025128ec54b1b2007604f2264d5885a..045ba78fab5ee7740b99db829ed999b0e0a364cc 100644 (file)
@@ -57,8 +57,8 @@ static void initData(ModifierData *md)
   wmd->falloff_type = MOD_WVG_MAPPING_NONE;
   wmd->default_weight = 0.0f;
 
-  wmd->cmap_curve = curvemapping_add(1, 0.0, 0.0, 1.0, 1.0);
-  curvemapping_initialize(wmd->cmap_curve);
+  wmd->cmap_curve = BKE_curvemapping_add(1, 0.0, 0.0, 1.0, 1.0);
+  BKE_curvemapping_initialize(wmd->cmap_curve);
 
   wmd->rem_threshold = 0.01f;
   wmd->add_threshold = 0.01f;
@@ -71,7 +71,7 @@ static void initData(ModifierData *md)
 static void freeData(ModifierData *md)
 {
   WeightVGEditModifierData *wmd = (WeightVGEditModifierData *)md;
-  curvemapping_free(wmd->cmap_curve);
+  BKE_curvemapping_free(wmd->cmap_curve);
 }
 
 static void copyData(const ModifierData *md, ModifierData *target, const int flag)
@@ -81,7 +81,7 @@ static void copyData(const ModifierData *md, ModifierData *target, const int fla
 
   modifier_copyData_generic(md, target, flag);
 
-  twmd->cmap_curve = curvemapping_copy(wmd->cmap_curve);
+  twmd->cmap_curve = BKE_curvemapping_copy(wmd->cmap_curve);
 }
 
 static void requiredDataMask(Object *UNUSED(ob),
index 7b2e7329432abd3c554ab8b6db5fde7f0a84268a..8d338ba57502d380e380da60af455003a4270c5d 100644 (file)
@@ -35,7 +35,7 @@ static void node_composit_init_curves_time(bNodeTree *UNUSED(ntree), bNode *node
 {
   node->custom1 = 1;
   node->custom2 = 250;
-  node->storage = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+  node->storage = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
 }
 
 void register_node_type_cmp_curve_time(void)
@@ -64,7 +64,7 @@ static bNodeSocketTemplate cmp_node_curve_vec_out[] = {
 
 static void node_composit_init_curve_vec(bNodeTree *UNUSED(ntree), bNode *node)
 {
-  node->storage = curvemapping_add(3, -1.0f, -1.0f, 1.0f, 1.0f);
+  node->storage = BKE_curvemapping_add(3, -1.0f, -1.0f, 1.0f, 1.0f);
 }
 
 void register_node_type_cmp_curve_vec(void)
@@ -96,7 +96,7 @@ static bNodeSocketTemplate cmp_node_curve_rgb_out[] = {
 
 static void node_composit_init_curve_rgb(bNodeTree *UNUSED(ntree), bNode *node)
 {
-  node->storage = curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
+  node->storage = BKE_curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
 }
 
 void register_node_type_cmp_curve_rgb(void)
index 7fcaae0bd9c8ab498dff07052bc33e0611c69549..29cdf28fb2d000b4cbca27f0fcd2c32df04c7fd6 100644 (file)
@@ -36,14 +36,14 @@ static bNodeSocketTemplate cmp_node_huecorrect_out[] = {
 
 static void node_composit_init_huecorrect(bNodeTree *UNUSED(ntree), bNode *node)
 {
-  CurveMapping *cumapping = node->storage = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+  CurveMapping *cumapping = node->storage = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
   int c;
 
   cumapping->preset = CURVE_PRESET_MID9;
 
   for (c = 0; c < 3; c++) {
     CurveMap *cuma = &cumapping->cm[c];
-    curvemap_reset(cuma, &cumapping->clipr, cumapping->preset, CURVEMAP_SLOPE_POSITIVE);
+    BKE_curvemap_reset(cuma, &cumapping->clipr, cumapping->preset, CURVEMAP_SLOPE_POSITIVE);
   }
 
   /* default to showing Saturation */
index 2ab68e2f7cf05f22da258578f08daa2297f28b61..e9a825b5b3ffcc7d1fd8f1388defff242df2fcd5 100644 (file)
@@ -47,7 +47,7 @@
 
 void node_free_curves(bNode *node)
 {
-  curvemapping_free(node->storage);
+  BKE_curvemapping_free(node->storage);
 }
 
 void node_free_standard_storage(bNode *node)
@@ -59,7 +59,7 @@ void node_free_standard_storage(bNode *node)
 
 void node_copy_curves(bNodeTree *UNUSED(dest_ntree), bNode *dest_node, const bNode *src_node)
 {
-  dest_node->storage = curvemapping_copy(src_node->storage);
+  dest_node->storage = BKE_curvemapping_copy(src_node->storage);
 }
 
 void node_copy_standard_storage(bNodeTree *UNUSED(dest_ntree),
@@ -73,7 +73,7 @@ void *node_initexec_curves(bNodeExecContext *UNUSED(context),
                            bNode *node,
                            bNodeInstanceKey UNUSED(key))
 {
-  curvemapping_initialize(node->storage);
+  BKE_curvemapping_initialize(node->storage);
   return NULL; /* unused return */
 }
 
index 1b96dabac77f7e2d4518d35df9b971f8e9956f6e..baf86951fe0199c15a2692a384acead680264df8 100644 (file)
@@ -47,12 +47,12 @@ static void node_shader_exec_curve_vec(void *UNUSED(data),
   /* stack order input:  vec */
   /* stack order output: vec */
   nodestack_get_vec(vec, SOCK_VECTOR, in[1]);
-  curvemapping_evaluate3F(node->storage, out[0]->vec, vec);
+  BKE_curvemapping_evaluate3F(node->storage, out[0]->vec, vec);
 }
 
 static void node_shader_init_curve_vec(bNodeTree *UNUSED(ntree), bNode *node)
 {
-  node->storage = curvemapping_add(3, -1.0f, -1.0f, 1.0f, 1.0f);
+  node->storage = BKE_curvemapping_add(3, -1.0f, -1.0f, 1.0f, 1.0f);
 }
 
 static int gpu_shader_curve_vec(GPUMaterial *mat,
@@ -64,7 +64,7 @@ static int gpu_shader_curve_vec(GPUMaterial *mat,
   float *array, layer;
   int size;
 
-  curvemapping_table_RGBA(node->storage, &array, &size);
+  BKE_curvemapping_table_RGBA(node->storage, &array, &size);
   GPUNodeLink *tex = GPU_color_band(mat, size, array, &layer);
 
   return GPU_stack_link(mat, node, "curves_vec", in, out, tex, GPU_constant(&layer));
@@ -111,7 +111,7 @@ static void node_shader_exec_curve_rgb(void *UNUSED(data),
   /* stack order output: vec */
   nodestack_get_vec(&fac, SOCK_FLOAT, in[0]);
   nodestack_get_vec(vec, SOCK_VECTOR, in[1]);
-  curvemapping_evaluateRGBF(node->storage, out[0]->vec, vec);
+  BKE_curvemapping_evaluateRGBF(node->storage, out[0]->vec, vec);
   if (fac != 1.0f) {
     interp_v3_v3v3(out[0]->vec, vec, out[0]->vec, fac);
   }
@@ -119,7 +119,7 @@ static void node_shader_exec_curve_rgb(void *UNUSED(data),
 
 static void node_shader_init_curve_rgb(bNodeTree *UNUSED(ntree), bNode *node)
 {
-  node->storage = curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
+  node->storage = BKE_curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
 }
 
 static int gpu_shader_curve_rgb(GPUMaterial *mat,
@@ -134,8 +134,8 @@ static int gpu_shader_curve_rgb(GPUMaterial *mat,
 
   CurveMapping *cumap = node->storage;
 
-  curvemapping_initialize(cumap);
-  curvemapping_table_RGBA(cumap, &array, &size);
+  BKE_curvemapping_initialize(cumap);
+  BKE_curvemapping_table_RGBA(cumap, &array, &size);
   GPUNodeLink *tex = GPU_color_band(mat, size, array, &layer);
 
   float ext_rgba[4][4];
index 1087d05d040caf0d0fe49d5a882fb019e778c170..2e2687bd50ebd7be18811947f6e646fa156d03c7 100644 (file)
@@ -39,8 +39,8 @@ static void time_colorfn(
     fac = (p->cfra - node->custom1) / (float)(node->custom2 - node->custom1);
   }
 
-  curvemapping_initialize(node->storage);
-  fac = curvemapping_evaluateF(node->storage, 0, fac);
+  BKE_curvemapping_initialize(node->storage);
+  fac = BKE_curvemapping_evaluateF(node->storage, 0, fac);
   out[0] = CLAMPIS(fac, 0.0f, 1.0f);
 }
 
@@ -58,7 +58,7 @@ static void time_init(bNodeTree *UNUSED(ntree), bNode *node)
 {
   node->custom1 = 1;
   node->custom2 = 250;
-  node->storage = curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
+  node->storage = BKE_curvemapping_add(1, 0.0f, 0.0f, 1.0f, 1.0f);
 }
 
 void register_node_type_tex_curve_time(void)
@@ -91,7 +91,7 @@ static void rgb_colorfn(float *out, TexParams *p, bNode *node, bNodeStack **in,
   float cin[4];
   tex_input_rgba(cin, in[0], p, thread);
 
-  curvemapping_evaluateRGBF(node->storage, out, cin);
+  BKE_curvemapping_evaluateRGBF(node->storage, out, cin);
   out[3] = cin[3];
 }
 
@@ -107,7 +107,7 @@ static void rgb_exec(void *data,
 
 static void rgb_init(bNodeTree *UNUSED(ntree), bNode *node)
 {
-  node->storage = curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
+  node->storage = BKE_curvemapping_add(4, 0.0f, 0.0f, 1.0f, 1.0f);
 }
 
 void register_node_type_tex_curve_rgb(void)
index 8764671ae045299d95db49dd2f20db69e0b0a04c..d620cd38b7648bb337753138db9e8b820911f9b4 100644 (file)
@@ -642,7 +642,7 @@ void RE_FreeRender(Render *re)
   BLI_freelistN(&re->view_layers);
   BLI_freelistN(&re->r.views);
 
-  curvemapping_free_data(&re->r.mblur_shutter_curve);
+  BKE_curvemapping_free_data(&re->r.mblur_shutter_curve);
 
   /* main dbase can already be invalid now, some database-free code checks it */
   re->main = NULL;
@@ -772,12 +772,12 @@ static void re_init_resolution(Render *re, Render *source, int winx, int winy, r
 void render_copy_renderdata(RenderData *to, RenderData *from)
 {
   BLI_freelistN(&to->views);
-  curvemapping_free_data(&to->mblur_shutter_curve);
+  BKE_curvemapping_free_data(&to->mblur_shutter_curve);
 
   *to = *from;
 
   BLI_duplicatelist(&to->views, &from->views);
-  curvemapping_copy_data(&to->mblur_shutter_curve, &from->mblur_shutter_curve);
+  BKE_curvemapping_copy_data(&to->mblur_shutter_curve, &from->mblur_shutter_curve);
 }
 
 /* what doesn't change during entire render sequence */
index 75ddf7e0b225c3a18c91f2a8225995a592c22de4..3ede55434b95eb1857f7768b00692dd4891b03fc 100644 (file)
@@ -557,8 +557,8 @@ static float density_falloff(PointDensityRangeData *pdr, int index, float square
   }
 
   if (pdr->density_curve && dist != 0.0f) {
-    curvemapping_initialize(pdr->density_curve);
-    density = curvemapping_evaluateF(pdr->density_curve, 0, density / dist) * dist;
+    BKE_curvemapping_initialize(pdr->density_curve);
+    density = BKE_curvemapping_evaluateF(pdr->density_curve, 0, density / dist) * dist;
   }
 
   return density;