mirror of https://github.com/GNOME/gimp.git
clamp values used for the exponent map to 1..255. Fixes bug #478618.
2007-10-02 Sven Neumann <sven@gimp.org> * plug-ins/common/oilify.c (get_map_value): clamp values used for the exponent map to 1..255. Fixes bug #478618. svn path=/trunk/; revision=23715
This commit is contained in:
parent
f3d514c845
commit
1f4c2a1f96
|
@ -1,3 +1,8 @@
|
|||
2007-10-02 Sven Neumann <sven@gimp.org>
|
||||
|
||||
* plug-ins/common/oilify.c (get_map_value): clamp values used for
|
||||
the exponent map to 1..255. Fixes bug #478618.
|
||||
|
||||
2007-10-02 Kevin Cozens <kcozens@cvs.gnome.org>
|
||||
|
||||
* plug-ins/script-fu/scripts/guides-new.scm: Use 'list' to create
|
||||
|
|
|
@ -270,7 +270,7 @@ run (const gchar *name,
|
|||
* Helper function to read a sample from a mask-size/exponent map
|
||||
*/
|
||||
static inline gfloat
|
||||
get_map_value (guchar *src,
|
||||
get_map_value (const guchar *src,
|
||||
gint bpp)
|
||||
{
|
||||
gfloat value;
|
||||
|
@ -278,7 +278,10 @@ get_map_value (guchar *src,
|
|||
if (bpp >= 3)
|
||||
value = GIMP_RGB_LUMINANCE (src[0], src[1], src[2]);
|
||||
else
|
||||
value = (gfloat) *src;
|
||||
value = *src;
|
||||
|
||||
if (value < 1.0)
|
||||
value = 1.0;
|
||||
|
||||
/* value should be in [0,1] */
|
||||
value /= 255.0;
|
||||
|
|
Loading…
Reference in New Issue