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