PCL
pcl::XISFReader Class Reference

XISF input file stream More...

#include <XISF.h>

Public Member Functions

 XISFReader ()
 
virtual ~XISFReader () noexcept(false)
 
void Close ()
 
String FilePath () const
 
IsoString ImageId () const
 
pcl::ImageInfo ImageInfo () const
 
pcl::ImageOptions ImageOptions () const
 
PropertyDescriptionArray ImagePropertyDescriptions () const
 
bool ImplementsIncrementalRead () const
 
bool IsOpen () const
 
int NumberOfImages () const
 
void Open (const String &path)
 
pcl::XISFOptions Options () const
 
PropertyDescriptionArray PropertyDescriptions () const
 
ColorFilterArray ReadColorFilterArray ()
 
DisplayFunction ReadDisplayFunction ()
 
FITSKeywordArray ReadFITSKeywords ()
 
ICCProfile ReadICCProfile ()
 
void ReadImage (ComplexImage &image)
 
void ReadImage (DComplexImage &image)
 
void ReadImage (DImage &image)
 
void ReadImage (FImage &image)
 
void ReadImage (UInt16Image &image)
 
void ReadImage (UInt32Image &image)
 
void ReadImage (UInt8Image &image)
 
PropertyArray ReadImageProperties ()
 
Variant ReadImageProperty (const IsoString &identifier)
 
PropertyArray ReadProperties ()
 
Variant ReadProperty (const IsoString &identifier)
 
RGBColorSystem ReadRGBWorkingSpace ()
 
void ReadSamples (ComplexImage::sample *buffer, int startRow, int rowCount, int channel)
 
void ReadSamples (DComplexImage::sample *buffer, int startRow, int rowCount, int channel)
 
void ReadSamples (DImage::sample *buffer, int startRow, int rowCount, int channel)
 
void ReadSamples (FImage::sample *buffer, int startRow, int rowCount, int channel)
 
void ReadSamples (UInt16Image::sample *buffer, int startRow, int rowCount, int channel)
 
void ReadSamples (UInt32Image::sample *buffer, int startRow, int rowCount, int channel)
 
void ReadSamples (UInt8Image::sample *buffer, int startRow, int rowCount, int channel)
 
UInt8Image ReadThumbnail ()
 
int SelectedImageIndex () const
 
void SelectImage (int index)
 
void SetHints (const IsoString &)
 
void SetImageOptions (const pcl::ImageOptions &options)
 
void SetLogHandler (XISFLogHandler *handler)
 
void SetOptions (const pcl::XISFOptions &options)
 

Static Public Member Functions

static XMLDocumentExtractHeader (const String &path, XMLParserOptions options=XMLParserOptions())
 

Detailed Description

XISFReader allows you to read properties, images and metadata serialized in monolithic XISF units stored as local files. This class can be used without a running PixInsight core application to implement XISF support in external applications.

See also
XISFWriter

Definition at line 891 of file XISF.h.

Constructor & Destructor Documentation

◆ XISFReader()

pcl::XISFReader::XISFReader ( )

Constructs an XISFReader object. The stream is created in a default closed state.

◆ ~XISFReader()

virtual pcl::XISFReader::~XISFReader ( )
virtualnoexcept

Virtual destructor. If the stream is open, the destructor calls the Close() member function before destroying this object.

Member Function Documentation

◆ Close()

void pcl::XISFReader::Close ( )

If this stream is open, closes the disk file and clears all internal data structures. If this stream is closed, calling this member function has no effect.

◆ ExtractHeader()

static XMLDocument* pcl::XISFReader::ExtractHeader ( const String path,
XMLParserOptions  options = XMLParserOptions() 
)
static

Extract and parse the XML header document of an existing monolithic XISF file at the specified path, and return it as a dynamically allocated instance of XMLDocument.

Ownership of the returned object is transferred to the caller, who is responsible for destroying it when appropriate.

This function will throw an Error exception if either the file is not a monolithic XISF unit, or the header is not a well-formed XML document. The header is not verified for validity or correctness as per the XISF format specification; only well-formedness of the XML document is checked.

◆ FilePath()

String pcl::XISFReader::FilePath ( ) const

Returns the full path of the file being accessed through this XISFReader object, or an empty string if no file has been opened.

◆ ImageId()

IsoString pcl::XISFReader::ImageId ( ) const

Returns the identifier of the current image in this input stream.

If no identifier is available for the current image, if no file has been opened, or if the current file contains no images, this function returns an empty string.

◆ ImageInfo()

pcl::ImageInfo pcl::XISFReader::ImageInfo ( ) const

Returns geometry and color space parameters for the current image in this input stream.

◆ ImageOptions()

pcl::ImageOptions pcl::XISFReader::ImageOptions ( ) const

Returns format-independent options corresponding to the current image in this input stream.

◆ ImagePropertyDescriptions()

