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
363a0fdd
Commit
363a0fdd
authored
Aug 27, 2009
by
Vincent Povirk
Committed by
Alexandre Julliard
Aug 28, 2009
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
windowscodecs: Implement conversion from 16bppGray to 32bppBGRA.
parent
25022fe7
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
0 deletions
+45
-0
converter.c
dlls/windowscodecs/converter.c
+44
-0
regsvr.c
dlls/windowscodecs/regsvr.c
+1
-0
No files found.
dlls/windowscodecs/converter.c
View file @
363a0fdd
...
...
@@ -44,6 +44,7 @@ enum pixelformat {
format_2bppGray
,
format_4bppGray
,
format_8bppGray
,
format_16bppGray
,
format_16bppBGR555
,
format_16bppBGR565
,
format_24bppBGR
,
...
...
@@ -380,6 +381,48 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe
return
res
;
}
return
S_OK
;
case
format_16bppGray
:
if
(
prc
)
{
HRESULT
res
;
UINT
x
,
y
;
BYTE
*
srcdata
;
UINT
srcstride
,
srcdatasize
;
const
BYTE
*
srcrow
;
const
BYTE
*
srcbyte
;
BYTE
*
dstrow
;
DWORD
*
dstpixel
;
srcstride
=
prc
->
Width
*
2
;
srcdatasize
=
srcstride
*
prc
->
Height
;
srcdata
=
HeapAlloc
(
GetProcessHeap
(),
0
,
srcdatasize
);
if
(
!
srcdata
)
return
E_OUTOFMEMORY
;
res
=
IWICBitmapSource_CopyPixels
(
This
->
source
,
prc
,
srcstride
,
srcdatasize
,
srcdata
);
if
(
SUCCEEDED
(
res
))
{
srcrow
=
srcdata
;
dstrow
=
pbBuffer
;
for
(
y
=
0
;
y
<
prc
->
Height
;
y
++
)
{
srcbyte
=
(
const
BYTE
*
)
srcrow
;
dstpixel
=
(
DWORD
*
)
dstrow
;
for
(
x
=
0
;
x
<
prc
->
Width
;
x
++
)
{
*
dstpixel
++
=
0xff000000
|
(
*
srcbyte
<<
16
)
|
(
*
srcbyte
<<
8
)
|*
srcbyte
;
srcbyte
+=
2
;
}
srcrow
+=
srcstride
;
dstrow
+=
cbStride
;
}
}
HeapFree
(
GetProcessHeap
(),
0
,
srcdata
);
return
res
;
}
return
S_OK
;
case
format_16bppBGR555
:
if
(
prc
)
{
...
...
@@ -567,6 +610,7 @@ static const struct pixelformatinfo supported_formats[] = {
{
format_2bppGray
,
&
GUID_WICPixelFormat2bppGray
,
NULL
},
{
format_4bppGray
,
&
GUID_WICPixelFormat4bppGray
,
NULL
},
{
format_8bppGray
,
&
GUID_WICPixelFormat8bppGray
,
NULL
},
{
format_16bppGray
,
&
GUID_WICPixelFormat16bppGray
,
NULL
},
{
format_16bppBGR555
,
&
GUID_WICPixelFormat16bppBGR555
,
NULL
},
{
format_16bppBGR565
,
&
GUID_WICPixelFormat16bppBGR565
,
NULL
},
{
format_24bppBGR
,
&
GUID_WICPixelFormat24bppBGR
,
NULL
},
...
...
dlls/windowscodecs/regsvr.c
View file @
363a0fdd
...
...
@@ -925,6 +925,7 @@ static GUID const * const converter_formats[] = {
&
GUID_WICPixelFormat2bppGray
,
&
GUID_WICPixelFormat4bppGray
,
&
GUID_WICPixelFormat8bppGray
,
&
GUID_WICPixelFormat16bppGray
,
&
GUID_WICPixelFormat16bppBGR555
,
&
GUID_WICPixelFormat16bppBGR565
,
&
GUID_WICPixelFormat24bppBGR
,
...
...
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