Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-cw
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
wine
wine-cw
Commits
b830a46d
Commit
b830a46d
authored
Aug 06, 2023
by
Ilia Docin
Committed by
Alexandre Julliard
Aug 16, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sane.ds: Set monochrome DIB color table.
parent
76f622a6
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
ds_image.c
dlls/sane.ds/ds_image.c
+11
-6
No files found.
dlls/sane.ds/ds_image.c
View file @
b830a46d
...
...
@@ -335,10 +335,8 @@ TW_UINT16 SANE_ImageNativeXferGet (pTW_IDENTITY pOrigin,
switch
(
activeDS
.
frame_params
.
format
)
{
case
FMT_GRAY
:
if
(
activeDS
.
frame_params
.
depth
==
8
)
color_size
=
(
1
<<
8
)
*
sizeof
(
*
colors
);
else
if
(
activeDS
.
frame_params
.
depth
==
1
)
;
if
(
activeDS
.
frame_params
.
depth
==
8
||
activeDS
.
frame_params
.
depth
==
1
)
color_size
=
(
1
<<
activeDS
.
frame_params
.
depth
)
*
sizeof
(
*
colors
);
else
{
FIXME
(
"For NATIVE, we support only 1 bit monochrome and 8 bit Grayscale, not %d
\n
"
,
activeDS
.
frame_params
.
depth
);
...
...
@@ -405,8 +403,15 @@ TW_UINT16 SANE_ImageNativeXferGet (pTW_IDENTITY pOrigin,
{
colors
=
(
RGBQUAD
*
)
p
;
p
+=
color_size
;
for
(
i
=
0
;
i
<
(
color_size
/
sizeof
(
*
colors
));
i
++
)
colors
[
i
].
rgbBlue
=
colors
[
i
].
rgbRed
=
colors
[
i
].
rgbGreen
=
i
;
if
(
activeDS
.
frame_params
.
depth
==
1
)
{
/* Sane uses 1 to represent minimum intensity (black) and 0 for maximum (white) */
colors
[
0
].
rgbBlue
=
colors
[
0
].
rgbRed
=
colors
[
0
].
rgbGreen
=
255
;
colors
[
1
].
rgbBlue
=
colors
[
1
].
rgbRed
=
colors
[
1
].
rgbGreen
=
0
;
}
else
for
(
i
=
0
;
i
<
(
color_size
/
sizeof
(
*
colors
));
i
++
)
colors
[
i
].
rgbBlue
=
colors
[
i
].
rgbRed
=
colors
[
i
].
rgbGreen
=
i
;
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment