VART-X  0.3.0
vart_preprocess.hpp
Go to the documentation of this file.
1 /*
2  * Copyright 2024-2026 Advanced Micro Devices Inc.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License");
5  * you may not use this file except in compliance with the License.
6  * You may obtain a copy of the License at
7  *
8  * http://www.apache.org/licenses/LICENSE-2.0
9  *
10  * Unless required by applicable law or agreed to in writing, software
11  * distributed under the License is distributed on an "AS IS" BASIS,
12  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13  * See the License for the specific language governing permissions and
14  * limitations under the License.
15  */
16 
17 #pragma once
18 
24 #include <cstdint>
25 #include <memory>
26 #include <string>
27 #include "vart_device.hpp"
29 #include "vart_videoframe.hpp"
30 
33 namespace vart {
34 
38 class PreProcessImplBase;
39 
51 class PreProcess {
52  public:
53  PreProcess() = delete;
54 
69  PreProcess(PreProcessImplType type, std::string& json_data, std::shared_ptr<Device> device);
70 
77  PreProcess(std::shared_ptr<PreProcessImplBase> ptr);
78 
79  ~PreProcess() = default;
80 
94  void process(std::vector<PreProcessOp>& preprocess_ops);
95 
116  void get_input_vinfo(int32_t height, int32_t width, VideoFormat fmt, VideoInfo& vinfo);
117 
127 
141  void set_preprocess_info(PreProcessInfo& preprocess_info);
142 
150 
157  const std::shared_ptr<PreProcessImplBase>& get_pimpl_handle() const;
158 
159  private:
160  std::shared_ptr<PreProcessImplBase> pimpl;
161 };
162 } // namespace vart
The preprocessing module handles data preparation tasks such as normalization, scaling,...
Definition: vart_preprocess.hpp:51
const PreProcessInfo & get_preprocess_info()
get_preprocess_info() - Get the preprocess info
const VideoInfo & get_output_vinfo()
get_output_vinfo() - Get the output video info.
const std::shared_ptr< PreProcessImplBase > & get_pimpl_handle() const
get_pimpl_handle() - Returns the underlying implementation handle.
void set_preprocess_info(PreProcessInfo &preprocess_info)
set_preprocess_info() - Set the required Preprocess parameters.
PreProcess()=delete
void get_input_vinfo(int32_t height, int32_t width, VideoFormat fmt, VideoInfo &vinfo)
get_input_vinfo() - Fills the input video info from input params.
PreProcess(PreProcessImplType type, std::string &json_data, std::shared_ptr< Device > device)
PreProcess() - Constructor with implementation type and json data.
PreProcess(std::shared_ptr< PreProcessImplBase > ptr)
PreProcess() - Constructor for using user defined implementation.
~PreProcess()=default
void process(std::vector< PreProcessOp > &preprocess_ops)
process() - Perform pre-processing based on the specified parameters.
VART (Vitis AI Runtime) public API namespace.
VideoFormat
Represents video color formats supported by VART core APIs.
Definition: vart_videoframe_types.hpp:47
PreProcessImplType
Selects the pre-processing backend implementation to use.
Definition: vart_preprocess_types.hpp:32
Structure storing pre-processing parameters.
Definition: vart_preprocess_types.hpp:85
Contains information related to a video frame.
Definition: vart_videoframe_types.hpp:144
Device module managing hardware context and xclbin loading.
Type definitions for the PreProcess module.
VideoFrame module for managing video frame memory.