pub trait CustomRecognition: Send + Sync {
// Required method
fn analyze(
&self,
context: &Context,
task_id: MaaId,
node_name: &str,
custom_recognition_name: &str,
custom_recognition_param: &str,
image: &MaaImageBuffer,
roi: &Rect,
) -> Option<(Rect, String)>;
}Expand description
Trait for implementing custom recognizers.
Recognizers analyze screenshots to find targets in the UI.
Required Methods§
Sourcefn analyze(
&self,
context: &Context,
task_id: MaaId,
node_name: &str,
custom_recognition_name: &str,
custom_recognition_param: &str,
image: &MaaImageBuffer,
roi: &Rect,
) -> Option<(Rect, String)>
fn analyze( &self, context: &Context, task_id: MaaId, node_name: &str, custom_recognition_name: &str, custom_recognition_param: &str, image: &MaaImageBuffer, roi: &Rect, ) -> Option<(Rect, String)>
Analyze an image to find the target.
§Arguments
context- The current execution contexttask_id- ID of the current tasknode_name- Name of the current nodecustom_recognition_name- Name of this recognizercustom_recognition_param- JSON parameters for this recognizerimage- The image to analyzeroi- Region of Interest to restrict analysis
§Returns
Some((rect, detail)) if target found, None otherwise
Dyn Compatibility§
This trait is dyn compatible.
In older versions of Rust, dyn compatibility was called "object safety".