mightstone.services.cardconjurer.models.Image

pydantic model mightstone.services.cardconjurer.models.Image

A layer composed of an image (One of the 3 possible layer types)

Show JSON schema
{
   "title": "Image",
   "description": "A layer composed of an image (One of the 3 possible layer types)",
   "type": "object",
   "properties": {
      "type": {
         "const": "image",
         "enum": [
            "image"
         ],
         "title": "Type",
         "type": "string"
      },
      "name": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Name"
      },
      "tags": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Tags"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Tags"
      },
      "src": {
         "title": "Src",
         "type": "string"
      },
      "x": {
         "default": 0,
         "title": "X",
         "type": "integer"
      },
      "y": {
         "default": 0,
         "title": "Y",
         "type": "integer"
      },
      "z": {
         "default": 0,
         "title": "Z",
         "type": "integer"
      },
      "width": {
         "default": 100,
         "title": "Width",
         "type": "integer"
      },
      "height": {
         "default": 100,
         "title": "Height",
         "type": "integer"
      },
      "thumb": {
         "anyOf": [
            {
               "type": "string"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Thumb"
      },
      "bounds": {
         "anyOf": [
            {
               "$ref": "#/$defs/Bound"
            },
            {
               "type": "null"
            }
         ],
         "default": null
      },
      "masks": {
         "anyOf": [
            {
               "items": {
                  "$ref": "#/$defs/Mask"
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Masks"
      },
      "opacity": {
         "anyOf": [
            {
               "type": "number"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Opacity"
      },
      "filters": {
         "anyOf": [
            {
               "items": {
                  "discriminator": {
                     "mapping": {
                        "colorOverlay": "#/$defs/FilterOverlay",
                        "shadow": "#/$defs/FilterShadow"
                     },
                     "propertyName": "type"
                  },
                  "oneOf": [
                     {
                        "$ref": "#/$defs/FilterShadow"
                     },
                     {
                        "$ref": "#/$defs/FilterOverlay"
                     }
                  ]
               },
               "type": "array"
            },
            {
               "type": "null"
            }
         ],
         "default": null,
         "title": "Filters"
      }
   },
   "$defs": {
      "Bound": {
         "properties": {
            "x": {
               "title": "X",
               "type": "integer"
            },
            "y": {
               "title": "Y",
               "type": "integer"
            },
            "width": {
               "title": "Width",
               "type": "integer"
            },
            "height": {
               "title": "Height",
               "type": "integer"
            },
            "type": {
               "$ref": "#/$defs/BoundType"
            },
            "horizontal": {
               "$ref": "#/$defs/HorizontalAlign"
            },
            "vertical": {
               "$ref": "#/$defs/VerticalAlign"
            }
         },
         "required": [
            "x",
            "y",
            "width",
            "height",
            "type",
            "horizontal",
            "vertical"
         ],
         "title": "Bound",
         "type": "object"
      },
      "BoundType": {
         "enum": [
            "fit",
            "fill"
         ],
         "title": "BoundType",
         "type": "string"
      },
      "FilterOverlay": {
         "properties": {
            "type": {
               "const": "colorOverlay",
               "enum": [
                  "colorOverlay"
               ],
               "title": "Type",
               "type": "string"
            },
            "color": {
               "format": "color",
               "title": "Color",
               "type": "string"
            }
         },
         "required": [
            "type",
            "color"
         ],
         "title": "FilterOverlay",
         "type": "object"
      },
      "FilterShadow": {
         "properties": {
            "type": {
               "const": "shadow",
               "enum": [
                  "shadow"
               ],
               "title": "Type",
               "type": "string"
            },
            "color": {
               "default": "black",
               "format": "color",
               "title": "Color",
               "type": "string"
            },
            "x": {
               "title": "X",
               "type": "integer"
            },
            "y": {
               "title": "Y",
               "type": "integer"
            }
         },
         "required": [
            "type",
            "x",
            "y"
         ],
         "title": "FilterShadow",
         "type": "object"
      },
      "HorizontalAlign": {
         "enum": [
            "left",
            "right",
            "center"
         ],
         "title": "HorizontalAlign",
         "type": "string"
      },
      "Mask": {
         "properties": {
            "type": {
               "const": "image",
               "enum": [
                  "image"
               ],
               "title": "Type",
               "type": "string"
            },
            "name": {
               "title": "Name",
               "type": "string"
            },
            "src": {
               "title": "Src",
               "type": "string"
            }
         },
         "required": [
            "type",
            "name",
            "src"
         ],
         "title": "Mask",
         "type": "object"
      },
      "Tags": {
         "description": "Another important note is that many text and image layers have the tags \"editable\",\nand there are two groups tagged \"new-image-group\" and \"new-text-group\". These tags\ntell the UI which layers should be presented as editable, and which layer groups\nshould store newly-added layers.",
         "enum": [
            "editable",
            "draggable",
            "new-image-group",
            "new-text-group",
            "name"
         ],
         "title": "Tags",
         "type": "string"
      },
      "VerticalAlign": {
         "enum": [
            "top",
            "center",
            "bottom"
         ],
         "title": "VerticalAlign",
         "type": "string"
      }
   },
   "required": [
      "type",
      "src"
   ]
}

Fields:
field bounds: Bound | None = None
field filters: List[FilterShadow | FilterOverlay] | None = None
field height: int = 100
field masks: List[Mask] | None = None
field opacity: float | None = None
field src: str [Required]
field thumb: str | None = None
field type: Literal[LayerTypes.IMAGE] [Required]
field width: int = 100
field x: int = 0
field y: int = 0
field z: int = 0