• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (c) 2023 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 #include "utils/matrix44.h"
17 
18 #include "impl_factory.h"
19 #include "utils/log.h"
20 
21 namespace OHOS {
22 namespace Rosen {
23 namespace Drawing {
Matrix44()24 Matrix44::Matrix44() : impl_(ImplFactory::CreateMatrix44Impl()) {}
25 
Translate(scalar dx,scalar dy,scalar dz)26 void Matrix44::Translate(scalar dx, scalar dy, scalar dz)
27 {
28     impl_->Translate(dx, dy, dz);
29 }
30 
Scale(scalar sx,scalar sy,scalar sz)31 void Matrix44::Scale(scalar sx, scalar sy, scalar sz)
32 {
33     impl_->Scale(sx, sy, sz);
34 }
35 
operator *(const Matrix44 & other)36 Matrix44 Matrix44::operator*(const Matrix44& other)
37 {
38     impl_->Multiply(*this, other);
39     return *this;
40 }
41 
operator Matrix() const42 Matrix44::operator Matrix() const
43 {
44     return impl_->ConvertToMatrix();
45 }
46 
SetMatrix44(const Buffer & buffer)47 void Matrix44::SetMatrix44(const Buffer& buffer)
48 {
49     impl_->SetMatrix44(buffer);
50 }
51 } // namespace Drawing
52 } // namespace Rosen
53 } // namespace OHOS
54