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 /** 17 * @addtogroup cr_sdk 18 * @{ 19 * 20 * @brief Defines the development tool functions, constants, and error codes for card rectification (CR). 21 * 22 * @since 2.2 23 * @version 1.0 24 */ 25 26 /** 27 * @file cr_callback.h 28 * 29 * @brief Defines the callback for processing errors and prediction results of card rectification. 30 * 31 * @since 2.2 32 * @version 1.0 33 */ 34 35 #ifndef CR_CALLBACK_H 36 #define CR_CALLBACK_H 37 38 #include "cr_constants.h" 39 #include "kits/ai_retcode.h" 40 #include "kits/ai_callback.h" 41 42 namespace OHOS { 43 namespace AI { 44 template<> 45 class ICallback<RectifyCardOutput> { 46 public: 47 /** 48 * @brief Defines the destructor for the callback. 49 * 50 * @since 2.2 51 * @version 1.0 52 */ 53 virtual ~ICallback() = default; 54 55 /** 56 * @brief Defines the callback for prediction results. 57 * 58 * @param result Indicates the prediction result. 59 * 60 * @since 2.2 61 * @version 1.0 62 */ 63 virtual void OnDetectedResult(const int resultCode, const RectifyCardOutput &result) = 0; 64 }; 65 } // namespace AI 66 } // namespace OHOS 67 68 #endif // CR_CALLBACK_H 69 /** @} */ 70