Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions mediapipe_api/framework/formats/image_frame.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,14 @@ MpReturnCode mp_ImageFrame__ui_i_i_ui(mediapipe::ImageFormat::Format format, int
CATCH_ALL
}

MpReturnCode mp_ImageFrame__ui_i_i_i_Pui8_PF(mediapipe::ImageFormat::Format format, int width, int height, int width_step, uint8* pixel_data, Deleter* deleter,
MpReturnCode mp_ImageFrame__ui_i_i_i_Pui8(mediapipe::ImageFormat::Format format, int width, int height, int width_step, uint8* pixel_data,
mediapipe::ImageFrame** image_frame_out) {
TRY_ALL
*image_frame_out = new mediapipe::ImageFrame{format, width, height, width_step, pixel_data, deleter};
// Copy pixel data
mediapipe::ImageFrame* output_frame = new mediapipe::ImageFrame{};
output_frame->CopyPixelData(format, width,
height, width_step, pixel_data, mediapipe::ImageFrame::kDefaultAlignmentBoundary);
*image_frame_out = output_frame;
RETURN_CODE(MpReturnCode::Success);
CATCH_ALL
}
Expand Down
4 changes: 2 additions & 2 deletions mediapipe_api/framework/formats/image_frame.h
Original file line number Diff line number Diff line change
Expand Up @@ -24,8 +24,8 @@ typedef void(Deleter)(uint8*);
MP_CAPI(MpReturnCode) mp_ImageFrame__(mediapipe::ImageFrame** image_frame_out);
MP_CAPI(MpReturnCode) mp_ImageFrame__ui_i_i_ui(mediapipe::ImageFormat::Format format, int width, int height, uint32 alignment_boundary,
mediapipe::ImageFrame** image_frame_out);
MP_CAPI(MpReturnCode) mp_ImageFrame__ui_i_i_i_Pui8_PF(mediapipe::ImageFormat::Format format, int width, int height, int width_step, uint8* pixel_data,
Deleter* deleter, mediapipe::ImageFrame** image_frame_out);
MP_CAPI(MpReturnCode) mp_ImageFrame__ui_i_i_i_Pui8(mediapipe::ImageFormat::Format format, int width, int height, int width_step, uint8* pixel_data,
mediapipe::ImageFrame** image_frame_out);
MP_CAPI(void) mp_ImageFrame__delete(mediapipe::ImageFrame* image_frame);
MP_CAPI(bool) mp_ImageFrame__IsEmpty(mediapipe::ImageFrame* image_frame);
MP_CAPI(MpReturnCode) mp_ImageFrame__SetToZero(mediapipe::ImageFrame* image_frame);
Expand Down