• 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 CAMERA3D_H
17 #define CAMERA3D_H
18 
19 #include "drawing/engine_adapter/impl_interface/camera_impl.h"
20 #include "utils/matrix.h"
21 #include "utils/scalar.h"
22 
23 namespace OHOS {
24 namespace Rosen {
25 namespace Drawing {
26 class Camera3D {
27 public:
28     Camera3D() noexcept;
29     ~Camera3D();
30 
31     void Save();
32     void Restore();
33 
34     void Translate(scalar x, scalar y, scalar z);
35     void RotateXDegrees(scalar deg);
36     void RotateYDegrees(scalar deg);
37     void RotateZDegrees(scalar deg);
38 
39     void SetCameraPos(scalar x, scalar y, scalar z);
40     scalar GetCameraPosX() const;
41     scalar GetCameraPosY() const;
42     scalar GetCameraPosZ() const;
43 
44     void ApplyToMatrix(Matrix& m);
45 
46 private:
47     std::unique_ptr<CameraImpl> impl_;
48 };
49 } // namespace Drawing
50 } // namespace Rosen
51 } // namespace OHOS
52 #endif