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
f26402ca
Commit
f26402ca
authored
Aug 14, 2012
by
Vincent Povirk
Committed by
Alexandre Julliard
Aug 16, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Implement IWICBitmap::GetPixelFormat.
parent
54a31341
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
9 deletions
+18
-9
bitmap.c
dlls/windowscodecs/bitmap.c
+13
-4
bitmap.c
dlls/windowscodecs/tests/bitmap.c
+5
-5
No files found.
dlls/windowscodecs/bitmap.c
View file @
f26402ca
...
...
@@ -43,6 +43,7 @@ typedef struct BitmapImpl {
UINT
width
,
height
;
UINT
stride
;
UINT
bpp
;
WICPixelFormatGUID
pixelformat
;
}
BitmapImpl
;
typedef
struct
BitmapLockImpl
{
...
...
@@ -195,9 +196,10 @@ static HRESULT WINAPI BitmapLockImpl_GetDataPointer(IWICBitmapLock *iface,
static
HRESULT
WINAPI
BitmapLockImpl_GetPixelFormat
(
IWICBitmapLock
*
iface
,
WICPixelFormatGUID
*
pPixelFormat
)
{
FIXME
(
"(%p,%p)
\n
"
,
iface
,
pPixelFormat
);
BitmapLockImpl
*
This
=
impl_from_IWICBitmapLock
(
iface
);
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pPixelFormat
);
return
E_NOTIMPL
;
return
IWICBitmap_GetPixelFormat
(
&
This
->
parent
->
IWICBitmap_iface
,
pPixelFormat
)
;
}
static
const
IWICBitmapLockVtbl
BitmapLockImpl_Vtbl
=
{
...
...
@@ -272,9 +274,15 @@ static HRESULT WINAPI BitmapImpl_GetSize(IWICBitmap *iface,
static
HRESULT
WINAPI
BitmapImpl_GetPixelFormat
(
IWICBitmap
*
iface
,
WICPixelFormatGUID
*
pPixelFormat
)
{
FIXME
(
"(%p,%p)
\n
"
,
iface
,
pPixelFormat
);
BitmapImpl
*
This
=
impl_from_IWICBitmap
(
iface
);
TRACE
(
"(%p,%p)
\n
"
,
iface
,
pPixelFormat
);
return
E_NOTIMPL
;
if
(
!
pPixelFormat
)
return
E_INVALIDARG
;
memcpy
(
pPixelFormat
,
&
This
->
pixelformat
,
sizeof
(
GUID
));
return
S_OK
;
}
static
HRESULT
WINAPI
BitmapImpl_GetResolution
(
IWICBitmap
*
iface
,
...
...
@@ -446,6 +454,7 @@ HRESULT BitmapImpl_Create(UINT uiWidth, UINT uiHeight,
This
->
height
=
uiHeight
;
This
->
stride
=
stride
;
This
->
bpp
=
bpp
;
memcpy
(
&
This
->
pixelformat
,
pixelFormat
,
sizeof
(
GUID
));
*
ppIBitmap
=
&
This
->
IWICBitmap_iface
;
...
...
dlls/windowscodecs/tests/bitmap.c
View file @
f26402ca
...
...
@@ -152,8 +152,8 @@ static void test_createbitmap(void)
base_lock_buffer
=
lock_buffer
;
hr
=
IWICBitmapLock_GetPixelFormat
(
lock
,
&
pixelformat
);
todo_wine
ok
(
hr
==
S_OK
,
"IWICBitmapLock_GetPixelFormat failed hr=%x
\n
"
,
hr
);
todo_wine
ok
(
IsEqualGUID
(
&
pixelformat
,
&
GUID_WICPixelFormat24bppBGR
),
"unexpected pixel format
\n
"
);
ok
(
hr
==
S_OK
,
"IWICBitmapLock_GetPixelFormat failed hr=%x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
pixelformat
,
&
GUID_WICPixelFormat24bppBGR
),
"unexpected pixel format
\n
"
);
hr
=
IWICBitmapLock_GetSize
(
lock
,
&
width
,
&
height
);
ok
(
hr
==
S_OK
,
"IWICBitmapLock_GetSize failed hr=%x
\n
"
,
hr
);
...
...
@@ -228,8 +228,8 @@ static void test_createbitmap(void)
ok
(
lock_buffer
==
base_lock_buffer
+
6
,
"got %p, expected %p+6
\n
"
,
lock_buffer
,
base_lock_buffer
);
hr
=
IWICBitmapLock_GetPixelFormat
(
lock
,
&
pixelformat
);
todo_wine
ok
(
hr
==
S_OK
,
"IWICBitmapLock_GetPixelFormat failed hr=%x
\n
"
,
hr
);
todo_wine
ok
(
IsEqualGUID
(
&
pixelformat
,
&
GUID_WICPixelFormat24bppBGR
),
"unexpected pixel format
\n
"
);
ok
(
hr
==
S_OK
,
"IWICBitmapLock_GetPixelFormat failed hr=%x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
pixelformat
,
&
GUID_WICPixelFormat24bppBGR
),
"unexpected pixel format
\n
"
);
hr
=
IWICBitmapLock_GetSize
(
lock
,
&
width
,
&
height
);
ok
(
hr
==
S_OK
,
"IWICBitmapLock_GetSize failed hr=%x
\n
"
,
hr
);
...
...
@@ -239,11 +239,11 @@ static void test_createbitmap(void)
IWICBitmapLock_Release
(
lock
);
}
todo_wine
{
hr
=
IWICBitmap_GetPixelFormat
(
bitmap
,
&
pixelformat
);
ok
(
hr
==
S_OK
,
"IWICBitmap_GetPixelFormat failed hr=%x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
pixelformat
,
&
GUID_WICPixelFormat24bppBGR
),
"unexpected pixel format
\n
"
);
todo_wine
{
hr
=
IWICBitmap_GetResolution
(
bitmap
,
&
dpix
,
&
dpiy
);
ok
(
hr
==
S_OK
,
"IWICBitmap_GetResolution failed hr=%x
\n
"
,
hr
);
ok
(
dpix
==
0
.
0
,
"got %f, expected 0.0
\n
"
,
dpix
);
...
...
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