{
	"$id": "https://dl.nicolasjullien.fr/configuration.fractalgen.schema.json",
	"$schema": "http://json-schema.org/draft-07/schema#",
	"title": "Configuration",
	"type": "object",
	"properties": {
		"image": {
			"type": "object",
			"description": "Properties of the generated image.",
			"properties": {
				"width": {
					"type": "integer",
					"description": "Width in pixels of the generated image.",
					"minimum": 1
				},
				"height": {
					"type": "integer",
					"description": "Height in pixels of the generated image.",
					"minimum": 1
				},
				"format": {
					"type": "string",
					"description": "Image file format of the generated image.",
					"enum": [
						"bmp"
					],
					"default": "bmp"
				},
				"filename": {
					"type": "string",
					"description": "Path to the image file to write.",
					"default": "output.bmp",
					"minLength": 1
				}
			},
			"required": [
				"width",
				"height"
			]
		},
		"generator": {
			"type": "object",
			"description": "Properties of the generator.",
			"properties": {
				"name": {
					"type": "string",
					"description": "Name of the generator to use",
					"enum": [
						"Julia",
						"Mandelbrot"
					]
				},
				"threads": {
					"type": "integer",
					"description": "The number of threads to use to generate the fractal.",
					"default": 4,
					"minimum": 1
				},
				"tile_size": {
					"type": "integer",
					"description": "When rendering, the image is divided in squre tiles which are dispatched to the rendering threads. This property describes the size of this tile.",
					"default": 128,
					"minimum": 16
				},
				"center": {
					"type": "object",
					"description": "Complex center position of the image.",
					"properties": {
						"r": {
							"type": "number",
							"description": "Real component of the center position."
						},
						"i": {
							"type": "number",
							"description": "Imaginary component of the center position."
						}
					}
				},
				"zoom": {
					"type": "object",
					"description": "Zoom of the image.",
					"properties": {
						"x": {
							"type": "number",
							"description": "X component of the zoom."
						},
						"y": {
							"type": "number",
							"description": "Y component of the zoom."
						}
					}
				},
				"max_iterations": {
					"type": "integer",
					"description": "The maximum amount of iterations to perform on each pixel.",
					"minimum": 0
				},
				"params": {
					"type": "object",
					"description": "Parameters for the generator",
					"properties": {
						"c": {
							"type": "object",
							"description": "Complex number to add at each iteration for Julia sets.",
							"properties": {
								"r": {
									"type": "number",
									"description": "Real component of the complex number."
								},
								"i": {
									"type": "number",
									"description": "Imaginary component of the complex number."
								}
							}
						}
					}
				}
			},
			"required": [
				"name",
				"center",
				"zoom",
				"max_iterations"
			]
		},
		"colorizer": {
			"type": "object",
			"description": "Properties of the colorizer.",
			"properties": {
				"name": {
					"type": "string",
					"description": "Name of the colorizer to use.",
					"enum": [
						"BlackAndWhite",
						"Ocean",
						"Spectrum",
						"TwoColors"
					]
				},
				"params": {
					"type": "object",
					"description": "Parameters for the colorizer."
				}
			},
			"required": [
				"name"
			]
		},
		"postprocess": {
			"type": "object",
			"description": "Post-processing effects",
			"properties": {
				"enabled": {
					"type": "boolean",
					"description": "Enables the post-processing effects.",
					"default": true
				},
				"effects": {
					"type": "array",
					"description": "Post-processing effects chain."
				}
			}
		}
	},
	"required": [
		"image",
		"generator",
		"colorizer"
	]
}