• 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 FRAMEWORKS_ANIMATION_SERVER_SERVER_INCLUDE_ROTATION_ANIMATION_H
17 #define FRAMEWORKS_ANIMATION_SERVER_SERVER_INCLUDE_ROTATION_ANIMATION_H
18 
19 #include <memory>
20 
21 #include <graphic_common.h>
22 #include <shader.h>
23 #include <texture.h>
24 
25 #include "array.h"
26 
27 namespace OHOS {
28 struct RotationAnimationParam {
29     std::shared_ptr<struct Array> data;
30     int32_t width; // data width
31     int32_t height; // data height
32     int64_t startTime; // ms
33     int64_t duration; // ms
34     double degree;
35 };
36 
37 class RotationAnimation {
38 public:
39     GSError Init(struct RotationAnimationParam &param);
40     bool Draw();
41 
42 private:
43     std::unique_ptr<Texture> texture_ = nullptr;
44     std::unique_ptr<Shader> shader_ = nullptr;
45     struct RotationAnimationParam param_ = {};
46 };
47 } // namespace OHOS
48 
49 #endif // FRAMEWORKS_ANIMATION_SERVER_SERVER_INCLUDE_ROTATION_ANIMATION_H
50