#ifndef ___CROP_PROCESS_H__ #define ___CROP_PROCESS_H__ #include #include "acl/ops/acl_dvpp.h" #include "../ai_platform/header.h" using namespace std; class DeviceMemory; typedef enum Result { SUCCESS = 0, FAILED = 1 } Result; class DvppCropProcess { public: /** * @brief Constructor * @param [in] stream: stream */ DvppCropProcess(); /** * @brief Destructor */ ~DvppCropProcess(); public: /** * @brief Process Batch Crop * @return result */ Result ProcessBatchCrop(DeviceMemory *devMem, vector objs); /** * @brief init reousce * @return result */ Result init(int deviceId); private: /** * @brief InitBatchCropInputDesc * @return Result */ Result InitBatchCropInputDesc(DeviceMemory *devMem); /** * @brief InitBatchCropOutputDesc * @return Result */ Result InitBatchCropOutputDesc(vector objs); /** * @brief DestroyBatchCropResource */ void DestroyBatchCropResource(); void DestroyResource(); /** * @brief init reousce * @return result */ Result InitProcess(); private: int32_t deviceId_; aclrtContext context_; aclrtStream stream_; acldvppChannelDesc *dvppChannelDesc_; acldvppResizeConfig *resizeConfig_; std::vector vecOutPtr_; acldvppBatchPicDesc *inputBatchPicDesc_; // vpc input desc acldvppBatchPicDesc *outputBatchPicDesc_; // vpc output desc uint32_t inputBatchSize_; uint32_t outputBatchSize_; }; #endif // ___CROP_PROCESS_H__