app: change the value to render in the GimpScanConvert API to a 0..1 double

This commit is contained in:
Michael Natterer 2012-05-13 23:13:53 +02:00
parent e7618dab31
commit c4142d0574
3 changed files with 12 additions and 12 deletions

View File

@ -345,7 +345,7 @@ gimp_scan_convert_render (GimpScanConvert *sc,
gboolean antialias)
{
gimp_scan_convert_render_full (sc, buffer, off_x, off_y,
TRUE, antialias, 255);
TRUE, antialias, 1.0);
}
/**
@ -368,7 +368,7 @@ gimp_scan_convert_render_value (GimpScanConvert *sc,
GeglBuffer *buffer,
gint off_x,
gint off_y,
guchar value)
gdouble value)
{
gimp_scan_convert_render_full (sc, buffer, off_x, off_y,
TRUE, FALSE, value);
@ -393,7 +393,7 @@ gimp_scan_convert_compose (GimpScanConvert *sc,
gint off_y)
{
gimp_scan_convert_render_full (sc, buffer, off_x, off_y,
FALSE, FALSE, 255);
FALSE, FALSE, 1.0);
}
/**
@ -415,7 +415,7 @@ gimp_scan_convert_compose_value (GimpScanConvert *sc,
GeglBuffer *buffer,
gint off_x,
gint off_y,
gint value)
gdouble value)
{
gimp_scan_convert_render_full (sc, buffer, off_x, off_y,
FALSE, FALSE, value);
@ -446,7 +446,7 @@ gimp_scan_convert_render_full (GimpScanConvert *sc,
gint off_y,
gboolean replace,
gboolean antialias,
guchar value)
gdouble value)
{
const Babl *format;
GeglBufferIterator *iter;
@ -534,7 +534,7 @@ gimp_scan_convert_render_full (GimpScanConvert *sc,
cairo_paint (cr);
}
cairo_set_source_rgba (cr, 0, 0, 0, value / 255.0);
cairo_set_source_rgba (cr, 0, 0, 0, value);
cairo_append_path (cr, &path);
cairo_set_antialias (cr, antialias ?

View File

@ -48,7 +48,7 @@ void gimp_scan_convert_render_full (GimpScanConvert *sc,
gint off_y,
gboolean replace,
gboolean antialias,
guchar value);
gdouble value);
void gimp_scan_convert_render (GimpScanConvert *sc,
GeglBuffer *buffer,
@ -59,7 +59,7 @@ void gimp_scan_convert_render_value (GimpScanConvert *sc,
GeglBuffer *buffer,
gint off_x,
gint off_y,
guchar value);
gdouble value);
void gimp_scan_convert_compose (GimpScanConvert *sc,
GeglBuffer *buffer,
gint off_x,
@ -68,7 +68,7 @@ void gimp_scan_convert_compose_value (GimpScanConvert *sc,
GeglBuffer *buffer,
gint off_x,
gint off_y,
gint value);
gdouble value);
#endif /* __GIMP_SCAN_CONVERT_H__ */

View File

@ -634,7 +634,7 @@ gimp_foreground_select_tool_select (GimpFreeSelectTool *free_sel,
gimp_scan_convert_render_value (scan_convert,
gimp_drawable_get_buffer (GIMP_DRAWABLE (mask)),
0, 0, 128);
0, 0, 0.5);
gimp_scan_convert_free (scan_convert);
if (fg_select->strokes)
@ -789,8 +789,8 @@ gimp_foreground_select_tool_stroke (GimpChannel *mask,
GIMP_JOIN_ROUND, GIMP_CAP_ROUND, 10.0,
0.0, NULL);
gimp_scan_convert_compose_value (scan_convert,
gimp_drawable_get_buffer (GIMP_DRAWABLE (mask)),
0, 0, stroke->background ? 0 : 255);
gimp_drawable_get_buffer (GIMP_DRAWABLE (mask)),
0, 0, stroke->background ? 0.0 : 1.0);
gimp_scan_convert_free (scan_convert);
}