Module: wine Branch: refs/heads/master Commit: 0bcc992162a5ce4a338c9210ef90e6a98dcf3254 URL: http://source.winehq.org/git/?p=wine.git;a=commit;h=0bcc992162a5ce4a338c9210...
Author: Aric Stewart aric@codeweavers.com Date: Wed Mar 22 13:34:44 2006 -0600
twain: A few cleanups, using some consts from sane.
---
dlls/twain/ds_image.c | 13 +++++++++++-- 1 files changed, 11 insertions(+), 2 deletions(-)
diff --git a/dlls/twain/ds_image.c b/dlls/twain/ds_image.c index 07ebad8..dd37cf0 100644 --- a/dlls/twain/ds_image.c +++ b/dlls/twain/ds_image.c @@ -120,7 +120,7 @@ TW_UINT16 TWAIN_ImageInfoGet (pTW_IDENTI TRACE("Bits per Sample %i\n",pSource->sane_param.depth); TRACE("Frame Format %i\n",pSource->sane_param.format);
- if (pSource->sane_param.format == 1 /*RGB*/ ) + if (pSource->sane_param.format == SANE_FRAME_RGB ) { pImageInfo->BitsPerPixel = pSource->sane_param.depth * 3; pImageInfo->Compression = TWCP_NONE; @@ -131,9 +131,18 @@ TW_UINT16 TWAIN_ImageInfoGet (pTW_IDENTI pImageInfo->BitsPerSample[2] = pSource->sane_param.depth; pImageInfo->PixelType = TWPT_RGB; } + else if (pSource->sane_param.format == SANE_FRAME_GRAY) + { + pImageInfo->BitsPerPixel = pSource->sane_param.depth; + pImageInfo->Compression = TWCP_NONE; + pImageInfo->Planar = TRUE; + pImageInfo->SamplesPerPixel = 1; + pImageInfo->BitsPerSample[0] = pSource->sane_param.depth; + pImageInfo->PixelType = TWPT_GRAY; + } else { - ERR("Unhandled source frame type\n"); + ERR("Unhandled source frame type %i\n",pSource->sane_param.format); twRC = TWRC_FAILURE; pSource->twCC = TWCC_SEQERROR; }