• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 // Copyright (c) 2022 The Chromium Embedded Framework Authors. All rights
2 // reserved. Use of this source code is governed by a BSD-style license that
3 // can be found in the LICENSE file.
4 //
5 // ---------------------------------------------------------------------------
6 //
7 // This file was generated by the CEF translator tool. If making changes by
8 // hand only do so within the body of existing method and function
9 // implementations. See the translator.README.txt file in the tools directory
10 // for more information.
11 //
12 // $hash=30ebbc8a004b2e371be3ee2bc305858c303f37fd$
13 //
14 
15 #ifndef CEF_LIBCEF_DLL_CTOCPP_IMAGE_CTOCPP_H_
16 #define CEF_LIBCEF_DLL_CTOCPP_IMAGE_CTOCPP_H_
17 #pragma once
18 
19 #if !defined(WRAPPING_CEF_SHARED)
20 #error This file can be included wrapper-side only
21 #endif
22 
23 #include "include/capi/cef_image_capi.h"
24 #include "include/cef_image.h"
25 #include "libcef_dll/ctocpp/ctocpp_ref_counted.h"
26 
27 // Wrap a C structure with a C++ class.
28 // This class may be instantiated and accessed wrapper-side only.
29 class CefImageCToCpp
30     : public CefCToCppRefCounted<CefImageCToCpp, CefImage, cef_image_t> {
31  public:
32   CefImageCToCpp();
33   virtual ~CefImageCToCpp();
34 
35   // CefImage methods.
36   bool IsEmpty() override;
37   bool IsSame(CefRefPtr<CefImage> that) override;
38   bool AddBitmap(float scale_factor,
39                  int pixel_width,
40                  int pixel_height,
41                  cef_color_type_t color_type,
42                  cef_alpha_type_t alpha_type,
43                  const void* pixel_data,
44                  size_t pixel_data_size) override;
45   bool AddPNG(float scale_factor,
46               const void* png_data,
47               size_t png_data_size) override;
48   bool AddJPEG(float scale_factor,
49                const void* jpeg_data,
50                size_t jpeg_data_size) override;
51   size_t GetWidth() override;
52   size_t GetHeight() override;
53   bool HasRepresentation(float scale_factor) override;
54   bool RemoveRepresentation(float scale_factor) override;
55   bool GetRepresentationInfo(float scale_factor,
56                              float& actual_scale_factor,
57                              int& pixel_width,
58                              int& pixel_height) override;
59   CefRefPtr<CefBinaryValue> GetAsBitmap(float scale_factor,
60                                         cef_color_type_t color_type,
61                                         cef_alpha_type_t alpha_type,
62                                         int& pixel_width,
63                                         int& pixel_height) override;
64   CefRefPtr<CefBinaryValue> GetAsPNG(float scale_factor,
65                                      bool with_transparency,
66                                      int& pixel_width,
67                                      int& pixel_height) override;
68   CefRefPtr<CefBinaryValue> GetAsJPEG(float scale_factor,
69                                       int quality,
70                                       int& pixel_width,
71                                       int& pixel_height) override;
72 };
73 
74 #endif  // CEF_LIBCEF_DLL_CTOCPP_IMAGE_CTOCPP_H_
75