• 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 PLUGINS_COMMON_LIBS_IMAGE_LIBEXTPLUGIN_INCLUDE_TEXTURE_ENCODE_ASTC_ENCODE_H
17 #define PLUGINS_COMMON_LIBS_IMAGE_LIBEXTPLUGIN_INCLUDE_TEXTURE_ENCODE_ASTC_ENCODE_H
18 #include "abs_image_encoder.h"
19 #include "texture_type.h"
20 
21 namespace OHOS {
22 namespace ImagePlugin {
23 class AstcCodec {
24 public:
AstcCodec()25     AstcCodec() {};
~AstcCodec()26     ~AstcCodec() {};
27     uint32_t SetAstcEncode(OutputDataStream* outputStream, PlEncodeOptions &option, Media::PixelMap* pixelMap);
28     uint32_t ASTCEncode();
29     uint32_t AstcSoftwareEncode(TextureEncodeOptions &param, bool enableQualityCheck,
30                                 int32_t blocksNum, int32_t outSize);
31 
32 private:
33     DISALLOW_COPY_AND_MOVE(AstcCodec);
34     OutputDataStream* astcOutput_ = nullptr;
35     PlEncodeOptions astcOpts_;
36     Media::PixelMap* astcPixelMap_ = nullptr;
37 };
38 } // namespace ImagePlugin
39 } // namespace OHOS
40 #endif // PLUGINS_COMMON_LIBS_IMAGE_LIBEXTPLUGIN_INCLUDE_TEXTURE_ENCODE_ASTC_ENCODE_H