diff --git a/cidre/src/cv/buffer.rs b/cidre/src/cv/buffer.rs index 87585437..c190145c 100644 --- a/cidre/src/cv/buffer.rs +++ b/cidre/src/cv/buffer.rs @@ -13,12 +13,6 @@ define_cf_type!( Buf(cf::Type) ); -impl Drop for Buf { - fn drop(&mut self) { - unsafe { CVBufferRelease(self) } - } -} - impl Buf { #[inline] pub fn attach<'a>( @@ -33,7 +27,7 @@ impl Buf { pub fn set_attach(&mut self, key: &cf::String, val: &cf::Type, attachment_mode: AttachMode) { unsafe { CVBufferSetAttachment(self, key, val, attachment_mode) } } - + #[inline] pub fn remove_attach(&mut self, key: &cf::String) { unsafe { CVBufferRemoveAttachment(self, key) } @@ -131,7 +125,6 @@ extern "C-unwind" { value: &cf::Type, attachment_mode: AttachMode, ); - pub fn CVBufferRelease(buffer: &mut Buf); fn CVBufferRemoveAttachment(buffer: &mut Buf, key: &cf::String); fn CVBufferRemoveAllAttachments(buffer: &mut Buf); fn CVBufferSetAttachments( diff --git a/cidre/src/cv/pixel_buffer.rs b/cidre/src/cv/pixel_buffer.rs index e5ef200e..811f844d 100644 --- a/cidre/src/cv/pixel_buffer.rs +++ b/cidre/src/cv/pixel_buffer.rs @@ -8,7 +8,7 @@ use crate::io; pub type PixelBuf = cv::ImageBuf; pub type ReleaseCallback = - extern "C" fn(releaseRefCon: *mut c_void, baseAddress: *const *const c_void); + extern "C" fn(release_ref_con: *mut c_void, base_address: *const *const c_void); impl PixelBuf { #[inline] @@ -87,7 +87,8 @@ impl PixelBuf { unsafe { r.to_result_unchecked(pixel_buffer_out) } } - pub fn new_with_bytes( + #[doc(alias = "CVPixelBufferCreateWithBytes")] + pub fn with_bytes( width: usize, height: usize, base_address: *mut c_void, @@ -99,7 +100,7 @@ impl PixelBuf { ) -> Result, cv::Return> { let mut pixel_buf_out = None; - let r = Self::create_with_bytes( + let r = Self::create_with_bytes_in( width, height, pixel_format_type, @@ -134,7 +135,8 @@ impl PixelBuf { } } - pub fn create_with_bytes( + #[doc(alias = "CVPixelBufferCreateWithBytes")] + pub fn create_with_bytes_in( width: usize, height: usize, pixel_format_type: cv::PixelFormat,