Skip to content

Commit

Permalink
feat cv: add pixelbuffer api to get bytesPerRowOfPlane
Browse files Browse the repository at this point in the history
  • Loading branch information
Pranav2612000 committed Jan 11, 2025
1 parent 4132aaf commit 3c22b3e
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions cidre/src/cv/pixel_buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,12 @@ impl PixelBuf {
unsafe { CVPixelBufferGetBaseAddressOfPlane(self, plane_index) }
}

#[doc(alias = "CVPixelBufferGetBytesPerRowOfPlane")]
#[inline]
pub fn plane_bytes_per_row(&self, plane_index: usize) -> usize {
unsafe { CVPixelBufferGetBytesPerRowOfPlane(self, plane_index) }
}

/// ```
/// use cidre::{cv, cg};
///
Expand Down Expand Up @@ -666,6 +672,7 @@ extern "C-unwind" {
fn CVPixelBufferGetWidthOfPlane(pixel_buffer: &PixelBuf, plane_index: usize) -> usize;
fn CVPixelBufferGetHeightOfPlane(pixel_buffer: &PixelBuf, plane_index: usize) -> usize;
fn CVPixelBufferGetBaseAddressOfPlane(pixel_buffer: &PixelBuf, plane_index: usize) -> *const u8;
fn CVPixelBufferGetBytesPerRowOfPlane(pixel_buffer: &PixelBuf, plane_index: usize) -> usize;

fn CVPixelBufferLockBaseAddress(pixel_buffer: &PixelBuf, lock_flags: LockFlags) -> cv::Return;
fn CVPixelBufferUnlockBaseAddress(pixel_buffer: &PixelBuf, lock_flags: LockFlags)
Expand Down

0 comments on commit 3c22b3e

Please # to comment.