Backed out 3 changesets (bug 1870106, bug 1845276) for causing doc generate failures...
[gecko.git] / widget / gtk / nsImageToPixbuf.h
blob500489d7ebafb8727f640371ba0415c46a798d65
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"
12 #include "nsSize.h"
14 class imgIContainer;
15 typedef struct _GdkPixbuf GdkPixbuf;
17 namespace mozilla::gfx {
18 class SourceSurface;
19 } // namespace mozilla::gfx
21 class nsImageToPixbuf final {
22 using SourceSurface = mozilla::gfx::SourceSurface;
24 public:
25 // Friendlier version of ConvertImageToPixbuf for callers inside of
26 // widget
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);
33 private:
34 ~nsImageToPixbuf() = default;
37 #endif