PropertyDescriptionArray pcl::XISFReader::ImagePropertyDescriptions ( ) const

Returns a list of property identifiers and data types describing the set of properties associated with the current image in this XISF unit. The returned list can be empty if no image is available, or if the current image has no properties.

◆ ImplementsIncrementalRead()

bool pcl::XISFReader::ImplementsIncrementalRead ( ) const

Returns true iff this stream supports incremental read operations.

Incremental reads are not supported for compressed images. The reader will be forced to load and uncompresses a compressed image transparently upon the first call to a ReadSamples() member function, and the entire pixel data of the image will be stored in a temporary memory buffer. Pixel samples returned by succesive calls to ReadSamples() will be copied from this temporary buffer. Note that this is just a convenience feature that provides none of the benefits of incremental stream I/O operations.

◆ IsOpen()

bool pcl::XISFReader::IsOpen ( ) const

Returns true iff this stream is currently open for file read operations. The stream is open only after a successful call to Open().

◆ NumberOfImages()

int pcl::XISFReader::NumberOfImages ( ) const

Returns the number of images available in this XISF input stream.

◆ Open()

void pcl::XISFReader::Open ( const String path)

Opens an existing file for reading at the specified file path.

◆ Options()

pcl::XISFOptions pcl::XISFReader::Options ( ) const
inline

Returns the current set of format-specific options.

Definition at line 927 of file XISF.h.

◆ PropertyDescriptions()

PropertyDescriptionArray pcl::XISFReader::PropertyDescriptions ( ) const

Returns a list of property identifiers and data types describing the set of properties associated with the XISF unit. The returned list can be empty if no file has been opened, or if the XISF unit has no properties.

◆ ReadColorFilterArray()

ColorFilterArray pcl::XISFReader::ReadColorFilterArray ( )

Extracts a color filter array (CFA) description from the current image in this input stream, and returns it as a pcl::ColorFilterArray object.

If no CFA has been defined for the current image, if no file has been opened, or if the current file contains no images, this function returns an invalid ColorFilterArray instance.

◆ ReadDisplayFunction()

DisplayFunction pcl::XISFReader::ReadDisplayFunction ( )

Extracts display function parameters from the current image in this input stream, and returns them as a pcl::DisplayFunction object.

If no display function has been defined for the current image, if no file has been opened, or if the current file contains no images, this function returns an identity display function.

◆ ReadFITSKeywords()

FITSKeywordArray pcl::XISFReader::ReadFITSKeywords ( )

Extracts a list of FITS header keywords from the current image in this input stream, and returns the extracted keywords as a dynamic array.

If no FITS keywords are available for the current image, if no file has been opened, or if the current file contains no images, this function returns an empty array.

◆ ReadICCProfile()

ICCProfile pcl::XISFReader::ReadICCProfile ( )

Extracts an ICC profile from the current image in this input stream, and returns the extracted ICC profile structure.

If no ICC profile is available for the current image, if no file has been opened, or if the current file contains no images, this function returns an empty ICCProfile structure.

◆ ReadImage() [1/7]

void pcl::XISFReader::ReadImage ( ComplexImage image)

Reads a 32-bit floating point complex image from this input stream.

◆ ReadImage() [2/7]

void pcl::XISFReader::ReadImage ( DComplexImage image)

Reads a 64-bit floating point complex image from this input stream.

◆ ReadImage() [3/7]

void pcl::XISFReader::ReadImage ( DImage image)

Reads a 64-bit floating point image from this input stream.

◆ ReadImage() [4/7]

void pcl::XISFReader::ReadImage ( FImage image)

Reads a 32-bit floating point image from this input stream.

◆ ReadImage() [5/7]

void pcl::XISFReader::ReadImage ( UInt16Image image)

Reads a 16-bit unsigned integer image from this input stream.

◆ ReadImage() [6/7]

void pcl::XISFReader::ReadImage ( UInt32Image image)

Reads a 32-bit unsigned integer image from this input stream.

◆ ReadImage() [7/7]

void pcl::XISFReader::ReadImage ( UInt8Image image)

Reads an 8-bit unsigned integer image from this input stream.

◆ ReadImageProperties()

PropertyArray pcl::XISFReader::ReadImageProperties ( )

Returns an array with all properties extracted from the current image.

If no property is available for the current image, if no file has been opened, or if the current file contains no images, this function returns an empty array.

◆ ReadImageProperty()

Variant pcl::XISFReader::ReadImageProperty ( const IsoString identifier)

Extracts a property from the current image with the specified identifier, and returns its value as a Variant object.

If no property with the specified identifier is available for the current image, if no file has been opened, or if the current file contains no images, this function returns an invalid Variant object.

◆ ReadProperties()

PropertyArray pcl::XISFReader::ReadProperties ( )

Returns an array with all properties associated with the XISF unit.

If no property is available for the XISF unit, or if no file has been opened, this function returns an empty array.

◆ ReadProperty()

