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 PLUGINS_COMMON_LIBS_IMAGE_LIBEXTPLUGIN_INCLUDE_HEIF_PARSER_ITEM_PROPERTY_TRANSFORM_BOX_H
17 #define PLUGINS_COMMON_LIBS_IMAGE_LIBEXTPLUGIN_INCLUDE_HEIF_PARSER_ITEM_PROPERTY_TRANSFORM_BOX_H
18 
19 #include "box/heif_box.h"
20 
21 namespace OHOS {
22 namespace ImagePlugin {
23 class HeifIrotBox : public HeifBox {
24 public:
HeifIrotBox()25     HeifIrotBox() : HeifBox(BOX_TYPE_IROT) {}
26 
GetRotDegree()27     int GetRotDegree() const { return rotDegree_; }
28 
SetRotDegree(int rot)29     void SetRotDegree(int rot) { rotDegree_ = rot; }
30 
31 protected:
32     heif_error ParseContent(HeifStreamReader &reader) override;
33 
34     heif_error Write(HeifStreamWriter &writer) const override;
35 
36 private:
37     int rotDegree_ = 0;
38 };
39 
40 class HeifImirBox : public HeifBox {
41 public:
HeifImirBox()42     HeifImirBox() : HeifBox(BOX_TYPE_IMIR) {}
43 
GetDirection()44     HeifTransformMirrorDirection GetDirection() const { return direction_; }
45 
SetDirection(HeifTransformMirrorDirection dir)46     void SetDirection(HeifTransformMirrorDirection dir) { direction_ = dir; }
47 
48 protected:
49     heif_error ParseContent(HeifStreamReader &reader) override;
50 
51     heif_error Write(HeifStreamWriter &writer) const override;
52 
53 private:
54     HeifTransformMirrorDirection direction_ = HeifTransformMirrorDirection::VERTICAL;
55 };
56 } // namespace ImagePlugin
57 } // namespace OHOS
58 
59 #endif // PLUGINS_COMMON_LIBS_IMAGE_LIBEXTPLUGIN_INCLUDE_HEIF_PARSER_ITEM_PROPERTY_TRANSFORM_BOX_H
60