Skip to content

An interface for controlling a 1D cubic spline, continuously evaluated and stored in a lookup table.

Notifications You must be signed in to change notification settings

charlesveasey/ofxCurvesTool

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ofxCurvesTool is an addon for openFrameworks

ofxCurvesTool provides an interface for controlling a cubic spline that is continuously evaluated and stored in a lookup table.

LUT Access

To get access to the data stored inside the curve, just use the [] operator. For example, to make a horizontally fading gradient inside a 256x256 image:

for(int x = 0; x < 256; x++) {
	for(int y = 0; y < 256; y++) {
		img.setColor(x, y, ofColor(curvesTool[x]));
	}
}

Enable/Disable

The interface only listens to mouse and keyboard events when it is drawn. It's a little magical, but if you're interested in the details see the implementation for ofxCurvesTool::drawEvent().

Loading/Saving

ofxCurvesTool stores data in an anonymous list of lists, using a severely simplified YAML representation. Call ofxCurvesTool::save() or ofxCurvesTool::load() with a .yml extension.

Size

By default ofxCurvesTool uses 256 bins, but if you call ofxCurvesTool::setup(128) (for example) it will use 128 bins instead.

Drawing

If you happen to scale or rotate ofxCurvesTool, it may get confused about where your mouse is clicking, but it's ok to translate it however you like.

About

An interface for controlling a 1D cubic spline, continuously evaluated and stored in a lookup table.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C++ 97.3%
  • Makefile 2.7%