add manual Size_
MODIFY
src/hub/manual/core.rs
src/hub/manual/core.rs
pub use self::mat::*;
pub use self::point::*;
pub use self::rect::*;
+pub use self::size::*;
macro_rules! valid_types {
($trait: ident, $($rust_type: ty),+) => {
@@ -16,3 +17,4 @@ macro_rules! valid_types {
mod mat;
mod point;
mod rect;
+mod size;

ADD
src/hub/manual/core/size.rs
+valid_types!(ValidSizeType, i32, i64, f32, f64);
+
+#[repr(C)]
+#[derive(Copy, Clone, Debug, PartialEq)]
+pub struct Size_<T: ValidSizeType> {
+ pub width: T,
+ pub height: T,
+}
+
+impl<T: ValidSizeType> Size_<T> {
+ pub fn new(width: T, height: T) -> Self {
+ Self { width, height }
+ }
+}
+
+impl<T: ValidSizeType + Default> Default for Size_<T> {
+ fn default() -> Self {
+ Self { width: Default::default(), height: Default::default() }
+ }
+}

add manual Size_