MCPcopy Create free account
hub / github.com/RustCV/RustCV / copy_packed_data

Method copy_packed_data

rustcv-backend-msmf/src/stream.rs:367–391  ·  view source on GitHub ↗

Copies packed format data

(
        &mut self,
        scanline0: *mut u8,
        pitch: i32,
        src_pitch: usize,
        row_bytes: usize,
    )

Source from the content-addressed store, hash-verified

365
366 /// Copies packed format data
367 unsafe fn copy_packed_data(
368 &mut self,
369 scanline0: *mut u8,
370 pitch: i32,
371 src_pitch: usize,
372 row_bytes: usize,
373 ) -> Result<()> {
374 let height = self.height as usize;
375
376 if src_pitch == row_bytes {
377 std::ptr::copy_nonoverlapping(
378 scanline0,
379 self.linear_buffer.as_mut_ptr(),
380 row_bytes * height,
381 );
382 } else {
383 let src = self.get_src_ptr(scanline0, pitch, src_pitch, height);
384
385 for row in 0..height {
386 self.copy_row(src, row, src_pitch, row_bytes, 0);
387 }
388 }
389
390 Ok(())
391 }
392
393 /// Gets the source pointer, handling negative pitch (bottom-up images).
394 #[inline]

Callers 1

copy_from_2d_bufferMethod · 0.80

Calls 2

get_src_ptrMethod · 0.80
copy_rowMethod · 0.80

Tested by

no test coverage detected