Laxkit
0.0.7.1
|
Public Types | |
enum | CurveTypes { Linear, Autosmooth, Bezier } |
Public Member Functions | |
CurveInfo (const char *ntitle, const char *xl, double nxmin, double nxmax, const char *yl, double nymin, double nymax) | |
virtual const char * | whattype () |
virtual void | SetXBounds (double nxmin, double nxmax) |
virtual void | SetYBounds (double nymin, double nymax) |
virtual void | SetTitle (const char *ntitle) |
virtual double | f (double x) |
virtual double | f_linear (double x) |
Return y value for x. Out of range x and y are clamped to bounds. | |
virtual double | f_autosmooth (double x) |
Return y value for x. Out of range x and y are clamped to bounds. | |
virtual double | f_bezier (double x) |
Return y value for x. Out of range x and y are clamped to bounds. | |
virtual flatpoint | MapUnitPoint (flatpoint p) |
virtual int | AddPoint (double x, double y) |
virtual int | MovePoint (int index, double x, double y) |
virtual void | SetSinusoidal (int samples) |
virtual void | Reset () |
virtual void | MakeFakeCurve () |
Fills fauxpoints with c-v-c-c-v-c... | |
virtual int | MakeLookupTable (int *table, int numentries, int minvalue, int maxvalue) |
virtual void | RefreshLookup () |
Refresh the integer approximation lookup table. | |
virtual void | RefreshLookup (int nsamples, int nmin, int nmax) |
Refresh the integer approximation lookup table, adjusting sample size and bounds. | |
virtual void | LookupDump (const char *label, FILE *f) |
virtual void | dump_out (FILE *f, int indent, int what, anObject *context) |
virtual LaxFiles::Attribute * | dump_out_atts (LaxFiles::Attribute *att, int what, anObject *context) |
virtual void | dump_in_atts (LaxFiles::Attribute *att, int flag, anObject *context) |
Public Member Functions inherited from Laxkit::anObject | |
anObject () | |
Set object_id=getUniqueNumber(). | |
virtual | ~anObject () |
Empty virtual destructor. | |
virtual anObject * | duplicate (anObject *ref=NULL) |
virtual int | inc_count () |
Increment the data's count by 1. Returns count. | |
virtual int | dec_count () |
Decrement the count of the data, deleting if count is less than or equal to 0. | |
virtual int | the_count () |
Public Member Functions inherited from LaxFiles::DumpUtility | |
virtual void | dump_in (FILE *f, int indent, int what, Laxkit::anObject *loadcontext, Attribute **att) |
Read in a file segment as an Attribute, and pass parsing duties to dump_in_atts. | |
virtual | ~DumpUtility () |
Empty virtual destructor. |
Public Attributes | |
double | xmin |
double | xmax |
double | ymin |
double | ymax |
char * | xlabel |
char * | ylabel |
char * | title |
CurveTypes | curvetype |
int | numsamples |
int | lookup_min |
int | lookup_max |
int * | lookup |
NumStack< flatpoint > | points |
NumStack< flatpoint > | fauxpoints |
Public Attributes inherited from Laxkit::anObject | |
int | suppress_debug |
DeleteRefCountedFunc | deleteMe |
Called when the count is decremented to 0. | |
unsigned long | object_id |
char * | object_idstr |
Private Member Functions | |
void | base_init () |
Additional Inherited Members | |
Protected Attributes inherited from Laxkit::anObject | |
int | _count |
The reference count of the object. |
Info for x -> y transformation
|
virtual |
x,y are in actual range (as opposed to points space). Point is clamped to proper range.
Return 0 for success.
|
virtual |
Fills fauxpoints with c-v-c-c-v-c...
Basically for each point, push handles that are parallel to a line connecting the points on either side.
Note this is not a very good way to approximate points when there are a lot of points. It does ok for a very sparse collection of points.
References flatvector::normalize().
Referenced by Laxkit::CurveWindow::MouseMove().
|
virtual |
numentries must be 2 or greater. Assumes table is already allocated.
Return -1 for error, or 0 for success.
Adjust existing point. x value is clamped to adjacent bounds.
Refresh the integer approximation lookup table, adjusting sample size and bounds.
If nsamples is > 0, then use that as new sample size and bounds.
|
virtual |
Resets to 2 point linear, 0 to 1 (unmapped). Does NOT change bounds.
Referenced by Laxkit::CurveWindow::Reset().
|
virtual |
Make a sine like curve with max point at minx, min point at maxx. samples needs to be >= 2.