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
5590294c
Commit
5590294c
authored
Aug 06, 2023
by
Ilia Docin
Committed by
Alexandre Julliard
Aug 08, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
sane.ds: Do the reverse conversion of frame edges before setting.
Sane backends must attach a unit of either pixels or millimeters to scan area options.
parent
ed29473e
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
10 additions
and
4 deletions
+10
-4
ds_image.c
dlls/sane.ds/ds_image.c
+4
-4
options.c
dlls/sane.ds/options.c
+5
-0
sane_i.h
dlls/sane.ds/sane_i.h
+1
-0
No files found.
dlls/sane.ds/ds_image.c
View file @
5590294c
...
...
@@ -164,10 +164,10 @@ TW_UINT16 SANE_ImageLayoutSet (pTW_IDENTITY pOrigin,
img
->
Frame
.
Right
.
Whole
,
img
->
Frame
.
Right
.
Frac
,
img
->
Frame
.
Bottom
.
Whole
,
img
->
Frame
.
Bottom
.
Frac
);
tlx
=
img
->
Frame
.
Left
.
Whole
*
65536
+
img
->
Frame
.
Left
.
Frac
;
tly
=
img
->
Frame
.
Top
.
Whole
*
65536
+
img
->
Frame
.
Top
.
Frac
;
brx
=
img
->
Frame
.
Right
.
Whole
*
65536
+
img
->
Frame
.
Right
.
Frac
;
bry
=
img
->
Frame
.
Bottom
.
Whole
*
65536
+
img
->
Frame
.
Bottom
.
Frac
;
tlx
=
convert_twain_res_to_sane
(
img
->
Frame
.
Left
)
;
tly
=
convert_twain_res_to_sane
(
img
->
Frame
.
Top
)
;
brx
=
convert_twain_res_to_sane
(
img
->
Frame
.
Right
)
;
bry
=
convert_twain_res_to_sane
(
img
->
Frame
.
Bottom
)
;
twrc
=
sane_option_set_scan_area
(
tlx
,
tly
,
brx
,
bry
,
&
changed
);
if
(
twrc
!=
TWRC_SUCCESS
)
...
...
dlls/sane.ds/options.c
View file @
5590294c
...
...
@@ -200,6 +200,11 @@ TW_FIX32 convert_sane_res_to_twain(int res)
return
value
;
}
int
convert_twain_res_to_sane
(
TW_FIX32
res
)
{
return
MulDiv
(
res
.
Whole
*
65536
+
res
.
Frac
,
254
,
10
);
/* inch -> mm */
}
TW_UINT16
get_sane_params
(
struct
frame_parameters
*
params
)
{
return
SANE_CALL
(
get_params
,
params
);
...
...
dlls/sane.ds/sane_i.h
View file @
5590294c
...
...
@@ -208,6 +208,7 @@ TW_UINT16 sane_option_get_scan_area( int *tlx, int *tly, int *brx, int *bry ) DE
TW_UINT16
sane_option_get_max_scan_area
(
int
*
tlx
,
int
*
tly
,
int
*
brx
,
int
*
bry
)
DECLSPEC_HIDDEN
;
TW_UINT16
sane_option_set_scan_area
(
int
tlx
,
int
tly
,
int
brx
,
int
bry
,
BOOL
*
reload
)
DECLSPEC_HIDDEN
;
TW_FIX32
convert_sane_res_to_twain
(
int
res
)
DECLSPEC_HIDDEN
;
int
convert_twain_res_to_sane
(
TW_FIX32
res
)
DECLSPEC_HIDDEN
;
TW_UINT16
get_sane_params
(
struct
frame_parameters
*
params
)
DECLSPEC_HIDDEN
;
#endif
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