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
0a495723
Commit
0a495723
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 64bppRGBA to 32bppBGRA.
parent
7f737879
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
48 additions
and
0 deletions
+48
-0
converter.c
dlls/windowscodecs/converter.c
+47
-0
regsvr.c
dlls/windowscodecs/regsvr.c
+1
-0
No files found.
dlls/windowscodecs/converter.c
View file @
0a495723
...
...
@@ -51,6 +51,7 @@ enum pixelformat {
format_32bppBGR
,
format_32bppBGRA
,
format_48bppRGB
,
format_64bppRGBA
,
};
typedef
HRESULT
(
*
copyfunc
)(
struct
FormatConverter
*
This
,
const
WICRect
*
prc
,
...
...
@@ -626,6 +627,51 @@ static HRESULT copypixels_to_32bppBGRA(struct FormatConverter *This, const WICRe
return
res
;
}
return
S_OK
;
case
format_64bppRGBA
:
if
(
prc
)
{
HRESULT
res
;
UINT
x
,
y
;
BYTE
*
srcdata
;
UINT
srcstride
,
srcdatasize
;
const
BYTE
*
srcrow
;
const
BYTE
*
srcpixel
;
BYTE
*
dstrow
;
DWORD
*
dstpixel
;
srcstride
=
8
*
prc
->
Width
;
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
++
)
{
srcpixel
=
srcrow
;
dstpixel
=
(
DWORD
*
)
dstrow
;
for
(
x
=
0
;
x
<
prc
->
Width
;
x
++
)
{
BYTE
red
,
green
,
blue
,
alpha
;
red
=
*
srcpixel
++
;
srcpixel
++
;
green
=
*
srcpixel
++
;
srcpixel
++
;
blue
=
*
srcpixel
++
;
srcpixel
++
;
alpha
=
*
srcpixel
++
;
srcpixel
++
;
*
dstpixel
++=
alpha
<<
24
|
red
<<
16
|
green
<<
8
|
blue
;
}
srcrow
+=
srcstride
;
dstrow
+=
cbStride
;
}
}
HeapFree
(
GetProcessHeap
(),
0
,
srcdata
);
return
res
;
}
return
S_OK
;
default:
return
WINCODEC_ERR_UNSUPPORTEDOPERATION
;
}
...
...
@@ -662,6 +708,7 @@ static const struct pixelformatinfo supported_formats[] = {
{
format_32bppBGR
,
&
GUID_WICPixelFormat32bppBGR
,
copypixels_to_32bppBGR
},
{
format_32bppBGRA
,
&
GUID_WICPixelFormat32bppBGRA
,
copypixels_to_32bppBGRA
},
{
format_48bppRGB
,
&
GUID_WICPixelFormat48bppRGB
,
NULL
},
{
format_64bppRGBA
,
&
GUID_WICPixelFormat64bppRGBA
,
NULL
},
{
0
}
};
...
...
dlls/windowscodecs/regsvr.c
View file @
0a495723
...
...
@@ -932,6 +932,7 @@ static GUID const * const converter_formats[] = {
&
GUID_WICPixelFormat32bppBGR
,
&
GUID_WICPixelFormat32bppBGRA
,
&
GUID_WICPixelFormat48bppRGB
,
&
GUID_WICPixelFormat64bppRGBA
,
NULL
};
...
...
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