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;
208 Parse( filePath, options );
229 Parse( xml, options );
248 Parse( element, options );
280 return m_sourceFilePath;
306 return m_cfaSourceFilePath;
333 return m_cfaSourcePattern;
347 m_cfaSourcePattern = cfaPattern;
373 return m_cfaSourceChannel;
410 return m_alignTargetFilePath;
431 return m_referenceWidth;
441 return m_referenceHeight;
452 m_referenceWidth = width;
453 m_referenceHeight = height;
462 return m_location.Length();
474 return m_alignmentOrigin;
490 m_alignmentOrigin = p0;
524 return !m_H.IsEmpty();
561 return m_S.IsValid();
598 return m_Sinv.IsValid();
656 int& order,
float& regularization,
bool& extrapolate )
663 order = m_localDistortionOrder;
664 regularization = m_localDistortionRegularization;
665 extrapolate = m_localDistortionExtrapolation;
680 return !m_LP1.IsEmpty();
703 m_metadata = metadata.Trimmed();
753 return m_referenceLocation;
766 m_referenceLocation = v;
795 if ( !m_scale.IsEmpty() )
797 if ( m_unitScale.IsEmpty() )
798 m_unitScale =
DVector( 1.0, NumberOfChannels() );
827 return m_adaptiveCoordinates;
839 m_adaptiveCoordinates = points;
859 return m_adaptiveLocation;
872 m_adaptiveLocation = m;
924 sLow = m_adaptiveScaleLow;
925 sHigh = m_adaptiveScaleHigh;
937 m_adaptiveScaleLow = sLow;
938 m_adaptiveScaleHigh = sHigh;
960 mLow = m_adaptiveZeroOffsetLow;
961 mHigh = m_adaptiveZeroOffsetHigh;
973 m_adaptiveZeroOffsetLow = mLow;
974 m_adaptiveZeroOffsetHigh = mHigh;
985 return !m_adaptiveCoordinates.IsEmpty() &&
986 !m_adaptiveLocation.IsEmpty() &&
987 !m_adaptiveScaleLow.IsEmpty() &&
988 !m_adaptiveScaleHigh.IsEmpty() &&
989 !m_adaptiveZeroOffsetLow.IsEmpty() &&
990 !m_adaptiveZeroOffsetHigh.IsEmpty();
1009 m_pedestal =
Range( p, 0.0, 1.0 );
1025 if ( !m_weight.IsEmpty() )
1027 if ( m_unitWeight.IsEmpty() )
1028 m_unitWeight =
DVector( 1.0, NumberOfChannels() );
1029 return m_unitWeight;
1052 return !m_location.IsEmpty();
1063 return !m_weight.IsEmpty();
1079 return m_rejectionLowCount;
1095 return m_rejectionHighCount;
1147 return m_rejectionMap;
1158 return m_rejectionMap.Includes( position )
1159 && m_rejectionMap.IsValidChannelIndex( channel )
1160 && (m_rejectionMap( position, channel ) & 0x3F) != 0;
1172 m_rejectionMap = map;
1181 return !m_rejectionMap.IsEmpty();
1190 return m_creationTime;
1280 return m_compressionEnabled;
1290 m_compressionEnabled = enable;
1300 EnableCompression( !disable );
1325 String m_cfaSourceFilePath;
1326 String m_cfaSourcePattern;
1327 int m_cfaSourceChannel = -1;
1328 String m_alignTargetFilePath;
1329 int m_referenceWidth = -1;
1330 int m_referenceHeight = -1;
1331 DPoint m_alignmentOrigin = 0.5;
1340 int m_localDistortionOrder = 2;
1341 float m_localDistortionRegularization = 0.01F;
1342 bool m_localDistortionExtrapolation =
true;
1344 double m_pedestal = 0.0;
1346 Vector m_referenceLocation;
1348 mutable Vector m_unitScale;
1350 mutable Vector m_unitWeight;
1361 bool m_compressionEnabled =
true;
1364 void SerializeRejectionMap(
XMLElement* )
const;
1376 void SerializeMaybeCompressedData(
XMLElement* root,
1379 template <
typename T>
1382 template <
typename T>
1393 class PlainTextDecoder
1408 PlainTextDecoder(
DrizzleData* data,
bool ignoreIntegrationData )
1410 , m_ignoreIntegrationData( ignoreIntegrationData )
1414 virtual ~PlainTextDecoder()
1422 PlainTextDecoder() =
default;
1426 DrizzleData* m_data =
nullptr;
1427 bool m_ignoreIntegrationData =
false;
1431 static rejection_coordinates ParseRejectionCoordinates( IsoString&,
size_type,
size_type );
1436 class PlainTextSplineDecoder :
public PlainTextDecoder
1440 PlainTextSplineDecoder( spline& S )
1452 friend class DrizzleDataPrivate;
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.
typename container_type::item_type item_type
size_type Size() const noexcept
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