Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
W
wine-winehq
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-winehq
Commits
b8c38f41
Commit
b8c38f41
authored
Aug 06, 2023
by
Ilia Docin
Committed by
Alexandre Julliard
Aug 14, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sane.ds: Use BGR order to store 24 bit color DIB pixels.
parent
5daa21f9
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
2 deletions
+14
-2
ds_image.c
dlls/sane.ds/ds_image.c
+14
-2
No files found.
dlls/sane.ds/ds_image.c
View file @
b8c38f41
...
...
@@ -301,10 +301,11 @@ TW_UINT16 SANE_ImageNativeXferGet (pTW_IDENTITY pOrigin,
BITMAPINFOHEADER
*
header
=
NULL
;
int
dib_bytes
;
int
dib_bytes_per_line
;
BYTE
*
line
;
BYTE
*
line
,
color_buffer
;
RGBQUAD
*
colors
;
RGBTRIPLE
*
pixels
;
int
color_size
=
0
;
int
i
;
int
i
,
j
;
BYTE
*
p
;
TRACE
(
"DG_IMAGE/DAT_IMAGENATIVEXFER/MSG_GET
\n
"
);
...
...
@@ -425,6 +426,17 @@ TW_UINT16 SANE_ImageNativeXferGet (pTW_IDENTITY pOrigin,
twRC
=
SANE_CALL
(
read_data
,
&
params
);
if
(
twRC
!=
TWCC_SUCCESS
)
break
;
if
(
retlen
<
activeDS
.
frame_params
.
bytes_per_line
)
break
;
/* TWAIN: for 24 bit color DIBs, the pixels are stored in BGR order */
if
(
activeDS
.
frame_params
.
format
==
FMT_RGB
&&
activeDS
.
frame_params
.
depth
==
8
)
{
pixels
=
(
RGBTRIPLE
*
)
line
;
for
(
j
=
0
;
j
<
activeDS
.
frame_params
.
pixels_per_line
;
++
j
)
{
color_buffer
=
pixels
[
j
].
rgbtRed
;
pixels
[
j
].
rgbtRed
=
pixels
[
j
].
rgbtBlue
;
pixels
[
j
].
rgbtBlue
=
color_buffer
;
}
}
line
-=
dib_bytes_per_line
;
}
activeDS
.
progressWnd
=
ScanningDialogBox
(
activeDS
.
progressWnd
,
-
1
);
...
...
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