{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "title": "Lumiscan Cockpit Configuration",
  "description": "Configuration schema for Lumiscan Cockpit overlay settings",
  "type": "object",
  "required": ["overlay"],
  "properties": {
    "overlay": {
      "type": "object",
      "description": "Overlay settings for image annotations",
      "additionalItems": false,
      "patternProperties": {
        "[lumiscan\\-cam\\-driver|lumiscan\\-ai\\-object\\-matching|\\*]\\/.*": {
          "type": "array",
          "description": "Array of overlay elements to be drawn on the image. The name of this should follow the format appName/imageName it is possible to use a * as a wildcard for either part",
          "items": {
            "type": "object",
            "title": "OverlayElement",
            "description": "A single overlay element (shape) to draw on the image",
            "required": ["color", "shape", "centerX", "centerY", "width", "height"],
            "properties": {
              "color": {
                "type": "string",
                "description": "Color of the overlay element. Can be a named color (red, green, blue, black, white, yellow, cyan, magenta) or hex format (#RRGGBB or RRGGBB)",
                "pattern": "^(red|green|blue|black|white|yellow|cyan|magenta|#?[0-9A-Fa-f]{6})$"
              },
              "shape": {
                "type": "string",
                "description": "Shape type of the overlay element",
                "enum": ["rectangle", "circle", "cross"]
              },
              "centerX": {
                "type": "number",
                "description": "X-coordinate of the shape center. Values < 1.0 are relative to image width (0.0-1.0), values >= 1.0 are absolute pixel coordinates"
              },
              "centerY": {
                "type": "number",
                "description": "Y-coordinate of the shape center. Values < 1.0 are relative to image height (0.0-1.0), values >= 1.0 are absolute pixel coordinates"
              },
              "width": {
                "type": "number",
                "description": "Width of the shape. Values < 1.0 are relative to image width (0.0-1.0), values >= 1.0 are absolute pixel values. For circles, this is the diameter"
              },
              "height": {
                "type": "number",
                "description": "Height of the shape. Values < 1.0 are relative to image height (0.0-1.0), values >= 1.0 are absolute pixel values"
              }
            },
            "additionalProperties": false
          }
        }
      },
      "additionalProperties": false
    }
  }
}
