Load XISF::ReadImageProperties
This commit is contained in:
@@ -5,6 +5,7 @@
|
||||
#include <wcslib/wcshdr.h>
|
||||
#include <wcslib/wcsfix.h>
|
||||
#include "pcl/FITSHeaderKeyword.h"
|
||||
#include "pcl/Property.h"
|
||||
|
||||
static const QVector<QByteArray> noEditableKey = {"SIMPLE", "BITPIX", "NAXIS", "NAXIS1", "NAXIS2", "NAXIS3", "EXTEND", "BZERO", "BSCALE"};
|
||||
|
||||
@@ -43,6 +44,38 @@ FITSRecord::FITSRecord(const pcl::FITSHeaderKeyword &record)
|
||||
value = string;
|
||||
}
|
||||
|
||||
FITSRecord::FITSRecord(const pcl::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;
|
||||
}
|
||||
}
|
||||
|
||||
QByteArray FITSRecord::valueToByteArray() const
|
||||
{
|
||||
if(value.type() == QVariant::Bool)
|
||||
|
||||
Reference in New Issue
Block a user