1 /* 2 * Copyright (C) 2024 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 IMAGE_EFFECT_MOCK_PIXEL_MAP_H 17 #define IMAGE_EFFECT_MOCK_PIXEL_MAP_H 18 19 #include "gmock/gmock.h" 20 #include "pixel_map.h" 21 22 namespace OHOS { 23 namespace Media { 24 namespace Effect { 25 class MockPixelMap : public PixelMap { 26 public: 27 MockPixelMap(); 28 MockPixelMap(int32_t width, int32_t height); 29 ~MockPixelMap(); 30 MOCK_METHOD0(GetWidth, int32_t()); 31 MOCK_METHOD0(GetHeight, int32_t()); 32 MOCK_METHOD0(GetPixelFormat, PixelFormat()); 33 MOCK_METHOD0(GetRowBytes, int32_t()); 34 MOCK_METHOD0(GetRowStride, int32_t()); 35 MOCK_METHOD0(GetByteCount, int32_t()); 36 MOCK_METHOD0(GetCapacity, uint32_t()); 37 MOCK_METHOD0(GetPixels, const uint8_t *()); 38 MOCK_METHOD0(GetPixelBytes, int32_t()); 39 MOCK_METHOD1(GetImageInfo, void(ImageInfo &imageInfo)); 40 MOCK_METHOD0(GetAllocatorType, AllocatorType()); 41 MOCK_METHOD5(SetPixelsAddr, void(void *addr, void *context, uint32_t size, AllocatorType type, 42 CustomFreePixelMap func)); 43 44 private: 45 void *buffer = nullptr; 46 }; 47 } // namespace Effect 48 } // namespace Media 49 } // namespace OHOS 50 51 #endif // IMAGE_EFFECT_MOCK_PIXEL_MAP_H