Add a Qt widget providing a canvas for painting quantized/categorical values into an underlying Array.
Concept
The canvas behaves like a standard brush-based painting widget, but instead of painting continuous values, it paints values associated with a predefined set of labels.
The label mapping is provided as an input, for example:
0 → Sea
1 → Mountain
2 → Forest
...
Each label has:
- a base value (
v)
- a display label
- a color
UI
In addition to the standard brush canvas, the widget provides a set of exclusive toggle buttons, one for each defined label:
[ Sea ] [ Mountain ] [ Forest ]
Selecting a label activates it as the current brush value and updates the brush color to the label's color.
Only one label can be selected at a time.
Painting behavior
When a label with base value v is selected, painting with the brush writes values in the range:
This ensures that each painted pixel belongs to the selected category while still allowing the underlying array to store floating-point values.
For example:
Sea → [0, 1[
Mountain → [1, 2[
Forest → [2, 3[
Colors
Each label defines a color used to visually represent that category on the canvas.
The active brush should use the selected label's color, providing immediate visual feedback about which category will be painted.
Input
The widget should take a label/value mapping as input, conceptually:
The exact API can be designed to integrate with the existing Array and Qt widget infrastructure.
Add a Qt widget providing a canvas for painting quantized/categorical values into an underlying
Array.Concept
The canvas behaves like a standard brush-based painting widget, but instead of painting continuous values, it paints values associated with a predefined set of labels.
The label mapping is provided as an input, for example:
Each label has:
v)UI
In addition to the standard brush canvas, the widget provides a set of exclusive toggle buttons, one for each defined label:
Selecting a label activates it as the current brush value and updates the brush color to the label's color.
Only one label can be selected at a time.
Painting behavior
When a label with base value
vis selected, painting with the brush writes values in the range:This ensures that each painted pixel belongs to the selected category while still allowing the underlying array to store floating-point values.
For example:
Colors
Each label defines a color used to visually represent that category on the canvas.
The active brush should use the selected label's color, providing immediate visual feedback about which category will be painted.
Input
The widget should take a label/value mapping as input, conceptually:
value → { label, color }The exact API can be designed to integrate with the existing
Arrayand Qt widget infrastructure.