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
3e88d4ff
Commit
3e88d4ff
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::SetResolution and GetResolution.
parent
a62bd245
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
26 additions
and
6 deletions
+26
-6
bitmap.c
dlls/windowscodecs/bitmap.c
+26
-4
bitmap.c
dlls/windowscodecs/tests/bitmap.c
+0
-2
No files found.
dlls/windowscodecs/bitmap.c
View file @
3e88d4ff
...
@@ -44,6 +44,8 @@ typedef struct BitmapImpl {
...
@@ -44,6 +44,8 @@ typedef struct BitmapImpl {
UINT
stride
;
UINT
stride
;
UINT
bpp
;
UINT
bpp
;
WICPixelFormatGUID
pixelformat
;
WICPixelFormatGUID
pixelformat
;
double
dpix
,
dpiy
;
CRITICAL_SECTION
cs
;
}
BitmapImpl
;
}
BitmapImpl
;
typedef
struct
BitmapLockImpl
{
typedef
struct
BitmapLockImpl
{
...
@@ -256,6 +258,8 @@ static ULONG WINAPI BitmapImpl_Release(IWICBitmap *iface)
...
@@ -256,6 +258,8 @@ static ULONG WINAPI BitmapImpl_Release(IWICBitmap *iface)
if
(
ref
==
0
)
if
(
ref
==
0
)
{
{
if
(
This
->
palette
)
IWICPalette_Release
(
This
->
palette
);
if
(
This
->
palette
)
IWICPalette_Release
(
This
->
palette
);
This
->
cs
.
DebugInfo
->
Spare
[
0
]
=
0
;
DeleteCriticalSection
(
&
This
->
cs
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
data
);
HeapFree
(
GetProcessHeap
(),
0
,
This
->
data
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
HeapFree
(
GetProcessHeap
(),
0
,
This
);
}
}
...
@@ -295,9 +299,18 @@ static HRESULT WINAPI BitmapImpl_GetPixelFormat(IWICBitmap *iface,
...
@@ -295,9 +299,18 @@ static HRESULT WINAPI BitmapImpl_GetPixelFormat(IWICBitmap *iface,
static
HRESULT
WINAPI
BitmapImpl_GetResolution
(
IWICBitmap
*
iface
,
static
HRESULT
WINAPI
BitmapImpl_GetResolution
(
IWICBitmap
*
iface
,
double
*
pDpiX
,
double
*
pDpiY
)
double
*
pDpiX
,
double
*
pDpiY
)
{
{
FIXME
(
"(%p,%p,%p)
\n
"
,
iface
,
pDpiX
,
pDpiY
);
BitmapImpl
*
This
=
impl_from_IWICBitmap
(
iface
);
TRACE
(
"(%p,%p,%p)
\n
"
,
iface
,
pDpiX
,
pDpiY
);
if
(
!
pDpiX
||
!
pDpiY
)
return
E_INVALIDARG
;
EnterCriticalSection
(
&
This
->
cs
);
*
pDpiX
=
This
->
dpix
;
*
pDpiY
=
This
->
dpiy
;
LeaveCriticalSection
(
&
This
->
cs
);
return
E_NOTIMPL
;
return
S_OK
;
}
}
static
HRESULT
WINAPI
BitmapImpl_CopyPalette
(
IWICBitmap
*
iface
,
static
HRESULT
WINAPI
BitmapImpl_CopyPalette
(
IWICBitmap
*
iface
,
...
@@ -408,9 +421,15 @@ static HRESULT WINAPI BitmapImpl_SetPalette(IWICBitmap *iface, IWICPalette *pIPa
...
@@ -408,9 +421,15 @@ static HRESULT WINAPI BitmapImpl_SetPalette(IWICBitmap *iface, IWICPalette *pIPa
static
HRESULT
WINAPI
BitmapImpl_SetResolution
(
IWICBitmap
*
iface
,
static
HRESULT
WINAPI
BitmapImpl_SetResolution
(
IWICBitmap
*
iface
,
double
dpiX
,
double
dpiY
)
double
dpiX
,
double
dpiY
)
{
{
FIXME
(
"(%p,%f,%f)
\n
"
,
iface
,
dpiX
,
dpiY
);
BitmapImpl
*
This
=
impl_from_IWICBitmap
(
iface
);
TRACE
(
"(%p,%f,%f)
\n
"
,
iface
,
dpiX
,
dpiY
);
return
E_NOTIMPL
;
EnterCriticalSection
(
&
This
->
cs
);
This
->
dpix
=
dpiX
;
This
->
dpiy
=
dpiY
;
LeaveCriticalSection
(
&
This
->
cs
);
return
S_OK
;
}
}
static
const
IWICBitmapVtbl
BitmapImpl_Vtbl
=
{
static
const
IWICBitmapVtbl
BitmapImpl_Vtbl
=
{
...
@@ -462,6 +481,9 @@ HRESULT BitmapImpl_Create(UINT uiWidth, UINT uiHeight,
...
@@ -462,6 +481,9 @@ HRESULT BitmapImpl_Create(UINT uiWidth, UINT uiHeight,
This
->
stride
=
stride
;
This
->
stride
=
stride
;
This
->
bpp
=
bpp
;
This
->
bpp
=
bpp
;
memcpy
(
&
This
->
pixelformat
,
pixelFormat
,
sizeof
(
GUID
));
memcpy
(
&
This
->
pixelformat
,
pixelFormat
,
sizeof
(
GUID
));
This
->
dpix
=
This
->
dpiy
=
0
.
0
;
InitializeCriticalSection
(
&
This
->
cs
);
This
->
cs
.
DebugInfo
->
Spare
[
0
]
=
(
DWORD_PTR
)(
__FILE__
": BitmapImpl.lock"
);
*
ppIBitmap
=
&
This
->
IWICBitmap_iface
;
*
ppIBitmap
=
&
This
->
IWICBitmap_iface
;
...
...
dlls/windowscodecs/tests/bitmap.c
View file @
3e88d4ff
...
@@ -243,7 +243,6 @@ static void test_createbitmap(void)
...
@@ -243,7 +243,6 @@ static void test_createbitmap(void)
ok
(
hr
==
S_OK
,
"IWICBitmap_GetPixelFormat failed hr=%x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"IWICBitmap_GetPixelFormat failed hr=%x
\n
"
,
hr
);
ok
(
IsEqualGUID
(
&
pixelformat
,
&
GUID_WICPixelFormat24bppBGR
),
"unexpected pixel format
\n
"
);
ok
(
IsEqualGUID
(
&
pixelformat
,
&
GUID_WICPixelFormat24bppBGR
),
"unexpected pixel format
\n
"
);
todo_wine
{
hr
=
IWICBitmap_GetResolution
(
bitmap
,
&
dpix
,
&
dpiy
);
hr
=
IWICBitmap_GetResolution
(
bitmap
,
&
dpix
,
&
dpiy
);
ok
(
hr
==
S_OK
,
"IWICBitmap_GetResolution failed hr=%x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"IWICBitmap_GetResolution failed hr=%x
\n
"
,
hr
);
ok
(
dpix
==
0
.
0
,
"got %f, expected 0.0
\n
"
,
dpix
);
ok
(
dpix
==
0
.
0
,
"got %f, expected 0.0
\n
"
,
dpix
);
...
@@ -256,7 +255,6 @@ todo_wine {
...
@@ -256,7 +255,6 @@ todo_wine {
ok
(
hr
==
S_OK
,
"IWICBitmap_GetResolution failed hr=%x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"IWICBitmap_GetResolution failed hr=%x
\n
"
,
hr
);
ok
(
dpix
==
12
.
0
,
"got %f, expected 12.0
\n
"
,
dpix
);
ok
(
dpix
==
12
.
0
,
"got %f, expected 12.0
\n
"
,
dpix
);
ok
(
dpiy
==
34
.
0
,
"got %f, expected 34.0
\n
"
,
dpiy
);
ok
(
dpiy
==
34
.
0
,
"got %f, expected 34.0
\n
"
,
dpiy
);
}
hr
=
IWICBitmap_GetSize
(
bitmap
,
&
width
,
&
height
);
hr
=
IWICBitmap_GetSize
(
bitmap
,
&
width
,
&
height
);
ok
(
hr
==
S_OK
,
"IWICBitmap_GetSize failed hr=%x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"IWICBitmap_GetSize failed hr=%x
\n
"
,
hr
);
...
...
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