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
88eed3c0
Commit
88eed3c0
authored
Aug 14, 2012
by
Vincent Povirk
Committed by
Alexandre Julliard
Aug 20, 2012
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Implement IWICImagingFactory::CreateBitmapFromSource.
parent
32bfd810
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
80 additions
and
4 deletions
+80
-4
imgfactory.c
dlls/windowscodecs/imgfactory.c
+77
-2
bitmap.c
dlls/windowscodecs/tests/bitmap.c
+3
-2
No files found.
dlls/windowscodecs/imgfactory.c
View file @
88eed3c0
...
...
@@ -466,8 +466,83 @@ static HRESULT WINAPI ComponentFactory_CreateBitmapFromSource(IWICComponentFacto
IWICBitmapSource
*
piBitmapSource
,
WICBitmapCreateCacheOption
option
,
IWICBitmap
**
ppIBitmap
)
{
FIXME
(
"(%p,%p,%u,%p): stub
\n
"
,
iface
,
piBitmapSource
,
option
,
ppIBitmap
);
return
E_NOTIMPL
;
IWICBitmap
*
result
;
IWICBitmapLock
*
lock
;
IWICPalette
*
palette
;
UINT
width
,
height
;
WICPixelFormatGUID
pixelformat
=
{
0
};
HRESULT
hr
;
WICRect
rc
;
double
dpix
,
dpiy
;
TRACE
(
"(%p,%p,%u,%p)
\n
"
,
iface
,
piBitmapSource
,
option
,
ppIBitmap
);
if
(
!
piBitmapSource
||
!
ppIBitmap
)
return
E_INVALIDARG
;
hr
=
IWICBitmapSource_GetSize
(
piBitmapSource
,
&
width
,
&
height
);
if
(
SUCCEEDED
(
hr
))
hr
=
IWICBitmapSource_GetPixelFormat
(
piBitmapSource
,
&
pixelformat
);
if
(
SUCCEEDED
(
hr
))
hr
=
BitmapImpl_Create
(
width
,
height
,
&
pixelformat
,
option
,
&
result
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICBitmap_Lock
(
result
,
NULL
,
WICBitmapLockWrite
,
&
lock
);
if
(
SUCCEEDED
(
hr
))
{
UINT
stride
,
buffersize
;
BYTE
*
buffer
;
rc
.
X
=
rc
.
Y
=
0
;
rc
.
Width
=
width
;
rc
.
Height
=
height
;
hr
=
IWICBitmapLock_GetStride
(
lock
,
&
stride
);
if
(
SUCCEEDED
(
hr
))
hr
=
IWICBitmapLock_GetDataPointer
(
lock
,
&
buffersize
,
&
buffer
);
if
(
SUCCEEDED
(
hr
))
hr
=
IWICBitmapSource_CopyPixels
(
piBitmapSource
,
&
rc
,
stride
,
buffersize
,
buffer
);
IWICBitmapLock_Release
(
lock
);
}
if
(
SUCCEEDED
(
hr
))
hr
=
PaletteImpl_Create
(
&
palette
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICBitmapSource_CopyPalette
(
piBitmapSource
,
palette
);
if
(
SUCCEEDED
(
hr
))
hr
=
IWICBitmap_SetPalette
(
result
,
palette
);
else
hr
=
S_OK
;
IWICPalette_Release
(
palette
);
}
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICBitmapSource_GetResolution
(
piBitmapSource
,
&
dpix
,
&
dpiy
);
if
(
SUCCEEDED
(
hr
))
hr
=
IWICBitmap_SetResolution
(
result
,
dpix
,
dpiy
);
else
hr
=
S_OK
;
}
if
(
SUCCEEDED
(
hr
))
*
ppIBitmap
=
result
;
else
IWICBitmap_Release
(
result
);
}
return
hr
;
}
static
HRESULT
WINAPI
ComponentFactory_CreateBitmapFromSourceRect
(
IWICComponentFactory
*
iface
,
...
...
dlls/windowscodecs/tests/bitmap.c
View file @
88eed3c0
...
...
@@ -329,7 +329,7 @@ static void test_createbitmapfromsource(void)
hr
=
IWICImagingFactory_CreateBitmapFromSource
(
factory
,
(
IWICBitmapSource
*
)
bitmap
,
WICBitmapCacheOnLoad
,
&
bitmap2
);
todo_wine
ok
(
hr
==
S_OK
,
"IWICImagingFactory_CreateBitmapFromSource failed hr=%x
\n
"
,
hr
);
ok
(
hr
==
S_OK
,
"IWICImagingFactory_CreateBitmapFromSource failed hr=%x
\n
"
,
hr
);
IWICBitmap_Release
(
bitmap
);
...
...
@@ -338,8 +338,9 @@ static void test_createbitmapfromsource(void)
hr
=
IWICImagingFactory_CreatePalette
(
factory
,
&
palette
);
ok
(
hr
==
S_OK
,
"IWICImagingFactory_CreatePalette failed hr=%x
\n
"
,
hr
);
/* palette isn't copied for non-indexed formats? */
hr
=
IWICBitmap_CopyPalette
(
bitmap2
,
palette
);
ok
(
hr
==
WINCODEC_ERR_PALETTEUNAVAILABLE
,
"IWICBitmap_CopyPalette failed hr=%x
\n
"
,
hr
);
todo_wine
ok
(
hr
==
WINCODEC_ERR_PALETTEUNAVAILABLE
,
"IWICBitmap_CopyPalette failed hr=%x
\n
"
,
hr
);
IWICPalette_Release
(
palette
);
...
...
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