/****************************************************************************** * * Purpose: Support for reading and manipulating PCIDSK Polynomial Segments * ****************************************************************************** * Copyright (c) 2009 * PCI Geomatics, 90 Allstate Parkway, Markham, Ontario, Canada. * * SPDX-License-Identifier: MIT ****************************************************************************/ #ifndef INCLUDE_PCIDSK_SEGMENT_PCIDSKPOLYMODEL_H #define INCLUDE_PCIDSK_SEGMENT_PCIDSKPOLYMODEL_H #include "pcidsk_poly.h" #include "segment/cpcidsksegment.h" namespace PCIDSK { class PCIDSKFile; class CPCIDSKPolyModelSegment final: public PCIDSKPolySegment, public CPCIDSKSegment { public: CPCIDSKPolyModelSegment(PCIDSKFile *file, int segment,const char *segment_pointer); ~CPCIDSKPolyModelSegment() override; std::vector GetXForwardCoefficients() const override; std::vector GetYForwardCoefficients() const override; std::vector GetXBackwardCoefficients() const override; std::vector GetYBackwardCoefficients() const override; void SetCoefficients(const std::vector& oXForward, const std::vector& oYForward, const std::vector& oXBackward, const std::vector& oYBackward) override ; unsigned int GetLines() const override; unsigned int GetPixels() const override; void SetRasterSize(unsigned int nLines,unsigned int nPixels) override ; std::string GetGeosysString() const override; void SetGeosysString(const std::string& oGeosys) override ; std::vector GetProjParamInfo() const override; void SetProjParamInfo(const std::vector& oInfo) override ; //synchronize the segment on disk. void Synchronize() override; private: // Helper housekeeping functions void Load(); void Write(); // Struct to store details of the RPC model struct PCIDSKPolyInfo { // number of coefficients unsigned int nNumCoeffs; // pixels in the image unsigned int nPixels; // lines in the image unsigned int nLines; // Forward Coefficients (Geo2Img) std::vector vdfX1; // Forward Coefficients (Geo2Img) std::vector vdfY1; // Backward Coefficients Img2Geo std::vector vdfX2; // Backward Coefficients Img2Geo std::vector vdfY2; //map units of required projection std::string oMapUnit; //proj param info of required projection std::vector oProjectionInfo; // The raw segment data PCIDSKBuffer seg_data; }; PCIDSKPolyInfo *pimpl_; bool loaded_; bool mbModified; }; } #endif // INCLUDE_PCIDSK_SEGMENT_PCIDSKPOLYMODEL_H