Expand description
Reading and writing XISF files.
XISF is the Extensible Image Serialization Format: an XML header naming images and properties, followed by the binary blocks that hold them.
use xisf::XisfFile;
let file = XisfFile::open("image.xisf")?;
for image in file.images() {
println!("{:?} {}", image.geometry(), image.sample_format().name());
let pixels: Vec<u16> = image.read()?;
println!(" {} samples", pixels.len());
}This crate is the ergonomic face of xisf_core, which does the work. It
is written from the published XISF specification; nothing here derives from
libXISF or from the PixInsight Class Library.
Modules§
- astrometry
- The
AstrometricSolutionproperty namespace: where an image is on the sky. TheAstrometricSolutionproperty namespace: where an image is on the sky. - color
- Colour space transformations, as Annex B of the specification defines them. Colour space transformations: Annex B of the specification.
Structs§
- Block
Options - How a block should be stored.
- Bounds
- The
boundsattribute: the range floating-point samples are scaled to. - Cell
- One cell’s value.
- Color
Filter Array - A
<ColorFilterArray>: the mosaic pattern a sensor captured through. - Color
Transform - The transformations for one RGB working space.
- Compression
- A parsed
compressionattribute. - Compression
Request - A request to compress, before the compressed size is known.
- DataRef
- How to obtain one element’s data block.
- Display
Function - A
<DisplayFunction>element: a screen transfer function, which changes how an image is shown without changing the data. - Distributed
Unit - A distributed unit: an XISF header file and the data blocks file it names.
- Element
- One element of the header, flattened to what the engine needs.
- Error
- An engine error: a kind, and a message saying what specifically failed.
- Field
- One column of a table: a name, a type, and how to present it.
- Fits
Keyword - One
<FITSKeyword>element. - Header
- A parsed XISF header.
- Image
- An
<Image>element’s attributes, parsed. - Image
Ref - One image in a file.
- Orientation
- The
orientationattribute: a rotation, and optionally a horizontal flip. - Pending
Image - An image to write, with its pixel data and whatever is attached to it.
- Pending
Thumbnail - A preview image attached to another image.
- Property
- A
<Property>element, parsed. - Property
Ref - One property in a file.
- Property
Type - A property’s declared type: its shape, and the element type where it has one.
- Reader
- An open XISF file.
- Resolution
- A
<Resolution>element: how many pixels there are per unit of length. - RgbWorking
Space - An
<RGBWorkingSpace>element: the colour space an image’s RGB values are expressed in. - Structure
- A
<Structure>element: the ordered fields of a table. - Table
- A
<Table>element: a table property, with its structure resolved. - Thumbnail
Ref - An image’s thumbnail: a small preview, which is an image in its own right.
- Writer
- Builds a monolithic XISF file.
- Xisf
File - An open XISF file.
Enums§
- Byte
Order - The byte order a data block’s multi-byte values are stored in.
- CfaElement
- One element of a colour filter array pattern.
- Checksum
Algorithm - A hash algorithm the spec allows for block checksums.
- Checksum
Status - Whether a block’s stored bytes matched its recorded checksum.
- Codec
- A compression codec.
- Color
Space - The colour space the channels are in.
- Error
Kind - What went wrong, in a form a caller can branch on.
- Gamma
- The transfer curve of an RGB working space.
- Location
- Where a data block’s bytes are.
- Pixel
Storage - How samples of different channels are interleaved.
- Resolution
Unit - The unit an image’s resolution is measured in.
- Sample
Format - How pixel samples are stored.
- Scalar
- The element type of a scalar, vector, matrix or table component.
- Scalar
Value - A scalar property’s value, decoded according to its declared type.
- Shape
- What shape a property’s value has.
- Write
Codec - The codecs this crate can write.
Traits§
- Sample
- A pixel sample type that can be read in bulk.
Type Aliases§
- Result
- The engine’s result type.