gegl_coordinate_relative_to_pixel new utility function

Make it easier to write self documenting code for converting between relative
and pixel based coordinates. Given either buffer width or height as argument.
parent 2820f805
......@@ -113,6 +113,18 @@ void gegl_param_spec_set_property_key (GParamSpec *pspec,
const gchar *key_name,
const gchar *value);
static inline gdouble
gegl_coordinate_relative_to_pixel (gdouble relative, gdouble pixel_dim)
{
return relative * pixel_dim;
}
static inline gdouble
gegl_coordinate_pixel_to_relative (gdouble pixel, gdouble pixel_dim)
{
return pixel / pixel_dim;
}
G_END_DECLS
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment