opencv-rs-core 0.1.0

Runtime-agnostic domain types and ports for opencv-rs (no FFI dependency)
Documentation
  • Coverage
  • 100%
    119 out of 119 items documented0 out of 63 items with examples
  • Size
  • Source code size: 47.44 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 7.79 MB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 1m 3s Average build duration of successful builds.
  • all releases: 53s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • GoCleverOrg/opencv-rs
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • vasco

opencv-rs-core

Runtime-agnostic ports and DTOs for the opencv-rs workspace.

This crate defines the trait-level contract that every production and test implementation must satisfy. It is the layer downstream consumers and test harnesses depend on.

Zero FFI

opencv-rs-core has no dependency on the opencv crate and contains no unsafe blocks (#![forbid(unsafe_code)]). Consumers that depend only on this crate compile and test without OpenCV installed on the host.

Ports

Port Role
MatView Read-only view over a pixel buffer (width, height, channels, pixel_format, data). OwnedMatView is the pure-Rust owned variant.
VideoCapturePort Opens a video source and returns a VideoStream.
VideoStream Pull API yielding CapturedFrames.
ImageEncoderPort Encodes a MatView into a chosen EncodingKind (JPEG, WebP, raw).
ImageOpsPort OpenCV-equivalent image primitives: cvt_color, gaussian_blur, threshold, absdiff, convert_scale_abs, min_max_loc, count_non_zero, resize.

DTOs: CapturedFrame, PixelFormat, Backend, EncodingKind, ColorConversion, ThresholdKind, MinMaxResult, plus the error types OpenCvError, VideoCaptureError, ImageEncodingError, ImageOpsError.

PureRustImageOps is a pure-Rust reimplementation of the element-wise and reduction methods of ImageOpsPort. Every method it implements is covered by a byte-equivalence test against OpenCvImageOps in opencv-rs-ffi/tests/equivalence/.

contract_tests module

The public contract_tests module exposes reusable test helpers — one per trait method — that assert the behavioural contract of any implementation. Both opencv-rs-fake and opencv-rs-ffi exercise these helpers against their adapters, and downstream crates with their own implementations can re-verify the contract via a plain cargo test.

End users typically depend on the opencv-rs facade rather than this crate directly.

License

MIT OR Apache-2.0.