# curvewarp.cpp File Reference

Implementation of the "Curve Warp" layer. More...

`#include "curvewarp.h"`
`#include <synfig/context.h>`
`#include <synfig/paramdesc.h>`
`#include <synfig/surface.h>`
`#include <synfig/valuenode.h>`
`#include <ETL/calculus>`

## Defines

#define | FAKE_TANGENT_STEP 0.000001
#define | TOO_THIN 0.01
#define | POINT_CHECK(x) bp=curve(x); thisdist=(bp-p).mag_squared(); if(thisdist<dist) { extreme = (first&&x<0.01); ret=iter; best_len = total_len; dist=thisdist; best_curve=curve; last=true; best_pos=x;}
#define | UPDATE_DIST
#define | MAXPIX 10000

## Functions

| SYNFIG_LAYER_INIT (CurveWarp)
| SYNFIG_LAYER_SET_NAME (CurveWarp,"curve_warp")
| SYNFIG_LAYER_SET_LOCAL_NAME (CurveWarp, N_("Curve Warp"))
| SYNFIG_LAYER_SET_CATEGORY (CurveWarp, N_("Distortions"))
| SYNFIG_LAYER_SET_VERSION (CurveWarp,"0.0")
| SYNFIG_LAYER_SET_CVS_ID (CurveWarp,"$Id$")
float | calculate_distance (const std::vector< synfig::BLinePoint > &bline)
std::vector < synfig::BLinePoint > ::const_iterator | find_closest_to_bline (bool fast, const std::vector< synfig::BLinePoint > &bline, const Point &p, float &t, float &len, bool &extreme)

## Detailed Description

Implementation of the "Curve Warp" layer.

$Id$

=== N O T E S ===========================================================

=========================================================================

## Define Documentation

#define FAKE_TANGENT_STEP 0.000001

Referenced by CurveWarp::transform().

#define TOO_THIN 0.01

Referenced by CurveWarp::transform().

#define POINT_CHECK | ( | x |  | ) | bp=curve(x); thisdist=(bp-p).mag_squared(); if(thisdist<dist) { extreme = (first&&x<0.01); ret=iter; best_len = total_len; dist=thisdist; best_curve=curve; last=true; best_pos=x;}

Referenced by find_closest(), and find_closest_to_bline().

#define UPDATE_DIST

Value:

    if (dist < min_dist) min_dist = dist; \
        if (dist > max_dist) max_dist = dist; \
        if (along < min_along) min_along = along; \
        if (along > max_along) max_along = along

Referenced by CurveWarp::accelerated_render().

#define MAXPIX 10000

Referenced by CurveWarp::accelerated_render().

## Function Documentation

SYNFIG_LAYER_INIT | ( | CurveWarp |  | ) |

SYNFIG_LAYER_SET_NAME | ( | CurveWarp | ,
|  | "curve_warp" |  |
| ) |  |  |

SYNFIG_LAYER_SET_LOCAL_NAME | ( | CurveWarp | ,
|  | N_("Curve Warp") |  |
| ) |  |  |

SYNFIG_LAYER_SET_CATEGORY | ( | CurveWarp | ,
|  | N_("Distortions") |  |
| ) |  |  |

SYNFIG_LAYER_SET_VERSION | ( | CurveWarp | ,
|  | "0.0" |  |
| ) |  |  |

SYNFIG_LAYER_SET_CVS_ID | ( | CurveWarp | ,
|  | "$Id$" |  |
| ) |  |  |

float calculate_distance | ( | const std::vector< synfig::BLinePoint > & | bline | ) | `[inline]`

std::vector<synfig::BLinePoint>::const_iterator find_closest_to_bline | ( | bool | fast,
|  | const std::vector< synfig::BLinePoint > & | bline,
|  | const Point & | p,
|  | float & | t,
|  | float & | len,
|  | bool & | extreme |
| ) |  |  |

References POINT_CHECK.

Referenced by CurveWarp::transform().