ColorSource
pub enum ColorSource<'a>
Where a colour window takes its colours from.
The C spells this as three fields that have to agree (colors,
color_count and colors_from), and gets
Status::InvalidArgument if they do not. Here they are one
value, so the disagreement cannot be written down: the table case
is the only one that carries a slice, and it carries the length
with it.
Status::InvalidArgument: crate::Status::InvalidArgument
ColorSource — variants
Palette
Colour the band with ColorWindow::palette.
Table — (&'a [Rgb24])
Colour the band with this table instead of the palette.
Empty is Status::InvalidArgument rather than a silent
fallback to the palette.
Status::InvalidArgument: crate::Status::InvalidArgument
Keep
Leave the band's table exactly as it is.
This is the one to use when editing a band that is already on
the camera. A band read back reports color_count but no
table (the SDK will not hand out a pointer into its own memory),
so writing a read-back band with ColorSource::Palette
discards whatever ramp it had. Nudging a band's max_c and
writing it back is the most ordinary thing an editor does.