Skip to content

Commit

Permalink
Update docs and changelog
Browse files Browse the repository at this point in the history
  • Loading branch information
twistedfall committed Apr 14, 2024
1 parent 674365e commit ccf156c
Show file tree
Hide file tree
Showing 20 changed files with 2,902 additions and 80 deletions.
6 changes: 6 additions & 0 deletions CHANGES.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
* 0.90.0
* Automatically generate default constructors for classes where posssible.
* Backwards-incompatible changes:
* `LayerParams::default()` can no longer fail, so it returns `Self` without `Result`.
* `GpuMat::default()` is now `GpuMat::new_def()`

* 0.89.0
* All functions accepting classes now take `impl ClassTrait` instead of `Class` directly. This allows passing other objects
that implement the same trait. This change should be backwards compatible.
Expand Down
14 changes: 14 additions & 0 deletions docs/bgsegm.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1114,6 +1114,12 @@ pub mod bgsegm {
boxed_ref! { BackgroundSubtractorLSBPDesc, crate::bgsegm::BackgroundSubtractorLSBPDescTraitConst, as_raw_BackgroundSubtractorLSBPDesc, crate::bgsegm::BackgroundSubtractorLSBPDescTrait, as_raw_mut_BackgroundSubtractorLSBPDesc }

impl BackgroundSubtractorLSBPDesc {
/// Creates a default instance of the class by calling the default constructor
#[inline]
fn default() -> Self {
unsafe { Self::from_raw(sys::cv_bgsegm_BackgroundSubtractorLSBPDesc_defaultNew_const()) }
}

#[inline]
pub fn calc_local_svd_values(local_svd_values: &mut impl ToOutputArray, frame: &impl core::MatTraitConst) -> Result<()> {
output_array_arg!(local_svd_values);
Expand Down Expand Up @@ -1154,6 +1160,14 @@ pub mod bgsegm {
}
}

impl Default for BackgroundSubtractorLSBPDesc {
#[inline]
/// Forwards to infallible Self::default()
fn default() -> Self {
Self::default()
}
}

/// Constant methods for [crate::bgsegm::BackgroundSubtractorMOG]
pub trait BackgroundSubtractorMOGTraitConst: crate::video::BackgroundSubtractorTraitConst {
fn as_raw_BackgroundSubtractorMOG(&self) -> *const c_void;
Expand Down
2 changes: 2 additions & 0 deletions docs/bioinspired.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1088,6 +1088,8 @@ pub mod bioinspired {
boxed_ref! { RetinaParameters, crate::bioinspired::RetinaParametersTraitConst, as_raw_RetinaParameters, crate::bioinspired::RetinaParametersTrait, as_raw_mut_RetinaParameters }

impl RetinaParameters {
/// Creates a default instance of the class by calling the default constructor
#[inline]
fn default() -> Self {
unsafe { Self::from_raw(sys::cv_bioinspired_RetinaParameters_defaultNew_const()) }
}
Expand Down
4 changes: 2 additions & 2 deletions docs/ccalib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1243,7 +1243,7 @@ pub mod ccalib {
}

#[inline]
fn set_transform(&mut self, val: impl core::MatTraitConst) {
fn set_transform(&mut self, val: core::Mat) {
let ret = unsafe { sys::cv_multicalib_MultiCameraCalibration_edge_propTransform_const_Mat(self.as_raw_mut_MultiCameraCalibration_edge(), val.as_raw_Mat()) };
ret
}
Expand Down Expand Up @@ -1324,7 +1324,7 @@ pub mod ccalib {
fn as_raw_mut_MultiCameraCalibration_vertex(&mut self) -> *mut c_void;

#[inline]
fn set_pose(&mut self, val: impl core::MatTraitConst) {
fn set_pose(&mut self, val: core::Mat) {
let ret = unsafe { sys::cv_multicalib_MultiCameraCalibration_vertex_propPose_const_Mat(self.as_raw_mut_MultiCameraCalibration_vertex(), val.as_raw_Mat()) };
ret
}
Expand Down
94 changes: 83 additions & 11 deletions docs/core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -15068,6 +15068,12 @@ pub mod core {

impl Hamming {
pub const normType: u32 = 6;
/// Creates a default instance of the class by calling the default constructor
#[inline]
fn default() -> Self {
unsafe { Self::from_raw(sys::cv_Hamming_defaultNew_const()) }
}

}

impl std::fmt::Debug for Hamming {
Expand All @@ -15078,6 +15084,14 @@ pub mod core {
}
}

impl Default for Hamming {
#[inline]
/// Forwards to infallible Self::default()
fn default() -> Self {
Self::default()
}
}

/// Constant methods for [core::KeyPoint]
pub trait KeyPointTraitConst {
fn as_raw_KeyPoint(&self) -> *const c_void;
Expand Down Expand Up @@ -17358,7 +17372,7 @@ pub mod core {
}

#[inline]
fn set_size(&mut self, val: impl core::MatSizeTraitConst) {
fn set_size(&mut self, val: core::MatSize) {
let ret = unsafe { sys::cv_Mat_propSize_const_MatSize(self.as_raw_mut_Mat(), val.as_raw_MatSize()) };
ret
}
Expand Down Expand Up @@ -20317,19 +20331,19 @@ pub mod core {
}

#[inline]
fn set_a(&mut self, val: impl core::MatTraitConst) {
fn set_a(&mut self, val: core::Mat) {
let ret = unsafe { sys::cv_MatExpr_propA_const_Mat(self.as_raw_mut_MatExpr(), val.as_raw_Mat()) };
ret
}

#[inline]
fn set_b(&mut self, val: impl core::MatTraitConst) {
fn set_b(&mut self, val: core::Mat) {
let ret = unsafe { sys::cv_MatExpr_propB_const_Mat(self.as_raw_mut_MatExpr(), val.as_raw_Mat()) };
ret
}

#[inline]
fn set_c(&mut self, val: impl core::MatTraitConst) {
fn set_c(&mut self, val: core::Mat) {
let ret = unsafe { sys::cv_MatExpr_propC_const_Mat(self.as_raw_mut_MatExpr(), val.as_raw_Mat()) };
ret
}
Expand Down Expand Up @@ -22070,21 +22084,21 @@ pub mod core {

/// eigenvectors of the covariation matrix
#[inline]
fn set_eigenvectors(&mut self, val: impl core::MatTraitConst) {
fn set_eigenvectors(&mut self, val: core::Mat) {
let ret = unsafe { sys::cv_PCA_propEigenvectors_const_Mat(self.as_raw_mut_PCA(), val.as_raw_Mat()) };
ret
}

/// eigenvalues of the covariation matrix
#[inline]
fn set_eigenvalues(&mut self, val: impl core::MatTraitConst) {
fn set_eigenvalues(&mut self, val: core::Mat) {
let ret = unsafe { sys::cv_PCA_propEigenvalues_const_Mat(self.as_raw_mut_PCA(), val.as_raw_Mat()) };
ret
}

/// mean value subtracted before the projection and added after the back projection
#[inline]
fn set_mean(&mut self, val: impl core::MatTraitConst) {
fn set_mean(&mut self, val: core::Mat) {
let ret = unsafe { sys::cv_PCA_propMean_const_Mat(self.as_raw_mut_PCA(), val.as_raw_Mat()) };
ret
}
Expand Down Expand Up @@ -23468,19 +23482,19 @@ pub mod core {
fn as_raw_mut_SVD(&mut self) -> *mut c_void;

#[inline]
fn set_u(&mut self, val: impl core::MatTraitConst) {
fn set_u(&mut self, val: core::Mat) {
let ret = unsafe { sys::cv_SVD_propU_const_Mat(self.as_raw_mut_SVD(), val.as_raw_Mat()) };
ret
}

#[inline]
fn set_w(&mut self, val: impl core::MatTraitConst) {
fn set_w(&mut self, val: core::Mat) {
let ret = unsafe { sys::cv_SVD_propW_const_Mat(self.as_raw_mut_SVD(), val.as_raw_Mat()) };
ret
}

#[inline]
fn set_vt(&mut self, val: impl core::MatTraitConst) {
fn set_vt(&mut self, val: core::Mat) {
let ret = unsafe { sys::cv_SVD_propVt_const_Mat(self.as_raw_mut_SVD(), val.as_raw_Mat()) };
ret
}
Expand Down Expand Up @@ -24920,6 +24934,12 @@ pub mod core {
boxed_ref! { SparseMat_Node, core::SparseMat_NodeTraitConst, as_raw_SparseMat_Node, core::SparseMat_NodeTrait, as_raw_mut_SparseMat_Node }

impl SparseMat_Node {
/// Creates a default instance of the class by calling the default constructor
#[inline]
fn default() -> Self {
unsafe { Self::from_raw(sys::cv_SparseMat_Node_defaultNew_const()) }
}

}

impl std::fmt::Debug for SparseMat_Node {
Expand All @@ -24933,6 +24953,14 @@ pub mod core {
}
}

impl Default for SparseMat_Node {
#[inline]
/// Forwards to infallible Self::default()
fn default() -> Self {
Self::default()
}
}

/// Constant methods for [core::SparseMatConstIterator]
pub trait SparseMatConstIteratorTraitConst {
fn as_raw_SparseMatConstIterator(&self) -> *const c_void;
Expand Down Expand Up @@ -26119,7 +26147,7 @@ pub mod core {

/// dimensional size of the matrix; accessible in various formats
#[inline]
fn set_size(&mut self, val: impl core::MatSizeTraitConst) {
fn set_size(&mut self, val: core::MatSize) {
let ret = unsafe { sys::cv_UMat_propSize_const_MatSize(self.as_raw_mut_UMat(), val.as_raw_MatSize()) };
ret
}
Expand Down Expand Up @@ -32857,6 +32885,12 @@ pub mod core {
boxed_ref! { TargetArchs, core::TargetArchsTraitConst, as_raw_TargetArchs, core::TargetArchsTrait, as_raw_mut_TargetArchs }

impl TargetArchs {
/// Creates a default instance of the class by calling the default constructor
#[inline]
fn default() -> Self {
unsafe { Self::from_raw(sys::cv_cuda_TargetArchs_defaultNew_const()) }
}

/// The following method checks whether the module was built with the support of the given feature:
///
/// ## Parameters
Expand Down Expand Up @@ -32949,6 +32983,14 @@ pub mod core {
}
}

impl Default for TargetArchs {
#[inline]
/// Forwards to infallible Self::default()
fn default() -> Self {
Self::default()
}
}

/// Constant methods for [core::Detail_CheckContext]
pub trait Detail_CheckContextTraitConst {
fn as_raw_Detail_CheckContext(&self) -> *const c_void;
Expand Down Expand Up @@ -33048,6 +33090,8 @@ pub mod core {
boxed_ref! { Detail_CheckContext, core::Detail_CheckContextTraitConst, as_raw_Detail_CheckContext, core::Detail_CheckContextTrait, as_raw_mut_Detail_CheckContext }

impl Detail_CheckContext {
/// Creates a default instance of the class by calling the default constructor
#[inline]
fn default() -> Self {
unsafe { Self::from_raw(sys::cv_detail_CheckContext_defaultNew_const()) }
}
Expand Down Expand Up @@ -33750,6 +33794,12 @@ pub mod core {
boxed_ref! { Context_UserContext, core::Context_UserContextTraitConst, as_raw_Context_UserContext, core::Context_UserContextTrait, as_raw_mut_Context_UserContext }

impl Context_UserContext {
/// Creates a default instance of the class by calling the default constructor
#[inline]
fn default() -> Self {
unsafe { Self::from_raw(sys::cv_ocl_Context_UserContext_defaultNew_const()) }
}

}

impl std::fmt::Debug for Context_UserContext {
Expand All @@ -33760,6 +33810,14 @@ pub mod core {
}
}

impl Default for Context_UserContext {
#[inline]
/// Forwards to infallible Self::default()
fn default() -> Self {
Self::default()
}
}

/// Constant methods for [core::Device]
pub trait DeviceTraitConst {
fn as_raw_Device(&self) -> *const c_void;
Expand Down Expand Up @@ -38536,6 +38594,12 @@ pub mod core {
boxed_ref! { FunctionParams, core::FunctionParamsTraitConst, as_raw_FunctionParams, core::FunctionParamsTrait, as_raw_mut_FunctionParams }

impl FunctionParams {
/// Creates a default instance of the class by calling the default constructor
#[inline]
fn default() -> Self {
unsafe { Self::from_raw(sys::cv_utils_FunctionParams_defaultNew_const()) }
}

}

impl std::fmt::Debug for FunctionParams {
Expand All @@ -38548,6 +38612,14 @@ pub mod core {
}
}

impl Default for FunctionParams {
#[inline]
/// Forwards to infallible Self::default()
fn default() -> Self {
Self::default()
}
}

/// Constant methods for [core::LogTag]
pub trait LogTagTraitConst {
fn as_raw_LogTag(&self) -> *const c_void;
Expand Down

0 comments on commit ccf156c

Please sign in to comment.