pub struct Image {
pub dimensions: Vec<u64>,
pub channels: u64,
pub sample_format: SampleFormat,
pub color_space: ColorSpace,
pub pixel_storage: PixelStorage,
pub bounds: Option<Bounds>,
pub id: Option<String>,
pub uuid: Option<String>,
pub image_type: Option<ImageType>,
pub offset: Option<f64>,
pub orientation: Option<Orientation>,
}Expand description
An <Image> element’s attributes, parsed.
Fields§
§dimensions: Vec<u64>Dimensions, fastest-varying first, then the channel count.
The spec writes geometry="width:height:channels" for a 2-D image,
and allows more dimensions before the channel count.
channels: u64§sample_format: SampleFormat§color_space: ColorSpace§pixel_storage: PixelStorage§bounds: Option<Bounds>Present for floating-point images; the spec’s default is 0:1.
id: Option<String>§uuid: Option<String>§image_type: Option<ImageType>§offset: Option<f64>A pedestal added to every sample, which must be subtracted to get zero-based values. The spec’s default is zero.
This is not cosmetic: calibration and integration subtract it, so an image read without it has the wrong zero point.
orientation: Option<Orientation>How the image should be reoriented for display. None is the spec’s
default of no transformation.
A decoder must not apply this for processing that depends on the physical layout of the pixels – calibration frames would no longer line up – so it is kept as a declaration rather than applied here.
Implementations§
Source§impl Image
impl Image
Sourcepub fn sample_count(&self) -> Option<u64>
pub fn sample_count(&self) -> Option<u64>
Total number of samples: every dimension times the channel count.
Sourcepub fn channels_suffice(&self) -> bool
pub fn channels_suffice(&self) -> bool
Whether the channel count covers what the colour space needs.
More channels than nominal is legal – they are alpha channels – but fewer means the image cannot be interpreted in the space it declares.