gnome-scan r785 - in trunk: . modules/gsane
- From: bersace svn gnome org
- To: svn-commits-list gnome org
- Subject: gnome-scan r785 - in trunk: . modules/gsane
- Date: Thu, 15 Jan 2009 18:03:28 +0000 (UTC)
Author: bersace
Date: Thu Jan 15 18:03:28 2009
New Revision: 785
URL: http://svn.gnome.org/viewvc/gnome-scan?rev=785&view=rev
Log:
Renamed private fields.
Modified:
trunk/ChangeLog
trunk/modules/gsane/gsane-processor.c
Modified: trunk/modules/gsane/gsane-processor.c
==============================================================================
--- trunk/modules/gsane/gsane-processor.c (original)
+++ trunk/modules/gsane/gsane-processor.c Thu Jan 15 18:03:28 2009
@@ -65,11 +65,12 @@
guint32 sample_pattern;
/* pointer to the processor function */
GSaneProcessorFunc process;
- /* value for black pixel in 1bit, it changes whether it's grey
- or RGB :/ . (see SANE 1.X standard). So we put black and
- white value in variable to swap them transparently. */
- guchar black;
- guchar white;
+ /* target sample value for SANE 1bit sample value, it changes
+ whether it's grey or RGB :/ . (see SANE 1.X standard). So
+ we swap min and max value upon frame configuration to
+ transparently handle this special case. */
+ guchar minval;
+ guchar maxval;
};
@@ -94,7 +95,7 @@
guint i, j;
for (i = 0; i < buf_len; i++)
for (j = 0; j < 8; j++)
- buf8[i * 8 + j] = (buf[i] & (1 << (7 - j))) ? self->priv->white : self->priv->black;
+ buf8[i * 8 + j] = (buf[i] & (1 << (7 - j))) ? self->priv->maxval : self->priv->minval;
gegl_buffer_set(self->priv->buffer, &roi, self->priv->format, buf8, GEGL_AUTO_ROWSTRIDE);
g_free(buf8);
}
@@ -382,13 +383,12 @@
self->priv->sample_offset = gsane_processor_get_sample_offset(self);
switch(params->format) {
case SANE_FRAME_GRAY:
- /* Invert black and white. */
- self->priv->black = 0xFF;
- self->priv->white = 0x00;
+ self->priv->minval = 0xFF; /* 0 = white */
+ self->priv->maxval = 0x00; /* 1 = black */
break;
default:
- self->priv->black = 0x00;
- self->priv->white = 0xFF;
+ self->priv->minval = 0x00; /* 0 = min (R, G or B) */
+ self->priv->maxval = 0xFF; /* 1 = max */
break;
}
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]