From 2958f7a84490ab6c263c6482ac61ec0dc3faf78d Mon Sep 17 00:00:00 2001 From: Henning Geinitz Date: Mon, 30 Sep 2002 13:54:02 +0000 Subject: [PATCH] Fixed bytes_per_line in 1 bit mode. Fixed 1 bit color three-pass mode (grid). Changed bit order for 1 bit color to most significant bit is first pixel. --- backend/test-picture.c | 6 ++++-- backend/test.c | 4 ++-- doc/descriptions/test.desc | 2 +- 3 files changed, 7 insertions(+), 5 deletions(-) diff --git a/backend/test-picture.c b/backend/test-picture.c index ce13edb46..3f79a63bd 100644 --- a/backend/test-picture.c +++ b/backend/test-picture.c @@ -143,7 +143,9 @@ init_picture_buffer (Test_Device * test_device, SANE_Byte ** buffer, if (test_device->params.depth == 1) { - if (test_device->params.format == SANE_FRAME_GRAY) + if (test_device->params.format == SANE_FRAME_GRAY || + (test_device->params.format >= SANE_FRAME_RED && + test_device->params.format <= SANE_FRAME_BLUE)) { SANE_Byte value = 0; for (x1 = 0; x1 < 8; x1++) @@ -170,7 +172,7 @@ init_picture_buffer (Test_Device * test_device, SANE_Byte ** buffer, SANE_Byte value = 0; for (x1 = 0; x1 < 8; x1++) { - SANE_Word xfull = x * 8 / 3 + x1; + SANE_Word xfull = x * 8 / 3 + (7 - x1); if (xfull < ppl) { diff --git a/backend/test.c b/backend/test.c index 11c68c76b..cc8f46ed2 100644 --- a/backend/test.c +++ b/backend/test.c @@ -41,7 +41,7 @@ This backend is for testing frontends. */ -#define BUILD 17 +#define BUILD 18 #include "../include/sane/config.h" @@ -2316,7 +2316,7 @@ sane_get_parameters (SANE_Handle handle, SANE_Parameters * params) channels = 3; if (p->depth == 1) - p->bytes_per_line = channels * (p->pixels_per_line + 7) / 8; + p->bytes_per_line = channels * (int) ((p->pixels_per_line + 7) / 8); else /* depth == 8 || depth == 16 */ p->bytes_per_line = channels * p->pixels_per_line * ((p->depth + 7) / 8); diff --git a/doc/descriptions/test.desc b/doc/descriptions/test.desc index f5e391c1b..62b7b37db 100644 --- a/doc/descriptions/test.desc +++ b/doc/descriptions/test.desc @@ -10,7 +10,7 @@ ; :backend "test" ; name of backend -:version "1.0-17" ; version of backend +:version "1.0-18" ; version of backend :status :stable ; :alpha, :beta, :stable, :new :manpage "sane-test" ; name of manpage (if it exists) :url "http://www.meier-geinitz.de/sane/test-backend/" ; backend's web page