• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2021 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #ifndef IMAGEIMPL_H
17 #define IMAGEIMPL_H
18 
19 #include "base_impl.h"
20 
21 #include "draw/brush.h"
22 #include "effect/color_space.h"
23 #include "image/bitmap.h"
24 #include "image/picture.h"
25 #include "utils/matrix.h"
26 #include "utils/size.h"
27 
28 namespace OHOS {
29 namespace Rosen {
30 namespace Drawing {
31 enum class BitDepth;
32 class ImageImpl : public BaseImpl {
33 public:
34     static inline constexpr AdapterType TYPE = AdapterType::BASE_INTERFACE;
ImageImpl()35     ImageImpl() noexcept {}
~ImageImpl()36     ~ImageImpl() override {}
GetType()37     AdapterType GetType() const override
38     {
39         return AdapterType::BASE_INTERFACE;
40     }
41     virtual void* BuildFromBitmap(const Bitmap& bitmap) = 0;
42     virtual void* BuildFromPicture(const Picture& picture, const SizeI& dimensions, const Matrix& matrix,
43         const Brush& brush, BitDepth bitDepth, std::shared_ptr<ColorSpace> colorSpace) = 0;
44     virtual int GetWidth() = 0;
45     virtual int GetHeight() = 0;
46 };
47 } // namespace Drawing
48 } // namespace Rosen
49 } // namespace OHOS
50 #endif
51