Commit 2b2bd6e9 authored by Michael Natterer's avatar Michael Natterer 😴 Committed by Michael Natterer

app/gegl/gimpoperationcolorbalance.c app/gegl/gimpoperationcolorize.c

2008-01-28  Michael Natterer  <mitch@gimp.org>

	* app/gegl/gimpoperationcolorbalance.c
	* app/gegl/gimpoperationcolorize.c
	* app/gegl/gimpoperationcurves.c
	* app/gegl/gimpoperationdesaturate.c
	* app/gegl/gimpoperationhuesaturation.c
	* app/gegl/gimpoperationlevels.c
	* app/gegl/gimpoperationposterize.c
	* app/gegl/gimpoperationthreshold.c: replace for() loops over the
	samples by while() loop counting down the passed "samples"
	parameter.


svn path=/trunk/; revision=24738
parent 4e93a806
2008-01-28 Michael Natterer <mitch@gimp.org>
* app/gegl/gimpoperationcolorbalance.c
* app/gegl/gimpoperationcolorize.c
* app/gegl/gimpoperationcurves.c
* app/gegl/gimpoperationdesaturate.c
* app/gegl/gimpoperationhuesaturation.c
* app/gegl/gimpoperationlevels.c
* app/gegl/gimpoperationposterize.c
* app/gegl/gimpoperationthreshold.c: replace for() loops over the
samples by while() loop counting down the passed "samples"
parameter.
2008-01-28 Michael Natterer <mitch@gimp.org>
* app/gegl/gimpcolorbalanceconfig.c
......
......@@ -119,12 +119,11 @@ gimp_operation_color_balance_process (GeglOperation *operation,
GimpColorBalanceConfig *config = GIMP_COLOR_BALANCE_CONFIG (point->config);
gfloat *src = in_buf;
gfloat *dest = out_buf;
glong sample;
if (! config)
return FALSE;
for (sample = 0; sample < samples; sample++)
while (samples--)
{
gfloat r = src[RED_PIX];
gfloat g = src[GREEN_PIX];
......
......@@ -83,7 +83,6 @@ gimp_operation_colorize_process (GeglOperation *operation,
gfloat *src = in_buf;
gfloat *dest = out_buf;
GimpHSL hsl;
glong sample;
if (! config)
return FALSE;
......@@ -91,7 +90,7 @@ gimp_operation_colorize_process (GeglOperation *operation,
hsl.h = config->hue;
hsl.s = config->saturation;
for (sample = 0; sample < samples; sample++)
while (samples--)
{
GimpRGB rgb;
gfloat lum = GIMP_RGB_LUMINANCE (src[RED_PIX],
......
......@@ -107,12 +107,11 @@ gimp_operation_curves_process (GeglOperation *operation,
GimpCurvesConfig *config = GIMP_CURVES_CONFIG (point->config);
gfloat *src = in_buf;
gfloat *dest = out_buf;
glong sample;
if (! config)
return FALSE;
for (sample = 0; sample < samples; sample++)
while (samples--)
{
gint channel;
......
......@@ -137,9 +137,8 @@ gimp_operation_desaturate_process (GeglOperation *operation,
GimpOperationDesaturate *self = GIMP_OPERATION_DESATURATE (operation);
gfloat *src = in_buf;
gfloat *dest = out_buf;
glong sample;
for (sample = 0; sample < samples; sample++)
while (samples--)
{
gfloat value = 0.0;
......
......@@ -132,12 +132,11 @@ gimp_operation_hue_saturation_process (GeglOperation *operation,
gfloat *src = in_buf;
gfloat *dest = out_buf;
gfloat overlap = config->overlap / 2.0;
glong sample;
if (! config)
return FALSE;
for (sample = 0; sample < samples; sample++)
while (samples--)
{
GimpRGB rgb;
GimpHSL hsl;
......
......@@ -114,12 +114,11 @@ gimp_operation_levels_process (GeglOperation *operation,
GimpLevelsConfig *config = GIMP_LEVELS_CONFIG (point->config);
gfloat *src = in_buf;
gfloat *dest = out_buf;
glong sample;
if (! config)
return FALSE;
for (sample = 0; sample < samples; sample++)
while (samples--)
{
gint channel;
......
......@@ -84,12 +84,11 @@ gimp_operation_posterize_process (GeglOperation *operation,
gfloat *src = in_buf;
gfloat *dest = out_buf;
gfloat levels = config->levels - 1.0;
glong sample;
if (! config)
return FALSE;
for (sample = 0; sample < samples; sample++)
while (samples--)
{
dest[RED_PIX] = RINT (src[RED_PIX] * levels) / levels;
dest[GREEN_PIX] = RINT (src[GREEN_PIX] * levels) / levels;
......
......@@ -82,12 +82,11 @@ gimp_operation_threshold_process (GeglOperation *operation,
GimpThresholdConfig *config = GIMP_THRESHOLD_CONFIG (point->config);
gfloat *src = in_buf;
gfloat *dest = out_buf;
glong sample;
if (! config)
return FALSE;
for (sample = 0; sample < samples; sample++)
while (samples--)
{
gfloat value;
......
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