template<int W, int ROWS, int COLS, int T>
int hls::AXIvideo2Mat( hls::Mat<ROWS, COLS, T>& mat,
                       hls::stream<ap_axiu<W,1,1,1> >& AXI_video_strm );


  • mat– input image in hls::Mat format.
  • AXI_video_strm – output AXI video stream in hls::stream format, compatible with AXI4-Stream protocol.


Converts image data stored in AXI4 video stream(hls::stream) formatto an image of hls::Mat format.
Image data must be stored in mat, and the data field of AXI_video_strm must be empty before invocations. Invoking this function will consume the data in mat, and filling the image data of AXI_video_strm.
The data width of a pixel in mat must be no greater than W, the data width of TDATA in AXI4-Stream protocol.
In addition to fill image data to AXI video stream, this function will also set TUSER bit of stream element for indicating the top-left pixel, as well as setting TLAST bit in last pixel of each line to indicate the end of line.