GSP
Quick Navigator

Search Site

Unix VPS
A - Starter
B - Basic
C - Preferred
D - Commercial
MPS - Dedicated
Previous VPSs
* Sign Up! *

Support
Contact Us
Online Help
Handbooks
Domain Status
Man Pages

FAQ
Virtual Servers
Pricing
Billing
Technical

Network
Facilities
Connectivity
Topology Map

Miscellaneous
Server Agreement
Year 2038
Credits
 

USA Flag

 

 

Man Pages
KPLOT_ATTACH_DATA(3) FreeBSD Library Functions Manual KPLOT_ATTACH_DATA(3)

kplot_attach_dataassign plot data to plotting context

library “libkplot”

#include <cairo.h>
#include <kplot.h>

int
kplot_attach_data(const struct kplot *p, struct kdata *d, enum kplottype t, const struct kdatacfg *cfg);

The kplot_attach_data function assigns a data source d to a plotting context p, reference-counting the data source in the process. The plot style assigned to the plot is t. The style may be one of the following:

Points (really circles of a given radius).
Marks in the form of x's of a given width.
Smooth lines.
A combination of KPLOT_LINES and KPLOT_POINTS.
A combination of KPLOT_LINES and KPLOT_MARKS.

The options provided via the cfg object are as follows:

point
The configuration for KPLOT_POINTS, KPLOT_MARKS, KPLOT_LINESMARKS, and KPLOT_LINESPOINTS plots.
line
The configuration for KPLOT_LINES KPLOT_LINESMARKS and KPLOT_LINESPOINTS types.

The struct kplotline structure is arranged as follows:

sz
The diameter of the line in pixels as defined by Cairo's (). By default, this is 1.0.
dashes
A dash configuration as described by Cairo's () function. By default, solid lines are used.
dashesz
See dashes.
dashoff
See dashoff.
join
The line join as defined by Cairo's (). By default, use CAIRO_LINE_JOIN_ROUND.
clr
The colour configuration. By default, use KPLOTCTYPE_DEFAULT.

The struct kplotpoint structure is arranged as follows:

sz
The diameter of the point line in pixels as defined by Cairo's (). By default, this is 1.0.
radius
The circle radius defaulting to 3.0. It is also used for the mark width.
dashes
A dash configuration as described by Cairo's () function. By default, solid lines are used.
dashesz
See dashes.
dashoff
See dashoff.
clr
The colour configuration. By default, use KPLOTCTYPE_DEFAULT.

Line-drawing colours are dictated by struct kplotccfg, which is defined as follows:

type
The type of colour. If set to KPLOTCTYPE_DEFAULT (the default), the KPLOTCTYPE_RGBA option will be set during kplot_draw(3) to the index of the line in the set of lines. If KPLOTCTYPE_PALETTE, palette is used as an index into the colour palette matrix. This is clamped (modulo) to the palette size. The KPLOTCTYPE_PATTERN will have use pattern, which may not be NULL. The pattern is referenced when attached and dereferenced when the data source is removed from the plot. Lastly, KPLOTCTYPE_RGBA will use the RGBA entries (in the unit interval) of rgba to set colours. This is the preferred method, as it does not involve any dynamic memory allocation overhead.
pattern
The pattern used with KPLOTCTYPE_PATTERN.
rgba
The RGBA (in the unit interval) used with KPLOTCTYPE_RGBA.
palette
The palette index used for KPLOTCTYPE_PALETTE.

If NULL is passed as a configuration, the defaults will be used.

kplot_attach_data returns 0 if allocation of internal structures fails due to memory exhaustion. In this case, all allocations and references will be dropped.

kplot(3), kplot_attach_datas(3), kplot_attach_smooth(3)

November 3, 2016 FreeBSD 14.3-RELEASE

Search for    or go to Top of page |  Section 3 |  Main Index

Powered by GSP Visit the GSP FreeBSD Man Page Interface.
Output converted with ManDoc.