1 /* vim:set sw=2 sts=2 et cin: */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef NSIMAGETOPIXBUF_H_
7 #define NSIMAGETOPIXBUF_H_
9 #include "mozilla/Attributes.h"
10 #include "mozilla/Maybe.h"
11 #include "mozilla/RefPtr.h"
15 typedef struct _GdkPixbuf GdkPixbuf
;
17 namespace mozilla::gfx
{
19 } // namespace mozilla::gfx
21 class nsImageToPixbuf final
{
22 using SourceSurface
= mozilla::gfx::SourceSurface
;
25 // Friendlier version of ConvertImageToPixbuf for callers inside of
27 static already_AddRefed
<GdkPixbuf
> ImageToPixbuf(
28 imgIContainer
* aImage
,
29 const mozilla::Maybe
<nsIntSize
>& aOverrideSize
= mozilla::Nothing());
30 static already_AddRefed
<GdkPixbuf
> SourceSurfaceToPixbuf(
31 SourceSurface
* aSurface
, int32_t aWidth
, int32_t aHeight
);
34 ~nsImageToPixbuf() = default;