1 /* 2 * Copyright (c) 2024 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 #ifndef META_INTERFACE_ICURVE_H 16 #define META_INTERFACE_ICURVE_H 17 18 #include <meta/base/namespace.h> 19 #include <meta/interface/intf_object.h> 20 21 META_BEGIN_NAMESPACE() 22 23 META_REGISTER_INTERFACE(ICurve, "9ec41bb4-d5a9-4c18-afa4-686908e76adb") 24 25 /** 26 * @brief ICurve is the base interface for all curves. A curve transforms a parameter 27 * along a curve, specified by each class which implements the ICurve interface. 28 */ 29 template<class T> 30 class ICurve : public CORE_NS::IInterface { 31 META_INTERFACE(CORE_NS::IInterface, ICurve) 32 public: 33 /** 34 * @brief The transformation function for this curve. Transform function should be 35 * re-entrant. 36 * @param t The point along the curve where the transformation should happen. 37 * @return Transformed value. 38 */ 39 virtual T Transform(float t) const = 0; 40 }; 41 42 META_END_NAMESPACE() 43 44 #endif 45