Implement DataType for rgb types to allow working with colors easier
Implement DataType for types from rgb crate
MODIFY
Cargo.toml
Cargo.toml
@@ -56,6 +56,7 @@ name = "window"
libc = "0.2"
num-traits = "0.2"
once_cell = "1.0"
+rgb = { version = "0.8.27", features = ["argb"], optional = true }
[features]
clang-runtime = ["clang/runtime"]

MODIFY
src/manual/core/data_type.rs
src/manual/core/data_type.rs
@@ -48,6 +48,27 @@ data_type!(i32, core::CV_32S, 1);
data_type!(f32, core::CV_32F, 1);
data_type!(f64, core::CV_64F, 1);
+#[cfg(feature = "rgb")]
+use rgb::*;
+#[cfg(feature = "rgb")]
+use rgb::alt::*;
+#[cfg(feature = "rgb")]
+data_type!(GRAY8, core::CV_8U, 1);
+#[cfg(feature = "rgb")]
+data_type!(GRAYA8, core::CV_8U, 2);
+#[cfg(feature = "rgb")]
+data_type!(RGB8, core::CV_8U, 3);
+#[cfg(feature = "rgb")]
+data_type!(BGR8, core::CV_8U, 3);
+#[cfg(feature = "rgb")]
+data_type!(RGBA8, core::CV_8U, 4);
+#[cfg(feature = "rgb")]
+data_type!(ARGB8, core::CV_8U, 4);
+#[cfg(feature = "rgb")]
+data_type!(BGRA8, core::CV_8U, 4);
+#[cfg(feature = "rgb")]
+data_type!(ABGR8, core::CV_8U, 4);
+
impl<T: DataType, const N: usize> DataType for VecN<T, N> {
#[inline]
fn depth() -> i32 { T::depth() }

Implement DataType for rgb types to allow working with colors easier (#296)

Implement DataType for types from rgb crate