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 PLUGINS_COMMON_LIBS_IMAGE_LIBEXTPLUGIN_INCLUDE_TEXTURE_ENCODE_TEXTURE_TYPE_H 17 #define PLUGINS_COMMON_LIBS_IMAGE_LIBEXTPLUGIN_INCLUDE_TEXTURE_ENCODE_TEXTURE_TYPE_H 18 19 #include "astcenc.h" 20 #ifndef QUALITY_CONTROL 21 #define QUALITY_CONTROL (1) 22 #endif 23 namespace OHOS { 24 namespace ImagePlugin { 25 typedef struct TextureEncodeOptionsType { 26 int32_t width_; 27 int32_t height_; 28 uint8_t blockX_; 29 uint8_t blockY_; 30 int32_t stride_; 31 QualityProfile privateProfile_; // enum type defined in astc-encoder module: HIGH_QUALITY_PROFILE HIGH_SPEED_PROFILE 32 } TextureEncodeOptions; 33 34 typedef struct AstcEncoderInfo { 35 astcenc_config config; 36 astcenc_profile profile; 37 astcenc_context* codec_context; 38 astcenc_image image_; 39 astcenc_swizzle swizzle_; 40 uint8_t* data_out_; 41 astcenc_error error_; 42 #if defined(QUALITY_CONTROL) && (QUALITY_CONTROL == 1) 43 bool calQualityEnable; 44 int32_t *mse[RGBA_COM + 1]; 45 #endif 46 } AstcEncoder; 47 } // namespace ImagePlugin 48 } // namespace OHOS 49 50 #endif // PLUGINS_COMMON_LIBS_IMAGE_LIBEXTPLUGIN_INCLUDE_TEXTURE_ENCODE_TEXTURE_TYPE_H