PCL
FileFormat.h
Go to the documentation of this file.
1 // ____ ______ __
2 // / __ \ / ____// /
3 // / /_/ // / / /
4 // / ____// /___ / /___ PixInsight Class Library
5 // /_/ \____//_____/ PCL 2.7.0
6 // ----------------------------------------------------------------------------
7 // pcl/FileFormat.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_FileFormat_h
53 #define __PCL_FileFormat_h
54 
56 
57 #ifndef __PCL_BUILDING_PIXINSIGHT_APPLICATION
58 
59 #include <pcl/Defs.h>
60 
61 #include <pcl/AutoPointer.h>
62 #include <pcl/FileFormatBase.h>
63 
64 namespace pcl
65 {
66 
67 // ----------------------------------------------------------------------------
68 
69 class FileFormatPrivate;
70 
97 class PCL_CLASS FileFormat : public FileFormatBase
98 {
99 public:
100 
167  FileFormat( const String& nameExtOrMime, bool toRead = false, bool toWrite = false );
168 
173  FileFormat( const FileFormat& fmt );
174 
182  ~FileFormat() override;
183 
186  IsoString Name() const override;
187 
190  StringList FileExtensions() const override;
191 
194  IsoStringList MimeTypes() const override;
195 
198  uint32 Version() const override;
199 
202  String Description() const override;
203 
206  String Implementation() const override;
207 
210  String Status() const override;
211 
214  Bitmap Icon() const override;
215 
218  Bitmap SmallIcon() const override;
219 
222  bool CanRead() const override;
223 
226  bool CanWrite() const override;
227 
230  bool CanReadIncrementally() const override;
231 
234  bool CanWriteIncrementally() const override;
235 
238  bool CanStore8Bit() const override;
239 
242  bool CanStore16Bit() const override;
243 
246  bool CanStore32Bit() const override;
247 
250  bool CanStore64Bit() const override;
251 
254  bool CanStoreFloat() const override;
255 
258  bool CanStoreDouble() const override;
259 
262  bool CanStoreComplex() const override;
263 
266  bool CanStoreDComplex() const override;
267 
270  bool CanStoreGrayscale() const override;
271 
274  bool CanStoreRGBColor() const override;
275 
278  bool CanStoreAlphaChannels() const override;
279 
282  bool CanStoreResolution() const override;
283 
286  bool CanStoreKeywords() const override;
287 
290  bool CanStoreICCProfiles() const override;
291 
294  bool CanStoreThumbnails() const override;
295 
298  bool CanStoreProperties() const override;
299 
302  bool CanStoreImageProperties() const override;
303 
306  bool CanStoreRGBWS() const override;
307 
310  bool CanStoreDisplayFunctions() const override;
311 
314  bool CanStoreColorFilterArrays() const override;
315 
318  bool SupportsCompression() const override;
319 
322  bool SupportsMultipleImages() const override;
323 
326  bool SupportsViewProperties() const override;
327 
330  bool CanEditPreferences() const override;
331 
334  bool UsesFormatSpecificData() const override;
335 
338  bool IsDeprecated() const override;
339 
342  bool ValidateFormatSpecificData( const void* data ) const override;
343 
346  void DisposeFormatSpecificData( void* data ) const override;
347 
350  bool EditPreferences() const override;
351 
357 
376  static bool IsSupportedFileFormatBySuffix( const String& path, bool toRead = false, bool toWrite = false );
377 
401  static StringList SupportedImageFiles( const String& dirPath, bool toRead = false, bool toWrite = false,
402  bool recursive = false, bool followLinks = true );
403 
426  static StringList LocalNormalizationFiles( const String& dirPath, bool recursive = false, bool followLinks = true );
427 
449  static StringList DrizzleFiles( const String& dirPath, bool recursive = false, bool followLinks = true );
450 
472  static StringList EphemerisFiles( const String& dirPath, bool recursive = false, bool followLinks = true );
473 
474 private:
475 
477 
478  FileFormat( const void* );
479 
480  const void* Handle() const;
481 
482  friend class FileFormatPrivate;
483  friend class FileFormatInstance;
484 };
485 
486 // ----------------------------------------------------------------------------
487 
488 } // pcl
489 
490 #endif // __PCL_BUILDING_PIXINSIGHT_APPLICATION
491 
492 #endif // __PCL_FileFormat_h
493 
494 // ----------------------------------------------------------------------------
495 // EOF pcl/FileFormat.h - Released 2024-06-18T15:48:54Z
Client-side interface to a PixInsight Bitmap object.
Definition: Bitmap.h:204
Abstract base class for image file format descriptions.
High-level interface to an image file format instance.
High-level interface to an installed image file format.
Definition: FileFormat.h:98
static StringList EphemerisFiles(const String &dirPath, bool recursive=false, bool followLinks=true)
void DisposeFormatSpecificData(void *data) const override
static StringList DrizzleFiles(const String &dirPath, bool recursive=false, bool followLinks=true)
bool SupportsMultipleImages() const override
Bitmap SmallIcon() const override
bool CanStore32Bit() const override
bool CanStoreDisplayFunctions() const override
bool CanStoreDouble() const override
bool CanStoreKeywords() const override
bool CanStore8Bit() const override
bool ValidateFormatSpecificData(const void *data) const override
bool CanStoreDComplex() const override
bool CanWrite() const override
bool CanEditPreferences() const override
bool CanStoreRGBWS() const override
bool EditPreferences() const override
bool CanStore16Bit() const override
bool SupportsViewProperties() const override
bool CanStoreProperties() const override
bool CanStore64Bit() const override
bool CanStoreImageProperties() const override
bool CanStoreICCProfiles() const override
bool CanReadIncrementally() const override
bool CanStoreColorFilterArrays() const override
bool CanRead() const override
IsoStringList MimeTypes() const override
bool UsesFormatSpecificData() const override
Bitmap Icon() const override
bool CanStoreFloat() const override
static StringList LocalNormalizationFiles(const String &dirPath, bool recursive=false, bool followLinks=true)
static bool IsSupportedFileFormatBySuffix(const String &path, bool toRead=false, bool toWrite=false)
bool CanStoreRGBColor() const override
FileFormat(const FileFormat &fmt)
bool CanStoreAlphaChannels() const override
~FileFormat() override
bool CanWriteIncrementally() const override
bool CanStoreComplex() const override
static Array< FileFormat > AllFormats()
FileFormat(const String &nameExtOrMime, bool toRead=false, bool toWrite=false)
bool SupportsCompression() const override
uint32 Version() const override
static StringList SupportedImageFiles(const String &dirPath, bool toRead=false, bool toWrite=false, bool recursive=false, bool followLinks=true)
String Status() const override
bool CanStoreResolution() const override
bool CanStoreThumbnails() const override
String Implementation() const override
String Description() const override
IsoString Name() const override
StringList FileExtensions() const override
bool IsDeprecated() const override
bool CanStoreGrayscale() const override
Eight-bit string (ISO/IEC-8859-1 or UTF-8 string)
Definition: String.h:5425
Unicode (UTF-16) string.
Definition: String.h:8113
unsigned int uint32
Definition: Defs.h:666
PCL root namespace.
Definition: AbstractImage.h:77