Variant pcl::XISFReader::ReadProperty ( const IsoString identifier)

Extracts a property associated with the XISF unit with the specified identifier, and returns its value as a Variant object.

If no property with the specified identifier is available for this XISF unit, or if no file has been opened, this function returns an invalid Variant object.

◆ ReadRGBWorkingSpace()

RGBColorSystem pcl::XISFReader::ReadRGBWorkingSpace ( )

Extracts RGB working space parameters from the current image in this input stream, and returns them as a RGBColorSystem object.

If no RGB working space has been defined for the current image, if no file has been opened, or if the current file contains no images, this function returns a duplicate of the sRGB color space, since this is the default XISF color space.

◆ ReadSamples() [1/7]

void pcl::XISFReader::ReadSamples ( ComplexImage::sample buffer,
int  startRow,
int  rowCount,
int  channel 
)

Incremental random access read of 32-bit complex pixel samples.

This is an overloaded member function for the ComplexImage type; see ReadSamples( Image::sample*, int, int, int ) for a full description.

◆ ReadSamples() [2/7]

void pcl::XISFReader::ReadSamples ( DComplexImage::sample buffer,
int  startRow,
int  rowCount,
int  channel 
)

Incremental random access read of 64-bit complex pixel samples.

This is an overloaded member function for the DComplexImage type; see ReadSamples( Image::sample*, int, int, int ) for a full description.

◆ ReadSamples() [3/7]

void pcl::XISFReader::ReadSamples ( DImage::sample buffer,
int  startRow,
int  rowCount,
int  channel 
)

Incremental random access read of 64-bit floating point pixel samples.

This is an overloaded member function for the DImage type; see ReadSamples( Image::sample*, int, int, int ) for a full description.

◆ ReadSamples() [4/7]

void pcl::XISFReader::ReadSamples ( FImage::sample buffer,
int  startRow,
int  rowCount,
int  channel 
)

Incremental random access read of 32-bit floating point pixel samples.

Parameters
[out]bufferAddress of the destination pixel sample buffer.
startRowFirst pixel row to read.
rowCountNumber of pixel rows to read.
channelChannel index to read.

◆ ReadSamples() [5/7]

void pcl::XISFReader::ReadSamples ( UInt16Image::sample buffer,
int  startRow,
int  rowCount,
int  channel 
)

Incremental random access read of 16-bit unsigned integer pixel samples.

This is an overloaded member function for the UInt16Image type; see ReadSamples( Image::sample*, int, int, int ) for a full description.

◆ ReadSamples() [6/7]

void pcl::XISFReader::ReadSamples ( UInt32Image::sample buffer,
int  startRow,
int  rowCount,
int  channel 
)

Incremental random access read of 32-bit unsigned integer pixel samples.

This is an overloaded member function for the UInt32Image type; see ReadSamples( Image::sample*, int, int, int ) for a full description.

◆ ReadSamples() [7/7]

void pcl::XISFReader::ReadSamples ( UInt8Image::sample buffer,
int  startRow,
int  rowCount,
int  channel 
)

Incremental random access read of 8-bit unsigned integer pixel samples.

This is an overloaded member function for the UInt8Image type; see ReadSamples( Image::sample*, int, int, int ) for a full description.

◆ ReadThumbnail()

UInt8Image pcl::XISFReader::ReadThumbnail ( )

Extracts a thumbnail image from the current image in this input stream, and returns the extracted thumbnail as an 8-bit unsigned integer image.

If no thumbnail is available for the current image, if no file has been opened, or if the current file contains no images, this function returns an empty image.

◆ SelectedImageIndex()

int pcl::XISFReader::SelectedImageIndex ( ) const

Returns the index of the currently selected image, or -1 if either no file has been opened, or if the file does not contain any images.

◆ SelectImage()

void pcl::XISFReader::SelectImage ( int  index)

Sets the current image index in this input stream. index must be in the range [0,NumberOfImages()-1].

◆ SetHints()

void pcl::XISFReader::SetHints ( const IsoString )

Tell the reader which format hints have been specified, for inclusion as a reserved metadata property.

◆ SetImageOptions()

void pcl::XISFReader::SetImageOptions ( const pcl::ImageOptions options)

Defines a new set of format-independent options for the current image in this input stream.

Only options that modify the reading behavior of the stream will be taken into account; the rest will be ignored, irrespective of their values.

◆ SetLogHandler()

void pcl::XISFReader::SetLogHandler ( XISFLogHandler handler)

Associates a log handler with this XISF input stream.

The specified handler object must be allocated dynamically by the caller. It will be owned by this XISFReader instance, which will destroy and deallocate it when appropriate. To force destruction of the associated log handler (if any), call this function with a null pointer as argument.

◆ SetOptions()

void pcl::XISFReader::SetOptions ( const pcl::XISFOptions options)

Define a set of format-specific options.


The documentation for this class was generated from the following file: