libgutenprint API Reference 5.2.9

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- File List
- Globals

Data Structures | Typedefs | Enumerations | Functions
curve.h File Reference

Curve functions. More...

`#include <stdio.h>`
`#include <stdlib.h>`
`#include <gutenprint/sequence.h>`

## Data Structures

struct | stp_curve_point_t
| Point (x,y) for piecewise curve. More...

## Typedefs

typedef struct stp_curve | stp_curve_t
| The curve opaque data type.

## Enumerations

enum | stp_curve_type_t { STP_CURVE_TYPE_LINEAR, STP_CURVE_TYPE_SPLINE }
| Curve types. More...
enum | stp_curve_wrap_mode_t { STP_CURVE_WRAP_NONE, STP_CURVE_WRAP_AROUND }
| Wrapping mode. More...
enum | stp_curve_compose_t { STP_CURVE_COMPOSE_ADD, STP_CURVE_COMPOSE_MULTIPLY, STP_CURVE_COMPOSE_EXPONENTIATE }
| Composition types. More...
enum | stp_curve_bounds_t { STP_CURVE_BOUNDS_RESCALE, STP_CURVE_BOUNDS_CLIP, STP_CURVE_BOUNDS_ERROR }
| Behaviour when curve exceeds bounds. More...

## Functions

stp_curve_t * | stp_curve_create (stp_curve_wrap_mode_t wrap)
| Create a new curve.
stp_curve_t * | stp_curve_create_copy (const stp_curve_t *curve)
| Copy and allocate a curve.
void | stp_curve_copy (stp_curve_t *dest, const stp_curve_t *source)
| Copy a curve.
stp_curve_t * | stp_curve_create_reverse (const stp_curve_t *curve)
| Reverse and allocate a curve.
void | stp_curve_reverse (stp_curve_t *dest, const stp_curve_t *source)
| Reverse a curve.
void | stp_curve_destroy (stp_curve_t *curve)
| Destroy an curve.
int | stp_curve_set_bounds (stp_curve_t *curve, double low, double high)
| Set the lower and upper bounds on a curve.
void | stp_curve_get_bounds (const stp_curve_t *curve, double *low, double *high)
| Get the lower and upper bounds on a curve.
stp_curve_wrap_mode_t | stp_curve_get_wrap (const stp_curve_t *curve)
| Get the wrapping mode.
int | stp_curve_is_piecewise (const stp_curve_t *curve)
| Determine whether the curve is piecewise.
void | stp_curve_get_range (const stp_curve_t *curve, double *low, double *high)
size_t | stp_curve_count_points (const stp_curve_t *curve)
| Get the number of allocated points in the curve.
int | stp_curve_set_interpolation_type (stp_curve_t *curve, stp_curve_type_t itype)
| Set the curve interpolation type.
stp_curve_type_t | stp_curve_get_interpolation_type (const stp_curve_t *curve)
| Get the curve interpolation type.
int | stp_curve_set_data (stp_curve_t *curve, size_t count, const double *data)
| Set all data points of the curve.
int | stp_curve_set_data_points (stp_curve_t *curve, size_t count, const stp_curve_point_t *data)
| Set all data points of the curve.
int | stp_curve_set_float_data (stp_curve_t *curve, size_t count, const float *data)
| Set the data points in a curve from float values.
int | stp_curve_set_long_data (stp_curve_t *curve, size_t count, const long *data)
| Set the data points in a curve from long values.
int | stp_curve_set_ulong_data (stp_curve_t *curve, size_t count, const unsigned long *data)
| Set the data points in a curve from unsigned long values.
int | stp_curve_set_int_data (stp_curve_t *curve, size_t count, const int *data)
| Set the data points in a curve from integer values.
int | stp_curve_set_uint_data (stp_curve_t *curve, size_t count, const unsigned int *data)
| Set the data points in a curve from unsigned integer values.
int | stp_curve_set_short_data (stp_curve_t *curve, size_t count, const short *data)
| Set the data points in a curve from short values.
int | stp_curve_set_ushort_data (stp_curve_t *curve, size_t count, const unsigned short *data)
| Set the data points in a curve from unsigned short values.
stp_curve_t * | stp_curve_get_subrange (const stp_curve_t *curve, size_t start, size_t count)
| Get a curve containing a subrange of data.
int | stp_curve_set_subrange (stp_curve_t *curve, const stp_curve_t *range, size_t start)
const double * | stp_curve_get_data (const stp_curve_t *curve, size_t *count)
| Get a pointer to the curve's raw data.
const stp_curve_point_t * | stp_curve_get_data_points (const stp_curve_t *curve, size_t *count)
| Get a pointer to the curve's raw data as points.
const float * | stp_curve_get_float_data (const stp_curve_t *curve, size_t *count)
| Get pointer to the curve's raw data as floats.
const long * | stp_curve_get_long_data (const stp_curve_t *curve, size_t *count)
| Get pointer to the curve's raw data as longs.
const unsigned long * | stp_curve_get_ulong_data (const stp_curve_t *curve, size_t *count)
| Get pointer to the curve's raw data as unsigned longs.
const int * | stp_curve_get_int_data (const stp_curve_t *curve, size_t *count)
| Get pointer to the curve's raw data as integers.
const unsigned int * | stp_curve_get_uint_data (const stp_curve_t *curve, size_t *count)
| Get pointer to the curve's raw data as unsigned integers.
const short * | stp_curve_get_short_data (const stp_curve_t *curve, size_t *count)
| Get pointer to the curve's raw data as shorts.
const unsigned short * | stp_curve_get_ushort_data (const stp_curve_t *curve, size_t *count)
| Get pointer to the curve's raw data as unsigned shorts.
const stp_sequence_t * | stp_curve_get_sequence (const stp_curve_t *curve)
| Get the underlying stp_sequence_t data structure which stp_curve_t is derived from.
int | stp_curve_set_gamma (stp_curve_t *curve, double f_gamma)
| Set the gamma of a curve.
double | stp_curve_get_gamma (const stp_curve_t *curve)
| Get the gamma value of the curve.
int | stp_curve_set_point (stp_curve_t *curve, size_t where, double data)
| Set a point along the curve.
int | stp_curve_get_point (const stp_curve_t *curve, size_t where, double *data)
| Get a point along the curve.
int | stp_curve_interpolate_value (const stp_curve_t *curve, double where, double *result)
| Interpolate a point along the curve.
int | stp_curve_resample (stp_curve_t *curve, size_t points)
| Resample a curve (change the number of points).
int | stp_curve_rescale (stp_curve_t *curve, double scale, stp_curve_compose_t mode, stp_curve_bounds_t bounds_mode)
| Rescale a curve (multiply all points by a scaling constant).
int | stp_curve_write (FILE *file, const stp_curve_t *curve)
| Write a curve to a file.
char * | stp_curve_write_string (const stp_curve_t *curve)
| Write a curve to a string.
stp_curve_t * | stp_curve_create_from_stream (FILE *fp)
| Create a curve from a stream.
stp_curve_t * | stp_curve_create_from_file (const char *file)
| Create a curve from a stream.
stp_curve_t * | stp_curve_create_from_string (const char *string)
| Create a curve from a string.
int | stp_curve_compose (stp_curve_t **retval, stp_curve_t *a, stp_curve_t *b, stp_curve_compose_t mode, int points)
| Compose two curves, creating a third curve.

## Detailed Description

Curve functions.