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