pub trait ColorCorrectionModelTrait: ColorCorrectionModelTraitConst {
Show 16 methods
// Required method
fn as_raw_mut_ColorCorrectionModel(&mut self) -> *mut c_void;
// Provided methods
fn set_color_space(&mut self, cs: COLOR_SPACE) -> Result<()> { ... }
fn set_ccm_type(&mut self, ccm_type: CCM_TYPE) -> Result<()> { ... }
fn set_distance(&mut self, distance: DISTANCE_TYPE) -> Result<()> { ... }
fn set_linear(&mut self, linear_type: LINEAR_TYPE) -> Result<()> { ... }
fn set_linear_gamma(&mut self, gamma: &f64) -> Result<()> { ... }
fn set_linear_degree(&mut self, deg: &i32) -> Result<()> { ... }
fn set_saturated_threshold(
&mut self,
lower: &f64,
upper: &f64,
) -> Result<()> { ... }
fn set_weights_list(
&mut self,
weights_list: &impl MatTraitConst,
) -> Result<()> { ... }
fn set_weight_coeff(&mut self, weights_coeff: &f64) -> Result<()> { ... }
fn set_initial_method(
&mut self,
initial_method_type: INITIAL_METHOD_TYPE,
) -> Result<()> { ... }
fn set_max_count(&mut self, max_count: &i32) -> Result<()> { ... }
fn set_epsilon(&mut self, epsilon: &f64) -> Result<()> { ... }
fn run(&mut self) -> Result<()> { ... }
fn infer(&mut self, img: &impl MatTraitConst, islinear: bool) -> Result<Mat> { ... }
fn infer_def(&mut self, img: &impl MatTraitConst) -> Result<Mat> { ... }
}
Expand description
Mutable methods for crate::mcc::ColorCorrectionModel
Required Methods§
fn as_raw_mut_ColorCorrectionModel(&mut self) -> *mut c_void
Provided Methods§
Sourcefn set_color_space(&mut self, cs: COLOR_SPACE) -> Result<()>
fn set_color_space(&mut self, cs: COLOR_SPACE) -> Result<()>
set ColorSpace
Note: It should be some RGB color space; Supported list of color cards:
- COLOR_SPACE_sRGB
- COLOR_SPACE_AdobeRGB
- COLOR_SPACE_WideGamutRGB
- COLOR_SPACE_ProPhotoRGB
- COLOR_SPACE_DCI_P3_RGB
- COLOR_SPACE_AppleRGB
- COLOR_SPACE_REC_709_RGB
- COLOR_SPACE_REC_2020_RGB
§Parameters
-
cs: the absolute color space that detected colors convert to;
default: [COLOR_SPACE_sRGB]
Sourcefn set_ccm_type(&mut self, ccm_type: CCM_TYPE) -> Result<()>
fn set_ccm_type(&mut self, ccm_type: CCM_TYPE) -> Result<()>
Sourcefn set_distance(&mut self, distance: DISTANCE_TYPE) -> Result<()>
fn set_distance(&mut self, distance: DISTANCE_TYPE) -> Result<()>
Sourcefn set_linear(&mut self, linear_type: LINEAR_TYPE) -> Result<()>
fn set_linear(&mut self, linear_type: LINEAR_TYPE) -> Result<()>
Sourcefn set_linear_gamma(&mut self, gamma: &f64) -> Result<()>
fn set_linear_gamma(&mut self, gamma: &f64) -> Result<()>
set Gamma
Note: only valid when linear is set to “gamma”;
§Parameters
-
gamma: the gamma value of gamma correction;
default: 2.2;
Sourcefn set_linear_degree(&mut self, deg: &i32) -> Result<()>
fn set_linear_degree(&mut self, deg: &i32) -> Result<()>
set degree
Note: only valid when linear is set to
- LINEARIZATION_COLORPOLYFIT
- LINEARIZATION_GRAYPOLYFIT
- LINEARIZATION_COLORLOGPOLYFIT
- LINEARIZATION_GRAYLOGPOLYFIT
§Parameters
-
deg: the degree of linearization polynomial;
default: 3
Sourcefn set_saturated_threshold(&mut self, lower: &f64, upper: &f64) -> Result<()>
fn set_saturated_threshold(&mut self, lower: &f64, upper: &f64) -> Result<()>
set SaturatedThreshold. The colors in the closed interval [lower, upper] are reserved to participate in the calculation of the loss function and initialization parameters
§Parameters
-
lower: the lower threshold to determine saturation;
default: 0;
-
upper: the upper threshold to determine saturation;
default: 0
Sourcefn set_weights_list(&mut self, weights_list: &impl MatTraitConst) -> Result<()>
fn set_weights_list(&mut self, weights_list: &impl MatTraitConst) -> Result<()>
Sourcefn set_weight_coeff(&mut self, weights_coeff: &f64) -> Result<()>
fn set_weight_coeff(&mut self, weights_coeff: &f64) -> Result<()>
set WeightCoeff
§Parameters
-
weights_coeff: the exponent number of L* component of the reference color in CIE Lab color space;
default: 0
Sourcefn set_initial_method(
&mut self,
initial_method_type: INITIAL_METHOD_TYPE,
) -> Result<()>
fn set_initial_method( &mut self, initial_method_type: INITIAL_METHOD_TYPE, ) -> Result<()>
set InitialMethod
§Parameters
-
initial_method_type: the method of calculating CCM initial value;
default: INITIAL_METHOD_LEAST_SQUARE
Sourcefn set_max_count(&mut self, max_count: &i32) -> Result<()>
fn set_max_count(&mut self, max_count: &i32) -> Result<()>
set MaxCount
§Parameters
-
max_count: used in MinProblemSolver-DownhillSolver;
Terminal criteria to the algorithm;
default: 5000;
Sourcefn set_epsilon(&mut self, epsilon: &f64) -> Result<()>
fn set_epsilon(&mut self, epsilon: &f64) -> Result<()>
set Epsilon
§Parameters
-
epsilon: used in MinProblemSolver-DownhillSolver;
Terminal criteria to the algorithm;
default: 1e-4;
Sourcefn infer_def(&mut self, img: &impl MatTraitConst) -> Result<Mat>
fn infer_def(&mut self, img: &impl MatTraitConst) -> Result<Mat>
Infer using fitting ccm.
§Parameters
- img: the input image.
- islinear: default false.
§Returns
the output array.
§Note
This alternative version of ColorCorrectionModelTrait::infer function uses the following default values for its arguments:
- islinear: false
Dyn Compatibility§
This trait is not dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety", so this trait is not object safe.