Replace PCL with LibXISF
This commit is contained in:
+9
-35
@@ -4,8 +4,7 @@
|
||||
#include <QHeaderView>
|
||||
#include <wcslib/wcshdr.h>
|
||||
#include <wcslib/wcsfix.h>
|
||||
#include "pcl/FITSHeaderKeyword.h"
|
||||
#include "pcl/Property.h"
|
||||
#include <libxisf.h>
|
||||
|
||||
static const QVector<QByteArray> noEditableKey = {"SIMPLE", "BITPIX", "NAXIS", "NAXIS1", "NAXIS2", "NAXIS3", "EXTEND", "BZERO", "BSCALE"};
|
||||
|
||||
@@ -19,12 +18,12 @@ FITSRecord::FITSRecord(const QByteArray &key, const QVariant &value, const QByte
|
||||
{
|
||||
}
|
||||
|
||||
FITSRecord::FITSRecord(const pcl::FITSHeaderKeyword &record)
|
||||
FITSRecord::FITSRecord(const LibXISF::FITSKeyword &record)
|
||||
{
|
||||
key = record.name.c_str();
|
||||
comment = record.comment.c_str();
|
||||
key = record.name.toUtf8();
|
||||
comment = record.comment.toUtf8();
|
||||
|
||||
QString string = record.value.c_str();
|
||||
QString string = record.value;
|
||||
if(string.startsWith('\'') && string.endsWith('\''))
|
||||
{
|
||||
string.chop(1);
|
||||
@@ -44,36 +43,11 @@ FITSRecord::FITSRecord(const pcl::FITSHeaderKeyword &record)
|
||||
value = string;
|
||||
}
|
||||
|
||||
FITSRecord::FITSRecord(const pcl::Property &property)
|
||||
FITSRecord::FITSRecord(const LibXISF::Property &property)
|
||||
{
|
||||
key = property.Identifier().c_str();
|
||||
|
||||
const pcl::Variant &pclval = property.Value();
|
||||
switch(pclval.Type())
|
||||
{
|
||||
case pcl::VariantType::Bool:
|
||||
value = pclval.ToBool();
|
||||
break;
|
||||
case pcl::VariantType::Int8:
|
||||
case pcl::VariantType::Int16:
|
||||
case pcl::VariantType::Int32:
|
||||
case pcl::VariantType::Int64:
|
||||
value = pclval.ToInt64();
|
||||
break;
|
||||
case pcl::VariantType::UInt8:
|
||||
case pcl::VariantType::UInt16:
|
||||
case pcl::VariantType::UInt32:
|
||||
case pcl::VariantType::UInt64:
|
||||
value = pclval.ToUInt64();
|
||||
break;
|
||||
case pcl::VariantType::Float:
|
||||
case pcl::VariantType::Double:
|
||||
value = pclval.ToDouble();
|
||||
break;
|
||||
default:
|
||||
value = pclval.ToIsoString().c_str();
|
||||
break;
|
||||
}
|
||||
key = property.id.toUtf8();
|
||||
value = property.value;
|
||||
comment = property.comment.toUtf8();
|
||||
}
|
||||
|
||||
QByteArray FITSRecord::valueToByteArray() const
|
||||
|
||||
Reference in New Issue
Block a user