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_PACKING_MODULE_TEST_H 17 #define IMAGE_PACKING_MODULE_TEST_H 18 19 #include "multimedia/image_framework/image/image_packer_native.h" 20 #include "multimedia/image_framework/image/image_common.h" 21 #include "multimedia/image_framework/image/image_packer_native.h" 22 #include "multimedia/image_framework/image/pixelmap_native.h" 23 24 constexpr uint32_t BAD_PARAMETER_IMAGEPACKER = 0; 25 constexpr uint32_t BAD_PARAMETER_PACKINGOPTIONS = 1; 26 constexpr uint32_t BAD_PARAMETER_PIXELMAPS = 2; 27 constexpr uint32_t BAD_PARAMETER_OUTDATA = 3; 28 29 struct packMultiFramesOptions { 30 OH_PackingOptionsForSequence *options; 31 OH_PixelmapNative **pixelmaps; 32 int32_t mapSize; 33 uint32_t mode; 34 }; 35 class ImagePackerModuleTest { 36 public: 37 ImagePackerModuleTest(); 38 ~ImagePackerModuleTest(); 39 Image_ErrorCode PackToDataMultiFrames(OH_PackingOptionsForSequence *options, 40 OH_PixelmapNative **pixelmaps, size_t mapSize, uint8_t* outData, size_t* outDataSize); 41 Image_ErrorCode PackToDataMultiFramesError(packMultiFramesOptions *opts, uint8_t* outData, size_t* outDataSize); 42 Image_ErrorCode PackToFileMultiFrames(OH_PackingOptionsForSequence *options, OH_PixelmapNative **pixelmaps, 43 size_t mapSize, int32_t fd); 44 Image_ErrorCode PackToFileMultiFramesError(packMultiFramesOptions *opts, int32_t fd); 45 private: 46 }; 47 #endif // IMAGE_PACKING_MODULE_TEST_H 48