Skip to main content

Crate xisf

Crate xisf 

Source
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 AstrometricSolution property namespace: where an image is on the sky. The AstrometricSolution property 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§

BlockOptions
How a block should be stored.
Bounds
The bounds attribute: the range floating-point samples are scaled to.
Cell
One cell’s value.
ColorFilterArray
A <ColorFilterArray>: the mosaic pattern a sensor captured through.
ColorTransform
The transformations for one RGB working space.
Compression
A parsed compression attribute.
CompressionRequest
A request to compress, before the compressed size is known.
DataRef
How to obtain one element’s data block.
DisplayFunction
A <DisplayFunction> element: a screen transfer function, which changes how an image is shown without changing the data.
DistributedUnit
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.
FitsKeyword
One <FITSKeyword> element.
Header
A parsed XISF header.
Image
An <Image> element’s attributes, parsed.
ImageRef
One image in a file.
Orientation
The orientation attribute: a rotation, and optionally a horizontal flip.
PendingImage
An image to write, with its pixel data and whatever is attached to it.
PendingThumbnail
A preview image attached to another image.
Property
A <Property> element, parsed.
PropertyRef
One property in a file.
PropertyType
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.
RgbWorkingSpace
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.
ThumbnailRef
An image’s thumbnail: a small preview, which is an image in its own right.
Writer
Builds a monolithic XISF file.
XisfFile
An open XISF file.

Enums§

ByteOrder
The byte order a data block’s multi-byte values are stored in.
CfaElement
One element of a colour filter array pattern.
ChecksumAlgorithm
A hash algorithm the spec allows for block checksums.
ChecksumStatus
Whether a block’s stored bytes matched its recorded checksum.
Codec
A compression codec.
ColorSpace
The colour space the channels are in.
ErrorKind
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.
PixelStorage
How samples of different channels are interleaved.
ResolutionUnit
The unit an image’s resolution is measured in.
SampleFormat
How pixel samples are stored.
Scalar
The element type of a scalar, vector, matrix or table component.
ScalarValue
A scalar property’s value, decoded according to its declared type.
Shape
What shape a property’s value has.
WriteCodec
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.