libmypaint  1.6.0
Public Member Functions
MyPaintMapping Class Reference

A sequence of piecewise linear functions. More...

#include <mypaint-mapping.h>

Public Member Functions

MyPaintMappingmypaint_mapping_new (int inputs_)
 Create new mappings for a set number of inputs. More...
 
void mypaint_mapping_free (MyPaintMapping *self)
 Free an instance of MyPaintMapping. More...
 
float mypaint_mapping_get_base_value (MyPaintMapping *self)
 Get the base value of the mappings. More...
 
void mypaint_mapping_set_base_value (MyPaintMapping *self, float value)
 Set the base value of the mappings. More...
 
void mypaint_mapping_set_n (MyPaintMapping *self, int input, int n)
 Set the number of control points used for the input. More...
 
int mypaint_mapping_get_n (MyPaintMapping *self, int input)
 Get the number of control points used for the input. More...
 
void mypaint_mapping_set_point (MyPaintMapping *self, int input, int index, float x, float y)
 Set the x, y coordinates for a control point. More...
 
void mypaint_mapping_get_point (MyPaintMapping *self, int input, int index, float *x, float *y)
 Get the x, y coordinates for a control point. More...
 
gboolean mypaint_mapping_is_constant (MyPaintMapping *self)
 Returns TRUE if none of the mappings are used. More...
 
int mypaint_mapping_get_inputs_used_n (MyPaintMapping *self)
 Get the number of inputs that have control points. More...
 
float mypaint_mapping_calculate (MyPaintMapping *self, float *data)
 Calculate the output of the mapping, given an input value for each mapping. More...
 
float mypaint_mapping_calculate_single_input (MyPaintMapping *self, float input)
 Calculate the output for a single-input mapping. More...
 

Detailed Description

A sequence of piecewise linear functions.

Each function is built from a set of x,y control points.

Primarily used to map inputs to setting values in instances of MyPaintBrush.

Member Function Documentation

◆ mypaint_mapping_calculate()

float mypaint_mapping_calculate ( MyPaintMapping self,
float *  data 
)

Calculate the output of the mapping, given an input value for each mapping.

◆ mypaint_mapping_calculate_single_input()

float mypaint_mapping_calculate_single_input ( MyPaintMapping self,
float  input 
)

Calculate the output for a single-input mapping.

◆ mypaint_mapping_free()

void mypaint_mapping_free ( MyPaintMapping self)

Free an instance of MyPaintMapping.

◆ mypaint_mapping_get_base_value()

float mypaint_mapping_get_base_value ( MyPaintMapping self)

Get the base value of the mappings.

◆ mypaint_mapping_get_inputs_used_n()

int mypaint_mapping_get_inputs_used_n ( MyPaintMapping self)

Get the number of inputs that have control points.

◆ mypaint_mapping_get_n()

int mypaint_mapping_get_n ( MyPaintMapping self,
int  input 
)

Get the number of control points used for the input.

◆ mypaint_mapping_get_point()

void mypaint_mapping_get_point ( MyPaintMapping self,
int  input,
int  index,
float *  x,
float *  y 
)

Get the x, y coordinates for a control point.

◆ mypaint_mapping_is_constant()

gboolean mypaint_mapping_is_constant ( MyPaintMapping self)

Returns TRUE if none of the mappings are used.

See also
mypaint_brush_is_constant

◆ mypaint_mapping_new()

MyPaintMapping * mypaint_mapping_new ( int  inputs_)

Create new mappings for a set number of inputs.

◆ mypaint_mapping_set_base_value()

void mypaint_mapping_set_base_value ( MyPaintMapping self,
float  value 
)

Set the base value of the mappings.

◆ mypaint_mapping_set_n()

void mypaint_mapping_set_n ( MyPaintMapping self,
int  input,
int  n 
)

Set the number of control points used for the input.

◆ mypaint_mapping_set_point()

void mypaint_mapping_set_point ( MyPaintMapping self,
int  input,
int  index,
float  x,
float  y 
)

Set the x, y coordinates for a control point.


The documentation for this class was generated from the following file: