From 6c8052f54d99fa032c9b425f2ce030cecf859349 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?St=C3=A9phane=20Voltz?= Date: Thu, 15 Oct 2009 06:17:26 +0200 Subject: [PATCH] duplicate shading data on all channels for gray scans --- backend/genesys.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/backend/genesys.c b/backend/genesys.c index 0d5443d94..5206e7077 100644 --- a/backend/genesys.c +++ b/backend/genesys.c @@ -2931,6 +2931,17 @@ compute_planar_coefficients (Genesys_Device * dev, } } } + /* in case of gray level scan, we duplicate shading information on all + * three color channels */ + if(channels==1) + { + memcpy(shading_data+cmat[1]*2*words_per_color, + shading_data+cmat[0]*2*words_per_color, + words_per_color*2); + memcpy(shading_data+cmat[2]*2*words_per_color, + shading_data+cmat[0]*2*words_per_color, + words_per_color*2); + } } static SANE_Status