1 /*
2  * Copyright (c) 2023 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 #ifndef FOUNDATION_ACE_TEST_MOCK_BASE_MOCK_PIXEL_MAP_H
16 #define FOUNDATION_ACE_TEST_MOCK_BASE_MOCK_PIXEL_MAP_H
17 #include "gmock/gmock.h"
18 
19 #include "base/image/pixel_map.h"
20 
21 namespace OHOS::Ace {
22 class MockPixelMap : public PixelMap {
23 public:
24     MOCK_METHOD(int32_t, GetWidth, (), (const override));
25     MOCK_METHOD(int32_t, GetHeight, (), (const override));
26     MOCK_METHOD(bool, GetPixelsVec, (std::vector<uint8_t> & data), (const override));
27     MOCK_METHOD(const uint8_t*, GetPixels, (), (const override));
28     MOCK_METHOD(PixelFormat, GetPixelFormat, (), (const override));
29     MOCK_METHOD(AlphaType, GetAlphaType, (), (const override));
30     MOCK_METHOD(int32_t, GetRowStride, (), (const override));
31     MOCK_METHOD(int32_t, GetRowBytes, (), (const override));
32     MOCK_METHOD(int32_t, GetByteCount, (), (const override));
33     MOCK_METHOD(void*, GetPixelManager, (), (const override));
34     MOCK_METHOD(void*, GetRawPixelMapPtr, (), (const override));
35     MOCK_CONST_METHOD0(GetWritablePixels, void*());
36     MOCK_METHOD(void, Scale, (float xAxis, float yAxis), (override));
37     MOCK_METHOD(void, Scale, (float xAxis, float yAxis, const AceAntiAliasingOption &option), (override));
38     MOCK_METHOD(std::string, GetId, (), (override));
39     MOCK_METHOD(std::string, GetModifyId, (), (override));
40     MOCK_METHOD0(GetPixelMapSharedPtr, std::shared_ptr<Media::PixelMap>());
41     MOCK_METHOD(void, SavePixelMapToFile, (const std::string& dst), (const override));
42     MOCK_METHOD(RefPtr<PixelMap>, GetCropPixelMap, (const Rect& srcRect), (override));
43     MOCK_METHOD(bool, EncodeTlv, (std::vector<uint8_t>& buff), (override));
44 };
45 } // namespace OHOS::Ace
46 #endif // FOUNDATION_ACE_TEST_MOCK_BASE_MOCK_PIXEL_MAP_H
47