Skip to main content

CustomRecognition

Trait CustomRecognition 

Source
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§

Source

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 context
  • task_id - ID of the current task
  • node_name - Name of the current node
  • custom_recognition_name - Name of this recognizer
  • custom_recognition_param - JSON parameters for this recognizer
  • image - The image to analyze
  • roi - Region of Interest to restrict analysis
§Returns

Some((rect, detail)) if target found, None otherwise

Implementors§