Add new XISFModify class to edit FITSKeywords

This commit is contained in:
2024-05-02 23:00:06 +02:00
parent 87d65a31fc
commit 24a1b0ecc4
2 changed files with 353 additions and 1 deletions
+37
View File
@@ -35,6 +35,7 @@ namespace LibXISF
class XISFReaderPrivate;
class XISFWriterPrivate;
class XISFModifyPrivate;
class LIBXISF_EXPORT ByteArray
{
@@ -405,6 +406,42 @@ public:
const char* what() const noexcept { return _msg.c_str(); }
};
class LIBXISF_EXPORT XISFModify
{
public:
XISFModify();
virtual ~XISFModify();
void open(const String &name);
void open(const ByteArray &data);
void open(std::istream *io);
void close();
void save(const String &name);
void save(ByteArray &data);
void save(std::ostream &io);
/**
* @brief addFITSKeyword append new keyword to image
* @param image index of image to update
* @param keyword that will be added
*/
void addFITSKeyword(uint32_t image, const FITSKeyword &keyword);
/**
* @brief updateFITSKeyword update keyword with same name
* @param image index of image to update
* @param keyword that will be updated
* @param add if true then it will add new keyword in case that it doesn't exists
*/
void updateFITSKeyword(uint32_t image, const FITSKeyword &keyword, bool add);
/**
* @brief removeFITSKeyword remove keyword with name from image
* @param image index of image to update
* @param name of keyword that will be removed
*/
void removeFITSKeyword(uint32_t image, const String &name);
private:
XISFModifyPrivate *p;
};
template<typename T>
constexpr Image::SampleFormat Image::sampleFormatEnum()
{