PCL
XISF.h
Go to the documentation of this file.
1 // ____ ______ __
2 // / __ \ / ____// /
3 // / /_/ // / / /
4 // / ____// /___ / /___ PixInsight Class Library
5 // /_/ \____//_____/ PCL 2.7.0
6 // ----------------------------------------------------------------------------
7 // pcl/XISF.h - Released 2024-06-18T15:48:54Z
8 // ----------------------------------------------------------------------------
9 // This file is part of the PixInsight Class Library (PCL).
10 // PCL is a multiplatform C++ framework for development of PixInsight modules.
11 //
12 // Copyright (c) 2003-2024 Pleiades Astrophoto S.L. All Rights Reserved.
13 //
14 // Redistribution and use in both source and binary forms, with or without
15 // modification, is permitted provided that the following conditions are met:
16 //
17 // 1. All redistributions of source code must retain the above copyright
18 // notice, this list of conditions and the following disclaimer.
19 //
20 // 2. All redistributions in binary form must reproduce the above copyright
21 // notice, this list of conditions and the following disclaimer in the
22 // documentation and/or other materials provided with the distribution.
23 //
24 // 3. Neither the names "PixInsight" and "Pleiades Astrophoto", nor the names
25 // of their contributors, may be used to endorse or promote products derived
26 // from this software without specific prior written permission. For written
27 // permission, please contact info@pixinsight.com.
28 //
29 // 4. All products derived from this software, in any form whatsoever, must
30 // reproduce the following acknowledgment in the end-user documentation
31 // and/or other materials provided with the product:
32 //
33 // "This product is based on software from the PixInsight project, developed
34 // by Pleiades Astrophoto and its contributors (https://pixinsight.com/)."
35 //
36 // Alternatively, if that is where third-party acknowledgments normally
37 // appear, this acknowledgment must be reproduced in the product itself.
38 //
39 // THIS SOFTWARE IS PROVIDED BY PLEIADES ASTROPHOTO AND ITS CONTRIBUTORS
40 // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED
41 // TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
42 // PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL PLEIADES ASTROPHOTO OR ITS
43 // CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
44 // EXEMPLARY OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, BUSINESS
45 // INTERRUPTION; PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; AND LOSS OF USE,
46 // DATA OR PROFITS) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
47 // CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
48 // ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
49 // POSSIBILITY OF SUCH DAMAGE.
50 // ----------------------------------------------------------------------------
51 
52 #ifndef __PCL_XISF_h
53 #define __PCL_XISF_h
54 
56 
57 #include <pcl/Defs.h>
58 
59 #include <pcl/AutoPointer.h>
60 #include <pcl/ColorFilterArray.h>
61 #include <pcl/DisplayFunction.h>
62 #include <pcl/FITSHeaderKeyword.h>
63 #include <pcl/ICCProfile.h>
64 #include <pcl/Image.h>
65 #include <pcl/ImageInfo.h>
66 #include <pcl/ImageOptions.h>
67 #include <pcl/Property.h>
68 #include <pcl/XML.h>
69 
70 namespace pcl
71 {
72 
73 // ----------------------------------------------------------------------------
74 
101 // ----------------------------------------------------------------------------
102 
103 class XISFReaderEngine;
104 class XISFWriterEngine;
105 
106 class PCL_CLASS Compression;
107 class PCL_CLASS CryptographicHash;
108 
109 // ----------------------------------------------------------------------------
110 
125 namespace XISFChecksum
126 {
127  enum value_type
128  {
129  Unknown = -1,
130  None = 0,
131  SHA1,
132  SHA256,
133  SHA512,
134  NumberOfSupportedAlgorithms
135  };
136 }
137 
138 // ----------------------------------------------------------------------------
139 
159 namespace XISFCompression
160 {
161  enum value_type
162  {
163  Unknown = -1,
164  None = 0,
165  Zlib,
166  LZ4,
167  LZ4HC,
168  Zstd,
169  Zlib_Sh,
170  LZ4_Sh,
171  LZ4HC_Sh,
172  Zstd_Sh,
173  NumberOfSupportedCodecs
174  };
175 }
176 
177 // ----------------------------------------------------------------------------
178 
190 namespace XISFByteOrder
191 {
192  enum value_type
193  {
194  LittleEndian,
195  BigEndian
196  };
197 }
198 
199 // ----------------------------------------------------------------------------
200 
206 class PCL_CLASS XISF
207 {
208 public:
209 
213  using property_type = VariantType::value_type;
214 
218  using color_space = ColorSpace::value_type;
219 
223  using block_checksum = XISFChecksum::value_type;
224 
228  using block_compression = XISFCompression::value_type;
229 
233  using block_endianness = XISFByteOrder::value_type;
234 
239  XISF() = delete;
240 
245  XISF( const XISF& ) = delete;
246 
251  XISF& operator =( const XISF& ) = delete;
252 
257  ~XISF() = delete;
258 
259  /*
260  * ### N.B.: As of version 1.8.5.1309: Clang on macOS does not know how to
261  * compile the following constexpr static members, giving buggy 'Undefined
262  * symbols for architecture x86_64' errors on some modules...
263  */
264 #ifndef __clang__
265 
270  constexpr static fsize_type DefaultBlockAlignSize = 4096;
271 
275  constexpr static fsize_type DefaultMaxBlockInlineSize = 3072; // 3072*4/3 = 4096 (base64)
276 
280  constexpr static int MaxThumbnailSize = 1024;
281 
285  constexpr static block_checksum DefaultChecksum = XISFChecksum::None;
286 
290  constexpr static block_compression DefaultCompression = XISFCompression::None;
291 
297  constexpr static int DefaultCompressionLevel = 0;
298 
302  constexpr static int MaxCompressionLevel = 100;
303 
307  constexpr static int DefaultVerbosity = 1;
308 
314  constexpr static bool DefaultFixNonFinite = true;
315 
319  constexpr static double DefaultOutputLowerBound = 0.0;
320 
324  constexpr static double DefaultOutputUpperBound = 1.0;
325 
331  constexpr static bool DefaultStoreFITSKeywords = true;
332 
338  constexpr static bool DefaultIgnoreFITSKeywords = false;
339 
345  constexpr static bool DefaultImportFITSKeywords = false;
346 
350  constexpr static bool DefaultIgnoreEmbeddedData = false;
351 
355  constexpr static bool DefaultIgnoreProperties = false;
356 
360  constexpr static bool DefaultAutoMetadata = true;
361 
365  constexpr static bool DefaultNoWarnings = false;
366 
370  constexpr static bool DefaultWarningsAreErrors = false;
371 
375  constexpr static const char* InternalNamespacePrefix = "XISF:";
376 
377 #else
378 
379  static const fsize_type DefaultBlockAlignSize;
380  static const fsize_type DefaultMaxBlockInlineSize;
381  static const int MaxThumbnailSize;
382  static const block_checksum DefaultChecksum;
383  static const block_compression DefaultCompression;
384  static const int DefaultCompressionLevel;
385  static const int MaxCompressionLevel;
386  static const int DefaultVerbosity;
387  static const bool DefaultFixNonFinite;
388  static const double DefaultOutputLowerBound;
389  static const double DefaultOutputUpperBound;
390  static const bool DefaultStoreFITSKeywords;
391  static const bool DefaultIgnoreFITSKeywords;
392  static const bool DefaultImportFITSKeywords;
393  static const bool DefaultIgnoreEmbeddedData;
394  static const bool DefaultIgnoreProperties;
395  static const bool DefaultAutoMetadata;
396  static const bool DefaultNoWarnings;
397  static const bool DefaultWarningsAreErrors;
398  static const char* InternalNamespacePrefix;
399 
400 #endif // !__clang__
401 
416  static const char* SampleFormatId( int bitsPerSample, bool floatSample, bool complexSample );
417 
422  template <class P>
423  static const char* SampleFormatId( const GenericImage<P>& image )
424  {
425  return SampleFormatId( P::BitsPerSample(), P::IsFloatSample(), P::IsComplexSample() );
426  }
427 
433  static bool GetSampleFormatFromId( int& bitsPerSample, bool& floatSample, bool& complexSample, const String& id );
434 
447  static const char* ColorSpaceId( color_space colorSpace );
448 
453  static const char* ColorSpaceId( const AbstractImage& image )
454  {
455  return ColorSpaceId( image.ColorSpace() );
456  }
457 
462  static color_space ColorSpaceFromId( const String& id );
463 
471  static const char* PropertyTypeId( property_type type );
472 
477  static property_type PropertyTypeFromId( const String& id );
478 
483  static const char* CompressionCodecId( block_compression codec );
484 
489  static block_compression CompressionCodecFromId( const String& id );
490 
496  static Compression* NewCompression( block_compression codec, size_type itemSize = 1 );
497 
502  static int CompressionLevelForMethod( block_compression codec, int level );
503 
508  static bool CompressionUsesByteShuffle( block_compression codec );
509 
514  static block_compression CompressionCodecNoShuffle( block_compression codec );
515 
520  static bool CompressionNeedsItemSize( block_compression codec );
521 
526  static const char* ChecksumAlgorithmId( block_checksum algorithm );
527 
532  static block_checksum ChecksumAlgorithmFromId( const String& id );
533 
538  static size_type ChecksumLength( block_checksum algorithm );
539 
544  static CryptographicHash* NewCryptographicHash( block_checksum algorithm );
545 
564  static bool IsValidPropertyId( const IsoString& id )
565  {
566  return Property::IsValidIdentifier( id );
567  }
568 
569  static bool IsValidPropertyId( const IsoString::ustring_base& id )
570  {
571  return IsValidPropertyId( IsoString( id ) );
572  }
573 
582  static bool IsInternalPropertyId( const IsoString& id )
583  {
584  return id.StartsWith( InternalNamespacePrefix );
585  }
586 
587  static bool IsInternalPropertyId( const IsoString::ustring_base& id )
588  {
589  return IsInternalPropertyId( IsoString( id ) );
590  }
591 
596  {
597  if ( !IsInternalPropertyId( id ) )
598  return InternalNamespacePrefix + id;
599  return id;
600  }
601 
602  static IsoString InternalPropertyId( const IsoString::ustring_base& id )
603  {
604  return InternalPropertyId( IsoString( id ) );
605  }
606 
618  static void EnsurePTLUTInitialized();
619 };
620 
621 // ----------------------------------------------------------------------------
622 
636 class PCL_CLASS XISFOptions
637 {
638 public:
639 
640  bool storeFITSKeywords : 1;
644  bool ignoreProperties : 1;
645  bool autoMetadata : 1;
646  bool noWarnings : 1;
647  bool warningsAreErrors : 1;
648  XISF::block_checksum checksumAlgorithm : 4;
649  XISF::block_compression compressionCodec : 5;
652  bool fixNonFinite : 1;
657 
662  {
663  Reset();
664  }
665 
669  XISFOptions( const XISFOptions& ) = default;
670 
674  XISFOptions& operator =( const XISFOptions& ) = default;
675 
679  void Reset()
680  {
681  storeFITSKeywords = XISF::DefaultStoreFITSKeywords;
682  ignoreFITSKeywords = XISF::DefaultIgnoreFITSKeywords;
683  importFITSKeywords = XISF::DefaultImportFITSKeywords;
684  ignoreEmbeddedData = XISF::DefaultIgnoreEmbeddedData;
685  ignoreProperties = XISF::DefaultIgnoreProperties;
686  autoMetadata = XISF::DefaultAutoMetadata;
687  noWarnings = XISF::DefaultNoWarnings;
688  warningsAreErrors = XISF::DefaultWarningsAreErrors;
689  checksumAlgorithm = XISF::DefaultChecksum;
690  compressionCodec = XISF::DefaultCompression;
691  compressionLevel = XISF::DefaultCompressionLevel;
692  verbosity = XISF::DefaultVerbosity;
693  fixNonFinite = XISF::DefaultFixNonFinite;
694  blockAlignmentSize = XISF::DefaultBlockAlignSize;
695  maxInlineBlockSize = XISF::DefaultMaxBlockInlineSize;
696  outputLowerBound = XISF::DefaultOutputLowerBound;
697  outputUpperBound = XISF::DefaultOutputUpperBound;
698  }
699 };
700 
701 // ----------------------------------------------------------------------------
702 
719 struct PCL_CLASS XISFFileSignature
720 {
721  uint8 magic[ 8 ] = { 'X', 'I', 'S', 'F', '0', '1', '0', '0' };
722  uint32 headerLength = 0; // length in bytes of the XML file header
723  uint32 reserved = 0; // reserved - must be zero
724 
729  XISFFileSignature() = default;
730 
735 
739  XISFFileSignature& operator =( const XISFFileSignature& ) = default;
740 
746  : headerLength( length )
747  {
748  }
749 
754  void Validate() const;
755 };
756 
757 // ----------------------------------------------------------------------------
758 
773 namespace XISFMessageType
774 {
775  enum value_type
776  {
777  Informative,
778  Note,
779  Warning,
780  RecoverableError
781  };
782 }
783 
784 // ----------------------------------------------------------------------------
785 
801 class PCL_CLASS XISFLogHandler
802 {
803 public:
804 
809  using message_type = XISFMessageType::value_type;
810 
814  XISFLogHandler() = default;
815 
819  virtual ~XISFLogHandler()
820  {
821  }
822 
839  virtual void Init( const String& filePath, bool writing )
840  {
841  }
842 
859  virtual void Log( const String& text, message_type type )
860  {
861  }
862 
872  virtual void Close()
873  {
874  }
875 };
876 
877 // ----------------------------------------------------------------------------
878 
891 class PCL_CLASS XISFReader
892 {
893 public:
894 
900 
905  virtual ~XISFReader() noexcept( false );
906 
907  /*
908  * Copy constructor. This constructor is disabled because %XISF streams are
909  * unique objects.
910  */
911  XISFReader( const XISFReader& ) = delete;
912 
913  /*
914  * Copy assignment. This operator is disabled because %XISF streams are
915  * unique objects.
916  */
917  XISFReader& operator =( const XISFReader& ) = delete;
918 
922  void SetOptions( const pcl::XISFOptions& options );
923 
927  pcl::XISFOptions Options() const
928  {
929  return m_options;
930  }
931 
936  void SetHints( const IsoString& );
937 
947  void SetLogHandler( XISFLogHandler* handler );
948 
953  bool IsOpen() const;
954 
958  void Open( const String& path );
959 
965  void Close();
966 
971  String FilePath() const;
972 
976  int NumberOfImages() const;
977 
982  void SelectImage( int index );
983 
988  int SelectedImageIndex() const;
989 
995 
1001 
1009  void SetImageOptions( const pcl::ImageOptions& options );
1010 
1019 
1029 
1039 
1049 
1060 
1070 
1080 
1088 
1097  Variant ReadImageProperty( const IsoString& identifier );
1098 
1107 
1114 
1123  Variant ReadProperty( const IsoString& identifier );
1124 
1132 
1136  void ReadImage( FImage& image );
1137 
1141  void ReadImage( DImage& image );
1142 
1146  void ReadImage( ComplexImage& image );
1147 
1151  void ReadImage( DComplexImage& image );
1152 
1156  void ReadImage( UInt8Image& image );
1157 
1161  void ReadImage( UInt16Image& image );
1162 
1166  void ReadImage( UInt32Image& image );
1167 
1180 
1189  void ReadSamples( FImage::sample* buffer, int startRow, int rowCount, int channel );
1190 
1197  void ReadSamples( DImage::sample* buffer, int startRow, int rowCount, int channel );
1198 
1205  void ReadSamples( ComplexImage::sample* buffer, int startRow, int rowCount, int channel );
1206 
1213  void ReadSamples( DComplexImage::sample* buffer, int startRow, int rowCount, int channel );
1214 
1221  void ReadSamples( UInt8Image::sample* buffer, int startRow, int rowCount, int channel );
1222 
1229  void ReadSamples( UInt16Image::sample* buffer, int startRow, int rowCount, int channel );
1230 
1237  void ReadSamples( UInt32Image::sample* buffer, int startRow, int rowCount, int channel );
1238 
1254 
1255 private:
1256 
1258  AutoPointer<XISFLogHandler> m_logHandler;
1259  XISFOptions m_options;
1260  IsoString m_hints;
1261 
1262  void CheckOpenStream( const char* ) const;
1263  void CheckClosedStream( const char* ) const;
1264 };
1265 
1266 // ----------------------------------------------------------------------------
1267 
1280 class PCL_CLASS XISFWriter
1281 {
1282 public:
1283 
1289 
1294  virtual ~XISFWriter() noexcept( false );
1295 
1296  /*
1297  * Copy constructor. This constructor is disabled because %XISF streams are
1298  * unique objects.
1299  */
1300  XISFWriter( const XISFWriter& ) = delete;
1301 
1302  /*
1303  * Copy assignment. This operator is disabled because %XISF streams are
1304  * unique objects.
1305  */
1306  XISFWriter& operator =( const XISFWriter& ) = delete;
1307 
1311  void SetOptions( const pcl::XISFOptions& options );
1312 
1316  pcl::XISFOptions Options() const
1317  {
1318  return m_options;
1319  }
1320 
1325  void SetHints( const IsoString& );
1326 
1336  void SetLogHandler( XISFLogHandler* handler );
1337 
1352  void SetCreatorApplication( const String& appName );
1353 
1368  void SetCreatorModule( const String& modName );
1369 
1374  bool IsOpen() const;
1375 
1380  void Create( const String& path, int count );
1381 
1387  void Close();
1388 
1393  String FilePath() const;
1394 
1402  void SetImageOptions( const ImageOptions& options );
1403 
1408  void SetImageId( const IsoString& id );
1409 
1414  void WriteFITSKeywords( const FITSKeywordArray& keywords );
1415 
1424 
1428  void WriteICCProfile( const ICCProfile& profile );
1429 
1434  void WriteThumbnail( const UInt8Image& thumbnail );
1435 
1440  void WriteRGBWorkingSpace( const RGBColorSystem& rgbws );
1441 
1447 
1453 
1458  void WriteImageProperty( const IsoString& identifier, const Variant& value );
1459 
1464  void WriteImageProperties( const PropertyArray& properties );
1465 
1472  void RemoveImageProperty( const IsoString& identifier );
1473 
1478  void WriteProperty( const IsoString& identifier, const Variant& value );
1479 
1484  void WriteProperties( const PropertyArray& properties );
1485 
1492  void RemoveProperty( const IsoString& identifier );
1493 
1497  void WriteImage( const Image& image );
1498 
1502  void WriteImage( const DImage& image );
1503 
1507  void WriteImage( const ComplexImage& image );
1508 
1512  void WriteImage( const DComplexImage& image );
1513 
1517  void WriteImage( const UInt8Image& image );
1518 
1522  void WriteImage( const UInt16Image& image );
1523 
1527  void WriteImage( const UInt32Image& image );
1528 
1532  void WriteImage( const ImageVariant& image );
1533 
1541  void CreateImage( const ImageInfo& info );
1542 
1551  void WriteSamples( const FImage::sample* buffer, int startRow, int rowCount, int channel );
1552 
1560  void WriteSamples( const DImage::sample* buffer, int startRow, int rowCount, int channel );
1561 
1569  void WriteSamples( const ComplexImage::sample* buffer, int startRow, int rowCount, int channel );
1570 
1578  void WriteSamples( const DComplexImage::sample* buffer, int startRow, int rowCount, int channel );
1579 
1587  void WriteSamples( const UInt8Image::sample* buffer, int startRow, int rowCount, int channel );
1588 
1596  void WriteSamples( const UInt16Image::sample* buffer, int startRow, int rowCount, int channel );
1597 
1605  void WriteSamples( const UInt32Image::sample* buffer, int startRow, int rowCount, int channel );
1606 
1611  void CloseImage();
1612 
1613 private:
1614 
1616  AutoPointer<XISFLogHandler> m_logHandler;
1617  XISFOptions m_options;
1618  IsoString m_hints;
1619  String m_creatorApplication;
1620  String m_creatorModule;
1621 
1622  void CheckOpenStream( const char* ) const;
1623  void CheckClosedStream( const char* ) const;
1624 };
1625 
1626 // ----------------------------------------------------------------------------
1627 
1628 } // pcl
1629 
1630 #endif // __PCL_XISF_h
1631 
1632 // ----------------------------------------------------------------------------
1633 // EOF pcl/XISF.h - Released 2024-06-18T15:48:54Z
Base class of all two-dimensional images in PCL.
Generic dynamic array.
Definition: Array.h:100
Color filter array (CFA) structure.
Abstract base class of data compression algorithm implementations.
Definition: Compression.h:84
Abstract base class for cryptographic hashing algorithm implementations.
Definition: Cryptography.h:86
Adaptive histogram transformations for image visualization.
Implements a generic, two-dimensional, shared or local image.
Definition: Image.h:278
typename pixel_traits::sample sample
Definition: Image.h:305
A high-level interface to ICC color profiles.
Definition: ICCProfile.h:235
color_space ColorSpace() const noexcept
Definition: ImageColor.h:178
A simple structure to hold basic information about images.
Definition: ImageInfo.h:72
Format-independent, fundamental image stream options.
Definition: ImageOptions.h:98
Acts like a union for all types of images in PCL, with optional class-wide ownership of transported i...
Definition: ImageVariant.h:322
Eight-bit string (ISO/IEC-8859-1 or UTF-8 string)
Definition: String.h:5425
static bool IsValidIdentifier(const IsoString &id)
Definition: Property.h:206
Colorimetrically defined RGB working color space.
Unicode (UTF-16) string.
Definition: String.h:8113
Acts like a union to store instances of different data types.
Definition: Variant.h:332
XISF stream message logger
Definition: XISF.h:802
virtual void Log(const String &text, message_type type)
Definition: XISF.h:859
virtual void Init(const String &filePath, bool writing)
Definition: XISF.h:839
virtual ~XISFLogHandler()
Definition: XISF.h:819
virtual void Close()
Definition: XISF.h:872
XISFLogHandler()=default
XISF-specific file options
Definition: XISF.h:637
uint8 compressionLevel
Codec-independent compression level: 0 = auto, 1 = fast, 100 = maximum compression.
Definition: XISF.h:650
bool ignoreFITSKeywords
Do not load FITS keywords from input XISF files.
Definition: XISF.h:641
bool autoMetadata
Automatically generate a number of reserved XISF properties.
Definition: XISF.h:645
uint16 maxInlineBlockSize
Maximum size in bytes of an inline/embedded block.
Definition: XISF.h:654
uint16 blockAlignmentSize
Block alignment size in bytes (0 = 1 = unaligned).
Definition: XISF.h:653
bool noWarnings
Suppress all warning and diagnostics messages.
Definition: XISF.h:646
uint8 verbosity
Verbosity level: 0 = quiet, > 0 = write console state messages.
Definition: XISF.h:651
double outputUpperBound
Upper bound for output floating point pixel samples (=1.0 by default).
Definition: XISF.h:656
bool ignoreProperties
Do not load existing XISF properties.
Definition: XISF.h:644
bool storeFITSKeywords
Include FITS header keywords in output XISF files.
Definition: XISF.h:640
bool warningsAreErrors
Treat warnings as fatal errors.
Definition: XISF.h:647
XISFOptions(const XISFOptions &)=default
void Reset()
Definition: XISF.h:679
bool fixNonFinite
Replace NaNs, infinities and negative zeros with lower bound values in floating point images (reading...
Definition: XISF.h:652
bool importFITSKeywords
Import FITS keywords as XISF properties.
Definition: XISF.h:642
XISF::block_checksum checksumAlgorithm
The algorithm used for block checksum calculations.
Definition: XISF.h:648
XISF::block_compression compressionCodec
The codec used for compression of XISF blocks.
Definition: XISF.h:649
double outputLowerBound
Lower bound for output floating point pixel samples (=0.0 by default).
Definition: XISF.h:655
bool ignoreEmbeddedData
Do not load existing embedded data (such as ICC profiles for example).
Definition: XISF.h:643
XISF input file stream
Definition: XISF.h:892
Variant ReadImageProperty(const IsoString &identifier)
int SelectedImageIndex() const
String FilePath() const
void ReadImage(UInt32Image &image)
void ReadSamples(UInt16Image::sample *buffer, int startRow, int rowCount, int channel)
void Open(const String &path)
void ReadImage(DComplexImage &image)
DisplayFunction ReadDisplayFunction()
PropertyArray ReadProperties()
PropertyDescriptionArray PropertyDescriptions() const
void ReadSamples(DComplexImage::sample *buffer, int startRow, int rowCount, int channel)
Variant ReadProperty(const IsoString &identifier)
void ReadImage(UInt8Image &image)
void ReadSamples(ComplexImage::sample *buffer, int startRow, int rowCount, int channel)
void SelectImage(int index)
RGBColorSystem ReadRGBWorkingSpace()
void ReadSamples(UInt8Image::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 ReadImage(FImage &image)
void ReadSamples(UInt32Image::sample *buffer, int startRow, int rowCount, int channel)
void SetLogHandler(XISFLogHandler *handler)
pcl::ImageOptions ImageOptions() const
pcl::ImageInfo ImageInfo() const
IsoString ImageId() const
PropertyArray ReadImageProperties()
ColorFilterArray ReadColorFilterArray()
UInt8Image ReadThumbnail()
void ReadImage(UInt16Image &image)
int NumberOfImages() const
bool ImplementsIncrementalRead() const
static XMLDocument * ExtractHeader(const String &path, XMLParserOptions options=XMLParserOptions())
void SetImageOptions(const pcl::ImageOptions &options)
void ReadImage(DImage &image)
ICCProfile ReadICCProfile()
PropertyDescriptionArray ImagePropertyDescriptions() const
void ReadImage(ComplexImage &image)
bool IsOpen() const
FITSKeywordArray ReadFITSKeywords()
void SetHints(const IsoString &)
virtual ~XISFReader() noexcept(false)
XISF output file stream
Definition: XISF.h:1281
void WriteICCProfile(const ICCProfile &profile)
void WriteImage(const DImage &image)
void WriteThumbnail(const UInt8Image &thumbnail)
void RemoveImageProperty(const IsoString &identifier)
void SetCreatorApplication(const String &appName)
void WriteSamples(const DComplexImage::sample *buffer, int startRow, int rowCount, int channel)
void WriteImageProperty(const IsoString &identifier, const Variant &value)
void WriteImage(const ComplexImage &image)
void SetCreatorModule(const String &modName)
void WriteProperties(const PropertyArray &properties)
void WriteSamples(const UInt16Image::sample *buffer, int startRow, int rowCount, int channel)
void Create(const String &path, int count)
void WriteImageProperties(const PropertyArray &properties)
void WriteImage(const DComplexImage &image)
void WriteFITSKeywords(const FITSKeywordArray &keywords)
void WriteSamples(const ComplexImage::sample *buffer, int startRow, int rowCount, int channel)
void WriteRGBWorkingSpace(const RGBColorSystem &rgbws)
virtual ~XISFWriter() noexcept(false)
void WriteImage(const UInt16Image &image)
void WriteSamples(const DImage::sample *buffer, int startRow, int rowCount, int channel)
const FITSKeywordArray & FITSKeywords() const
void SetImageId(const IsoString &id)
void WriteSamples(const UInt32Image::sample *buffer, int startRow, int rowCount, int channel)
void WriteColorFilterArray(const ColorFilterArray &cfa)
String FilePath() const
void SetImageOptions(const ImageOptions &options)
void WriteSamples(const FImage::sample *buffer, int startRow, int rowCount, int channel)
void RemoveProperty(const IsoString &identifier)
void SetHints(const IsoString &)
void WriteProperty(const IsoString &identifier, const Variant &value)
bool IsOpen() const
void WriteDisplayFunction(const DisplayFunction &df)
void WriteImage(const ImageVariant &image)
void SetLogHandler(XISFLogHandler *handler)
void CreateImage(const ImageInfo &info)
void WriteImage(const UInt32Image &image)
void WriteSamples(const UInt8Image::sample *buffer, int startRow, int rowCount, int channel)
void WriteImage(const UInt8Image &image)
void WriteImage(const Image &image)
Utility functions, data and constants for XISF support.
Definition: XISF.h:207
static bool CompressionNeedsItemSize(block_compression codec)
static const char * CompressionCodecId(block_compression codec)
static bool IsInternalPropertyId(const IsoString &id)
Definition: XISF.h:582
static bool CompressionUsesByteShuffle(block_compression codec)
static const char * ChecksumAlgorithmId(block_checksum algorithm)
static block_compression CompressionCodecNoShuffle(block_compression codec)
~XISF()=delete
constexpr static bool DefaultWarningsAreErrors
Definition: XISF.h:370
constexpr static block_checksum DefaultChecksum
Definition: XISF.h:285
XISF(const XISF &)=delete
constexpr static bool DefaultIgnoreFITSKeywords
Definition: XISF.h:338
constexpr static int DefaultCompressionLevel
Definition: XISF.h:297
static const char * SampleFormatId(const GenericImage< P > &image)
Definition: XISF.h:423
static const char * ColorSpaceId(color_space colorSpace)
constexpr static block_compression DefaultCompression
Definition: XISF.h:290
static color_space ColorSpaceFromId(const String &id)
constexpr static bool DefaultIgnoreProperties
Definition: XISF.h:355
static const char * SampleFormatId(int bitsPerSample, bool floatSample, bool complexSample)
static size_type ChecksumLength(block_checksum algorithm)
constexpr static double DefaultOutputLowerBound
Definition: XISF.h:319
constexpr static bool DefaultFixNonFinite
Definition: XISF.h:314
static block_checksum ChecksumAlgorithmFromId(const String &id)
static const char * PropertyTypeId(property_type type)
constexpr static int DefaultVerbosity
Definition: XISF.h:307
constexpr static bool DefaultAutoMetadata
Definition: XISF.h:360
static property_type PropertyTypeFromId(const String &id)
static int CompressionLevelForMethod(block_compression codec, int level)
constexpr static double DefaultOutputUpperBound
Definition: XISF.h:324
static const char * ColorSpaceId(const AbstractImage &image)
Definition: XISF.h:453
constexpr static bool DefaultIgnoreEmbeddedData
Definition: XISF.h:350
static Compression * NewCompression(block_compression codec, size_type itemSize=1)
constexpr static fsize_type DefaultBlockAlignSize
Definition: XISF.h:270
static bool GetSampleFormatFromId(int &bitsPerSample, bool &floatSample, bool &complexSample, const String &id)
constexpr static bool DefaultNoWarnings
Definition: XISF.h:365
constexpr static bool DefaultStoreFITSKeywords
Definition: XISF.h:331
static bool IsValidPropertyId(const IsoString &id)
Definition: XISF.h:564
static block_compression CompressionCodecFromId(const String &id)
static IsoString InternalPropertyId(const IsoString &id)
Definition: XISF.h:595
static void EnsurePTLUTInitialized()
constexpr static bool DefaultImportFITSKeywords
Definition: XISF.h:345
static CryptographicHash * NewCryptographicHash(block_checksum algorithm)
constexpr static fsize_type DefaultMaxBlockInlineSize
Definition: XISF.h:275
XISF()=delete
XML document parsing and generation
Definition: XML.h:2641
int64 fsize_type
Definition: Defs.h:1185
unsigned short uint16
Definition: Defs.h:654
unsigned char uint8
Definition: Defs.h:642
unsigned int uint32
Definition: Defs.h:666
size_t size_type
Definition: Defs.h:609
PCL root namespace.
Definition: AbstractImage.h:77
XISF monolithic file signature
Definition: XISF.h:720
XISFFileSignature(uint32 length)
Definition: XISF.h:745
XISFFileSignature(const XISFFileSignature &)=default