gwypixfield — Draw GwyDataFields to GdkPixbufs
void | gwy_pixbuf_draw_data_field () |
void | gwy_pixbuf_draw_data_field_with_range () |
void | gwy_pixbuf_draw_data_field_adaptive () |
void | gwy_draw_data_field_map_adaptive () |
void | gwy_pixbuf_draw_data_field_as_mask () |
#include <libdraw/gwydraw.h>
The simpliest method to render a GwyDataField to a GdkPixbuf with a
false color scale is gwy_pixbuf_draw_data_field()
which uniformly stretches
the color gradient from value minimum to maximum. Functions
gwy_pixbuf_draw_data_field_with_range()
and
gwy_pixbuf_draw_data_field_adaptive()
offer other false color mapping
possibilities. A bit different is
gwy_pixbuf_draw_data_field_as_mask()
which represents the values as
opacities of a signle color.
void gwy_pixbuf_draw_data_field (GdkPixbuf *pixbuf
,GwyDataField *data_field
,GwyGradient *gradient
);
Paints a data field to a pixbuf with an auto-stretched color gradient.
Minimum data value is mapped to start of gradient
, maximum value to its
end, values between are mapped linearly to gradient
.
pixbuf |
A Gdk pixbuf to draw to. |
|
data_field |
A data field to draw. |
|
gradient |
A color gradient to draw with. |
void gwy_pixbuf_draw_data_field_with_range (GdkPixbuf *pixbuf
,GwyDataField *data_field
,GwyGradient *gradient
,gdouble minimum
,gdouble maximum
);
Paints a data field to a pixbuf with an explicite color gradient range.
minimum
and all smaller values are mapped to start of gradient
, maximum
and all greater values to its end, values between are mapped linearly to
gradient
.
pixbuf |
A Gdk pixbuf to draw to. |
|
data_field |
A data field to draw. |
|
gradient |
A color gradient to draw with. |
|
minimum |
The value corresponding to gradient start. |
|
maximum |
The value corresponding to gradient end. |
void gwy_pixbuf_draw_data_field_adaptive (GdkPixbuf *pixbuf
,GwyDataField *data_field
,GwyGradient *gradient
);
Paints a data field to a pixbuf with a color gradient adaptively.
The mapping from data field (minimum, maximum) range to gradient is nonlinear, deformed using inverse function to height density cummulative distribution.
pixbuf |
A Gdk pixbuf to draw to. |
|
data_field |
A data field to draw. |
|
gradient |
A color gradient to draw with. |
void gwy_draw_data_field_map_adaptive (GwyDataField *data_field
,const gdouble *z
,gdouble *mapped
,guint n
);
Maps ordinate values to interval [0,1] as
gwy_pixbuf_draw_data_field_adaptive()
would do.
This is useful to find out which positions in the false colour gradient correspond to specific values.
data_field |
A data field to draw. |
|
z |
Array of |
|
mapped |
Output array of size |
|
n |
Number of elements in |
Since: 2.39
void gwy_pixbuf_draw_data_field_as_mask (GdkPixbuf *pixbuf
,GwyDataField *data_field
,const GwyRGBA *color
);
Paints a data field to a pixbuf as a single-color mask with varying opacity.
Values equal or smaller to 0.0 are drawn as fully transparent, values greater or equal to 1.0 as fully opaque, values between are linearly mapped to pixel opacity.
pixbuf |
A Gdk pixbuf to draw to. |
|
data_field |
A data field to draw. |
|
color |
A color to use. |