52 #ifndef __PCL_DrizzleData_h
53 #define __PCL_DrizzleData_h
83 namespace DrizzleParserOption
87 IgnoreIntegrationData = 0x00000001,
88 RequireIntegrationData = 0x00000002,
100 class PCL_CLASS XMLDocument;
101 class PCL_CLASS XMLElement;
219 Parse( filePath, options );
240 Parse( xml, options );
259 Parse( element, options );
291 return m_sourceFilePath;
317 return m_cfaSourceFilePath;
344 return m_cfaSourcePattern;
358 m_cfaSourcePattern = cfaPattern;
384 return m_cfaSourceChannel;
421 return m_alignTargetFilePath;
442 return m_referenceWidth;
452 return m_referenceHeight;
463 m_referenceWidth = width;
464 m_referenceHeight = height;
473 return m_location.Length();
485 return m_alignmentOrigin;
501 m_alignmentOrigin = p0;
535 return !m_H.IsEmpty();
572 return m_S.IsValid();
609 return m_Sinv.IsValid();
667 int& order,
float& regularization,
bool& extrapolate )
674 order = m_localDistortionOrder;
675 regularization = m_localDistortionRegularization;
676 extrapolate = m_localDistortionExtrapolation;
691 return !m_LP1.IsEmpty();
714 m_metadata = metadata.Trimmed();
764 return m_referenceLocation;
777 m_referenceLocation = v;
806 if ( !m_scale.IsEmpty() )
808 if ( m_unitScale.IsEmpty() )
809 m_unitScale =
DVector( 1.0, NumberOfChannels() );
838 return m_adaptiveCoordinates;
850 m_adaptiveCoordinates = points;
870 return m_adaptiveLocation;
883 m_adaptiveLocation = m;
935 sLow = m_adaptiveScaleLow;
936 sHigh = m_adaptiveScaleHigh;
948 m_adaptiveScaleLow = sLow;
949 m_adaptiveScaleHigh = sHigh;
971 mLow = m_adaptiveZeroOffsetLow;
972 mHigh = m_adaptiveZeroOffsetHigh;
984 m_adaptiveZeroOffsetLow = mLow;
985 m_adaptiveZeroOffsetHigh = mHigh;
996 return !m_adaptiveCoordinates.IsEmpty() &&
997 !m_adaptiveLocation.IsEmpty() &&
998 !m_adaptiveScaleLow.IsEmpty() &&
999 !m_adaptiveScaleHigh.IsEmpty() &&
1000 !m_adaptiveZeroOffsetLow.IsEmpty() &&
1001 !m_adaptiveZeroOffsetHigh.IsEmpty();
1020 m_pedestal =
Range( p, 0.0, 1.0 );
1036 if ( !m_weight.IsEmpty() )
1038 if ( m_unitWeight.IsEmpty() )
1039 m_unitWeight =
DVector( 1.0, NumberOfChannels() );
1040 return m_unitWeight;
1063 return !m_location.IsEmpty();
1074 return !m_weight.IsEmpty();
1090 return m_rejectionLowCount;
1106 return m_rejectionHighCount;
1158 return m_rejectionMap;
1169 return m_rejectionMap.Includes( position )
1170 && m_rejectionMap.IsValidChannelIndex( channel )
1171 && (m_rejectionMap( position, channel ) & 0x3F) != 0;
1183 m_rejectionMap = map;
1192 return !m_rejectionMap.IsEmpty();
1201 return m_creationTime;
1291 return m_compressionEnabled;
1301 m_compressionEnabled = enable;
1311 EnableCompression( !disable );
1336 String m_cfaSourceFilePath;
1337 String m_cfaSourcePattern;
1338 int m_cfaSourceChannel = -1;
1339 String m_alignTargetFilePath;
1340 int m_referenceWidth = -1;
1341 int m_referenceHeight = -1;
1342 DPoint m_alignmentOrigin = 0.5;
1351 int m_localDistortionOrder = 2;
1352 float m_localDistortionRegularization = 0.01F;
1353 bool m_localDistortionExtrapolation =
true;
1355 double m_pedestal = 0.0;
1357 Vector m_referenceLocation;
1359 mutable Vector m_unitScale;
1361 mutable Vector m_unitWeight;
1372 bool m_compressionEnabled =
true;
1387 void SerializeRejectionMap(
XMLElement* )
const;
1399 void SerializeMaybeCompressedData(
XMLElement* root,
1407 class PlainTextDecoder
1411 PlainTextDecoder(
DrizzleData* data,
bool ignoreIntegrationData )
1413 , m_ignoreIntegrationData( ignoreIntegrationData )
1417 virtual ~PlainTextDecoder()
1425 PlainTextDecoder() =
default;
1429 DrizzleData* m_data =
nullptr;
1430 bool m_ignoreIntegrationData =
false;
1434 static rejection_coordinates ParseRejectionCoordinates( IsoString&,
size_type,
size_type );
1439 class PlainTextSplineDecoder :
public PlainTextDecoder
1443 PlainTextSplineDecoder( spline& S )
Drizzle integration data parser and generator.
XMLDocument * Serialize() const
bool HasImageWeightsData() const
void Parse(const XMLElement &element, DrizzleParserOptions options=DrizzleParserOptions())
void SetPedestal(double p)
void SetAlignmentInverseSplines(const vector_spline &Sinv)
void DisableCompression(bool disable=true)
DrizzleData(DrizzleData &&)=default
const DVector & Weight() const
void EnableCompression(bool enable=true)
void ClearIntegrationData()
const String & AlignmentTargetFilePath() const
void SetReferenceDimensions(int width, int height)
void SetSourceFilePath(const String &filePath)
void Parse(const String &filePath, DrizzleParserOptions options=DrizzleParserOptions())
void SetCFASourceChannel(int channel)
void SerializeToFile(const String &path) const
DrizzleData(const String &filePath, DrizzleParserOptions options=DrizzleParserOptions())
void SetLocation(const DVector &v)
const DVector & ReferenceLocation() const
void SetAlignmentMatrix(const Matrix &H)
const vector_spline & AlignmentSplines() const
const MultiVector & AdaptiveNormalizationLocationVectors() const
void SetAlignmentSplines(const vector_spline &S)
bool HasAlignmentSplines() const
int NumberOfChannels() const
const UI64Vector & RejectionHighCount() const
int CFASourceChannel() const
void SetRejectionMap(const UInt8Image &map)
const String & Metadata() const
void SetAdaptiveNormalizationZeroOffsetVectors(const MultiVector &mLow, const MultiVector &mHigh)
DrizzleData(const DrizzleData &)=default
void SetCFASourceFilePath(const String &filePath)
const point_list & AdaptiveNormalizationCoordinates() const
void SetCFASourcePattern(const String &cfaPattern)
bool HasAlignmentMatrix() const
void SetAdaptiveNormalizationCoordinates(const point_list &points)
void SetScale(const DVector &v)
const String & CFASourcePattern() const
const String & SourceFilePath() const
bool IsCompressionEnabled() const
void GetLocalDistortionModel(point_list &P1, point_list &D2, point_list &P2, point_list &D1, weight_vector &W, int &order, float ®ularization, bool &extrapolate)
void SetReferenceLocation(const DVector &v)
void SetWeight(const DVector &v)
bool HasLocalDistortionModel() const
const vector_spline & AlignmentInverseSplines() const
bool HasAlignmentInverseSplines() const
bool HasIntegrationData() const
bool HasAdaptiveNormalizationData() const
const UI64Vector & RejectionLowCount() const
const Matrix & AlignmentMatrix() const
const DVector & Scale() const
void Parse(const XMLDocument &xml, DrizzleParserOptions options=DrizzleParserOptions())
void SetAlignmentTargetFilePath(const String &filePath)
void SetAdaptiveNormalizationScaleVectors(const MultiVector &sLow, const MultiVector &sHigh)
bool HasRejectionData() const
const UInt8Image & RejectionMap() const
void SetAlignmentOrigin(const DPoint &p0)
const DVector & Location() const
bool IsRejected(const Point &position, int channel=0) const
int ReferenceWidth() const
DrizzleData(const XMLElement &element, DrizzleParserOptions options=DrizzleParserOptions())
const DPoint & AlignmentOrigin() const
DrizzleData(const XMLDocument &xml, DrizzleParserOptions options=DrizzleParserOptions())
void GetAdaptiveNormalizationZeroOffsetVectors(MultiVector &mLow, MultiVector &mHigh) const
const String & CFASourceFilePath() const
TimePoint CreationTime() const
void GetAdaptiveNormalizationScaleVectors(MultiVector &sLow, MultiVector &sHigh) const
int ReferenceHeight() const
void SetAdaptiveNormalizationLocationVectors(const MultiVector &m)
void SetMetadata(const String &metadata)
A collection of Drizzle data parsing options.
static String FullPath(const String &path)
A type-safe collection of enumerated flags.
Generic dynamic matrix of arbitrary dimensions.
Generic array of vectors.
A generic point in the two-dimensional space.
Generic vector of arbitrary length.
Vector surface spline interpolation/approximation in two dimensions.
An instant in any timescale.
XML document parsing and generation
constexpr const T & Range(const T &x, const T &a, const T &b) noexcept