summaryrefslogtreecommitdiff
path: root/backend/genesys_conv_hlp.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff-webhosting.net>2015-10-08 12:32:49 +0200
committerJörg Frings-Fürst <debian@jff-webhosting.net>2015-10-08 12:32:49 +0200
commitcfd27ef2ad8b005fd47ab41ef29b71d9e3d48201 (patch)
tree56cb8849a5df91b19b72fd4f48c79c343cd9bc5e /backend/genesys_conv_hlp.c
parentba8d09abe681600aad991f4a75e904615b7ed29f (diff)
Imported Upstream version 1.0.25upstream/1.0.25
Diffstat (limited to 'backend/genesys_conv_hlp.c')
-rw-r--r--backend/genesys_conv_hlp.c90
1 files changed, 45 insertions, 45 deletions
diff --git a/backend/genesys_conv_hlp.c b/backend/genesys_conv_hlp.c
index cae4116..7663a87 100644
--- a/backend/genesys_conv_hlp.c
+++ b/backend/genesys_conv_hlp.c
@@ -3,54 +3,54 @@
Copyright (C) 2005 Pierre Willenbrock <pierre@pirsoft.dnsalias.org>
This file is part of the SANE package.
-
+
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation; either version 2 of the
License, or (at your option) any later version.
-
+
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
-
+
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place - Suite 330, Boston,
MA 02111-1307, USA.
-
+
As a special exception, the authors of SANE give permission for
additional uses of the libraries contained in this release of SANE.
-
+
The exception is that, if you link a SANE library with other files
to produce an executable, this does not by itself cause the
resulting executable to be covered by the GNU General Public
License. Your use of that executable is in no way restricted on
account of linking the SANE library code into it.
-
+
This exception does not, however, invalidate any other reasons why
the executable file might be covered by the GNU General Public
License.
-
+
If you submit changes to SANE to the maintainers to be included in
a subsequent release, you agree by submitting the changes that
those changes may be distributed with this exception intact.
If you write modifications of your own for SANE, it is your choice
whether to permit this exception to apply to your modifications.
- If you do not wish that, delete this exception notice.
+ If you do not wish that, delete this exception notice.
*/
/*
* Conversion filters for genesys backend
*/
-static SANE_Status
+static SANE_Status
FUNC_NAME(genesys_reorder_components_cis) (
- uint8_t *src_data,
- uint8_t *dst_data,
- unsigned int lines,
- unsigned int pixels)
+ uint8_t *src_data,
+ uint8_t *dst_data,
+ unsigned int lines,
+ unsigned int pixels)
{
unsigned int x, y;
uint8_t *src[3];
@@ -97,12 +97,12 @@ FUNC_NAME(genesys_reorder_components_cis) (
return SANE_STATUS_GOOD;
}
-static SANE_Status
+static SANE_Status
FUNC_NAME(genesys_reorder_components_cis_bgr) (
- uint8_t *src_data,
- uint8_t *dst_data,
- unsigned int lines,
- unsigned int pixels)
+ uint8_t *src_data,
+ uint8_t *dst_data,
+ unsigned int lines,
+ unsigned int pixels)
{
unsigned int x, y;
uint8_t *src[3];
@@ -148,12 +148,12 @@ FUNC_NAME(genesys_reorder_components_cis_bgr) (
return SANE_STATUS_GOOD;
}
-static SANE_Status
+static SANE_Status
FUNC_NAME(genesys_reorder_components_bgr) (
- uint8_t *src_data,
- uint8_t *dst_data,
- unsigned int lines,
- unsigned int pixels)
+ uint8_t *src_data,
+ uint8_t *dst_data,
+ unsigned int lines,
+ unsigned int pixels)
{
unsigned int c;
uint8_t *src = src_data;
@@ -190,13 +190,13 @@ FUNC_NAME(genesys_reorder_components_bgr) (
}
#if defined(DOUBLE_BYTE) && defined(WORDS_BIGENDIAN)
-static SANE_Status
+static SANE_Status
FUNC_NAME(genesys_reorder_components_endian) (
- uint8_t *src_data,
- uint8_t *dst_data,
- unsigned int lines,
+ uint8_t *src_data,
+ uint8_t *dst_data,
+ unsigned int lines,
unsigned int pixels,
- unsigned int channels)
+ unsigned int channels)
{
unsigned int c;
uint8_t *src = src_data;
@@ -212,14 +212,14 @@ return SANE_STATUS_GOOD;
#endif /*defined(DOUBLE_BYTE) && defined(WORDS_BIGENDIAN)*/
-static SANE_Status
+static SANE_Status
FUNC_NAME(genesys_reverse_ccd) (
- uint8_t *src_data,
- uint8_t *dst_data,
- unsigned int lines,
+ uint8_t *src_data,
+ uint8_t *dst_data,
+ unsigned int lines,
unsigned int components_per_line,
unsigned int *ccd_shift,
- unsigned int component_count)
+ unsigned int component_count)
{
unsigned int x, y, c;
COMPONENT_TYPE *src = (COMPONENT_TYPE *)src_data;
@@ -229,8 +229,8 @@ FUNC_NAME(genesys_reverse_ccd) (
unsigned int pitch = components_per_line;
unsigned int ccd_shift_pitch[12];
unsigned int *csp;
-
- for (c = 0; c < component_count; c++)
+
+ for (c = 0; c < component_count; c++)
ccd_shift_pitch[c] = ccd_shift[c] * pitch;
/*
@@ -239,7 +239,7 @@ FUNC_NAME(genesys_reverse_ccd) (
into the cpu cache for maximum efficiency. our lines take
maximum 252kb(3 channels, 16bit, 2400dpi, full gl841 shading range)
* instruction efficiency:
- the innermost loop runs long and consists of 3 adds, one compare,
+ the innermost loop runs long and consists of 3 adds, one compare,
2 derefences.
*/
/*
@@ -258,7 +258,7 @@ FUNC_NAME(genesys_reverse_ccd) (
src += pitch;
}
*/
-/*
+/*
* cache efficency:
here only line_dist_pitch needs to stay in cache. 12*4 = 48 bytes
* instruction efficiency:
@@ -281,14 +281,14 @@ FUNC_NAME(genesys_reverse_ccd) (
return SANE_STATUS_GOOD;
}
-static SANE_Status
+static SANE_Status
FUNC_NAME(genesys_shrink_lines) (
- uint8_t *src_data,
- uint8_t *dst_data,
- unsigned int lines,
+ uint8_t *src_data,
+ uint8_t *dst_data,
+ unsigned int lines,
unsigned int src_pixels,
- unsigned int dst_pixels,
- unsigned int channels)
+ unsigned int dst_pixels,
+ unsigned int channels)
{
unsigned int dst_x, src_x, y, c, cnt;
unsigned int avg[3];
@@ -329,11 +329,11 @@ FUNC_NAME(genesys_shrink_lines) (
for (src_x = 0; src_x < src_pixels; src_x++) {
for (c = 0; c < channels; c++)
avg[c] = *src++;
- while ((cnt < dst_pixels || src_x + 1 == src_pixels) &&
+ while ((cnt < dst_pixels || src_x + 1 == src_pixels) &&
dst_x < dst_pixels) {
cnt += src_pixels;
- for (c = 0; c < channels; c++)
+ for (c = 0; c < channels; c++)
*dst++ = avg[c];
dst_x++;
}