Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
wine
Manage
Activity
Members
Labels
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Package registry
Container Registry
Model registry
Operate
Terraform modules
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lorenzo Ferrillo
wine
Commits
8b3fce9b
Commit
8b3fce9b
authored
12 years ago
by
Esme Povirk
Committed by
Alexandre Julliard
12 years ago
Browse files
Options
Downloads
Patches
Plain Diff
windowscodecs: Implement JpegEncoder_Frame_WriteSource.
parent
2c5d7d71
No related branches found
Branches containing commit
Tags
wine-1.3.17
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
dlls/windowscodecs/jpegformat.c
+68
-2
68 additions, 2 deletions
dlls/windowscodecs/jpegformat.c
with
68 additions
and
2 deletions
dlls/windowscodecs/jpegformat.c
+
68
−
2
View file @
8b3fce9b
...
...
@@ -1064,8 +1064,74 @@ static HRESULT WINAPI JpegEncoder_Frame_WritePixels(IWICBitmapFrameEncode *iface
static
HRESULT
WINAPI
JpegEncoder_Frame_WriteSource
(
IWICBitmapFrameEncode
*
iface
,
IWICBitmapSource
*
pIBitmapSource
,
WICRect
*
prc
)
{
FIXME
(
"(%p,%p,%p): stub
\n
"
,
iface
,
pIBitmapSource
,
prc
);
return
E_NOTIMPL
;
JpegEncoder
*
This
=
impl_from_IWICBitmapFrameEncode
(
iface
);
HRESULT
hr
;
WICRect
rc
;
WICPixelFormatGUID
guid
;
UINT
stride
;
BYTE
*
pixeldata
;
TRACE
(
"(%p,%p,%p)
\n
"
,
iface
,
pIBitmapSource
,
prc
);
if
(
!
This
->
frame_initialized
||
!
This
->
width
||
!
This
->
height
)
return
WINCODEC_ERR_WRONGSTATE
;
if
(
!
This
->
format
)
{
hr
=
IWICBitmapSource_GetPixelFormat
(
pIBitmapSource
,
&
guid
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IWICBitmapFrameEncode_SetPixelFormat
(
iface
,
&
guid
);
if
(
FAILED
(
hr
))
return
hr
;
}
hr
=
IWICBitmapSource_GetPixelFormat
(
pIBitmapSource
,
&
guid
);
if
(
FAILED
(
hr
))
return
hr
;
if
(
memcmp
(
&
guid
,
This
->
format
->
guid
,
sizeof
(
GUID
))
!=
0
)
{
/* FIXME: should use WICConvertBitmapSource to convert */
ERR
(
"format %s unsupported
\n
"
,
debugstr_guid
(
&
guid
));
return
E_FAIL
;
}
if
(
This
->
xres
==
0
.
0
||
This
->
yres
==
0
.
0
)
{
double
xres
,
yres
;
hr
=
IWICBitmapSource_GetResolution
(
pIBitmapSource
,
&
xres
,
&
yres
);
if
(
FAILED
(
hr
))
return
hr
;
hr
=
IWICBitmapFrameEncode_SetResolution
(
iface
,
xres
,
yres
);
if
(
FAILED
(
hr
))
return
hr
;
}
if
(
!
prc
)
{
UINT
width
,
height
;
hr
=
IWICBitmapSource_GetSize
(
pIBitmapSource
,
&
width
,
&
height
);
if
(
FAILED
(
hr
))
return
hr
;
rc
.
X
=
0
;
rc
.
Y
=
0
;
rc
.
Width
=
width
;
rc
.
Height
=
height
;
prc
=
&
rc
;
}
if
(
prc
->
Width
!=
This
->
width
)
return
E_INVALIDARG
;
stride
=
(
This
->
format
->
bpp
*
This
->
width
+
7
)
/
8
;
pixeldata
=
HeapAlloc
(
GetProcessHeap
(),
0
,
stride
*
prc
->
Height
);
if
(
!
pixeldata
)
return
E_OUTOFMEMORY
;
hr
=
IWICBitmapSource_CopyPixels
(
pIBitmapSource
,
prc
,
stride
,
stride
*
prc
->
Height
,
pixeldata
);
if
(
SUCCEEDED
(
hr
))
{
hr
=
IWICBitmapFrameEncode_WritePixels
(
iface
,
prc
->
Height
,
stride
,
stride
*
prc
->
Height
,
pixeldata
);
}
HeapFree
(
GetProcessHeap
(),
0
,
pixeldata
);
return
hr
;
}
static
HRESULT
WINAPI
JpegEncoder_Frame_Commit
(
IWICBitmapFrameEncode
*
iface
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment