1 /* 2 * Copyright (c) 2022 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 FOUNDATION_ACE_FRAMEWORKS_BASE_GEOMETRY_NG_IMAGEMESH_H 17 #define FOUNDATION_ACE_FRAMEWORKS_BASE_GEOMETRY_NG_IMAGEMESH_H 18 19 #include <stdint.h> 20 #include <vector> 21 22 namespace OHOS::Ace::NG { 23 class ImageMesh final { 24 public: 25 ImageMesh() = default; ImageMesh(std::vector<double> & mesh,int32_t column,int32_t row)26 ImageMesh(std::vector<double>& mesh, int32_t column, int32_t row) : mesh_(mesh), column_(column), row_(row) {} 27 ~ImageMesh() = default; GetMesh()28 std::vector<double> GetMesh() const 29 { 30 return mesh_; 31 } 32 GetColumn()33 int32_t GetColumn() const 34 { 35 return column_; 36 } 37 GetRow()38 int32_t GetRow() const 39 { 40 return row_; 41 } 42 43 bool operator==(const ImageMesh& imageMesh) const 44 { 45 return (mesh_ == imageMesh.mesh_) && (column_ == imageMesh.column_) && (row_ == imageMesh.row_); 46 } 47 48 bool operator!=(const ImageMesh& imageMesh) const 49 { 50 return (mesh_ != imageMesh.mesh_) || (column_ != imageMesh.column_) || (row_ != imageMesh.row_); 51 } 52 53 ImageMesh& operator=(const ImageMesh& imageMesh) 54 { 55 mesh_ = imageMesh.mesh_; 56 column_ = imageMesh.column_; 57 row_ = imageMesh.row_; 58 return *this; 59 } 60 61 private: 62 std::vector<double> mesh_; 63 int32_t column_; 64 int32_t row_; 65 }; 66 } // namespace OHOS::Ace::NG 67 #endif