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
e5ce32e5
Commit
e5ce32e5
authored
Aug 04, 2011
by
Alexandre Julliard
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
gdi32: Get rid of the DIB_GetBitmapInfo function.
parent
3d0f272a
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
61 deletions
+19
-61
dib.c
dlls/gdi32/dib.c
+19
-59
gdi_private.h
dlls/gdi32/gdi_private.h
+0
-2
No files found.
dlls/gdi32/dib.c
View file @
e5ce32e5
...
...
@@ -28,8 +28,7 @@
Most Windows API functions taking a BITMAPINFO* / BITMAPINFOHEADER* also
accept the old "core" structures, and so must WINE.
You can distinguish them by looking at the first member (bcSize/biSize),
or use the internal function DIB_GetBitmapInfo.
You can distinguish them by looking at the first member (bcSize/biSize).
* The palettes are stored in different formats:
...
...
@@ -98,70 +97,35 @@ int bitmap_info_size( const BITMAPINFO * info, WORD coloruse )
}
}
/***********************************************************************
* DIB_GetBitmapInfo
*
* Get the info from a bitmap header.
* Return 0 for COREHEADER, 1 for INFOHEADER, -1 for error.
*/
int
DIB_GetBitmapInfo
(
const
BITMAPINFOHEADER
*
header
,
LONG
*
width
,
LONG
*
height
,
WORD
*
planes
,
WORD
*
bpp
,
DWORD
*
compr
,
DWORD
*
size
)
{
if
(
!
header
)
return
-
1
;
if
(
header
->
biSize
==
sizeof
(
BITMAPCOREHEADER
))
{
const
BITMAPCOREHEADER
*
core
=
(
const
BITMAPCOREHEADER
*
)
header
;
*
width
=
core
->
bcWidth
;
*
height
=
core
->
bcHeight
;
*
planes
=
core
->
bcPlanes
;
*
bpp
=
core
->
bcBitCount
;
*
compr
=
0
;
*
size
=
0
;
return
0
;
}
if
(
header
->
biSize
>=
sizeof
(
BITMAPINFOHEADER
))
/* assume BITMAPINFOHEADER */
{
*
width
=
header
->
biWidth
;
*
height
=
header
->
biHeight
;
*
planes
=
header
->
biPlanes
;
*
bpp
=
header
->
biBitCount
;
*
compr
=
header
->
biCompression
;
*
size
=
header
->
biSizeImage
;
return
1
;
}
ERR
(
"(%d): unknown/wrong size for header
\n
"
,
header
->
biSize
);
return
-
1
;
}
/*******************************************************************************************
* Fill out a true BITMAPINFOHEADER from a variable sized BITMAPINFOHEADER / BITMAPCOREHEADER.
*/
static
BOOL
bitmapinfoheader_from_user_bitmapinfo
(
BITMAPINFOHEADER
*
dst
,
const
BITMAPINFOHEADER
*
info
)
{
LONG
width
,
height
;
WORD
planes
,
bpp
;
DWORD
compr
,
size
;
int
bitmap_type
=
DIB_GetBitmapInfo
(
info
,
&
width
,
&
height
,
&
planes
,
&
bpp
,
&
compr
,
&
size
);
if
(
bitmap_type
==
-
1
)
return
FALSE
;
if
(
!
info
)
return
FALSE
;
if
(
bitmap_type
==
1
)
if
(
info
->
biSize
==
sizeof
(
BITMAPCOREHEADER
)
)
{
*
dst
=
*
info
;
}
else
{
dst
->
biWidth
=
width
;
dst
->
biHeight
=
height
;
dst
->
biPlanes
=
planes
;
dst
->
biBitCount
=
bpp
;
dst
->
biCompression
=
compr
;
const
BITMAPCOREHEADER
*
core
=
(
const
BITMAPCOREHEADER
*
)
info
;
dst
->
biWidth
=
core
->
bcWidth
;
dst
->
biHeight
=
core
->
bcHeight
;
dst
->
biPlanes
=
core
->
bcPlanes
;
dst
->
biBitCount
=
core
->
bcBitCount
;
dst
->
biCompression
=
BI_RGB
;
dst
->
biXPelsPerMeter
=
0
;
dst
->
biYPelsPerMeter
=
0
;
dst
->
biClrUsed
=
0
;
dst
->
biClrImportant
=
0
;
}
else
if
(
info
->
biSize
>=
sizeof
(
BITMAPINFOHEADER
))
/* assume BITMAPINFOHEADER */
{
*
dst
=
*
info
;
}
else
{
WARN
(
"(%u): unknown/wrong size for header
\n
"
,
info
->
biSize
);
return
FALSE
;
}
dst
->
biSize
=
sizeof
(
*
dst
);
if
(
dst
->
biCompression
==
BI_RGB
||
dst
->
biCompression
==
BI_BITFIELDS
)
...
...
@@ -928,11 +892,7 @@ INT WINAPI GetDIBits(
/* Since info may be a BITMAPCOREINFO or any of the larger BITMAPINFO structures, we'll use our
own copy and transfer the colour info back at the end */
if
(
!
bitmapinfoheader_from_user_bitmapinfo
(
&
dst_info
->
bmiHeader
,
&
info
->
bmiHeader
))
{
ERR
(
"Invalid bitmap format
\n
"
);
return
0
;
}
if
(
!
bitmapinfoheader_from_user_bitmapinfo
(
&
dst_info
->
bmiHeader
,
&
info
->
bmiHeader
))
return
0
;
dst_info
->
bmiHeader
.
biClrUsed
=
0
;
dst_info
->
bmiHeader
.
biClrImportant
=
0
;
...
...
dlls/gdi32/gdi_private.h
View file @
e5ce32e5
...
...
@@ -338,8 +338,6 @@ extern void DC_UpdateXforms( DC * dc ) DECLSPEC_HIDDEN;
/* dib.c */
extern
int
bitmap_info_size
(
const
BITMAPINFO
*
info
,
WORD
coloruse
)
DECLSPEC_HIDDEN
;
extern
int
DIB_GetBitmapInfo
(
const
BITMAPINFOHEADER
*
header
,
LONG
*
width
,
LONG
*
height
,
WORD
*
planes
,
WORD
*
bpp
,
DWORD
*
compr
,
DWORD
*
size
)
DECLSPEC_HIDDEN
;
extern
DWORD
convert_bitmapinfo
(
const
BITMAPINFO
*
src_info
,
void
*
src_bits
,
struct
bitblt_coords
*
src
,
const
BITMAPINFO
*
dst_info
,
void
*
dst_bits
)
DECLSPEC_HIDDEN
;
...
...
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