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

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

add manual Point_