Reduce rawimage.h dependencies

This commit is contained in:
Ingo Weyrich 2019-10-29 15:21:02 +01:00
parent c11087c28d
commit ed161c6288
21 changed files with 50 additions and 35 deletions

View File

@ -20,6 +20,7 @@
#include "array2D.h" #include "array2D.h"
#include "median.h" #include "median.h"
#include "pixelsmap.h" #include "pixelsmap.h"
#include "rawimage.h"
#include "rawimagesource.h" #include "rawimagesource.h"
namespace rtengine namespace rtengine

View File

@ -20,6 +20,7 @@
#include <iostream> #include <iostream>
#include "rtengine.h" #include "rtengine.h"
#include "rawimage.h"
#include "rawimagesource.h" #include "rawimagesource.h"
#include "rt_math.h" #include "rt_math.h"
#include "procparams.h" #include "procparams.h"

View File

@ -21,6 +21,7 @@
#include <cstdio> #include <cstdio>
#include <cstring> #include <cstring>
#include <functional> #include <functional>
#include <glib/gstdio.h>
#include "dcp.h" #include "dcp.h"

View File

@ -30,6 +30,7 @@
namespace rtengine namespace rtengine
{ {
class RawImage;
class dfInfo class dfInfo
{ {
public: public:

View File

@ -20,6 +20,7 @@
#include <cmath> #include <cmath>
#include "color.h" #include "color.h"
#include "rawimage.h"
#include "rawimagesource.h" #include "rawimagesource.h"
#include "rawimagesource_i.h" #include "rawimagesource_i.h"
#include "jaggedarray.h" #include "jaggedarray.h"

View File

@ -50,6 +50,13 @@ inline ffInfo& ffInfo::operator =(const ffInfo &o)
return *this; return *this;
} }
ffInfo::~ffInfo()
{
if( ri ) {
delete ri;
}
}
bool ffInfo::operator <(const ffInfo &e2) const bool ffInfo::operator <(const ffInfo &e2) const
{ {
if( this->maker.compare( e2.maker) >= 0 ) { if( this->maker.compare( e2.maker) >= 0 ) {

View File

@ -19,16 +19,16 @@
#pragma once #pragma once
#include <cmath> #include <cmath>
#include <list>
#include <map> #include <map>
#include <string> #include <string>
#include <glibmm/ustring.h> #include <glibmm/ustring.h>
#include "rawimage.h"
namespace rtengine namespace rtengine
{ {
class RawImage;
class ffInfo class ffInfo
{ {
public: public:
@ -48,13 +48,8 @@ public:
ffInfo( const ffInfo &o) ffInfo( const ffInfo &o)
: pathname(o.pathname), maker(o.maker), model(o.model), lens(o.lens), aperture(o.aperture), focallength(o.focallength), timestamp(o.timestamp), ri(nullptr) {} : pathname(o.pathname), maker(o.maker), model(o.model), lens(o.lens), aperture(o.aperture), focallength(o.focallength), timestamp(o.timestamp), ri(nullptr) {}
~ffInfo()
{
if( ri ) {
delete ri;
}
}
~ffInfo();
ffInfo &operator =(const ffInfo &o); ffInfo &operator =(const ffInfo &o);
bool operator <(const ffInfo &e2) const; bool operator <(const ffInfo &e2) const;

View File

@ -23,6 +23,7 @@
#include <omp.h> #include <omp.h>
#endif #endif
#include "rawimage.h"
#include "rawimagesource.h" #include "rawimagesource.h"
#include "mytime.h" #include "mytime.h"

View File

@ -18,6 +18,7 @@
*/ */
#include <cmath> #include <cmath>
#include "rawimage.h"
#include "rawimagesource.h" #include "rawimagesource.h"
#include "rawimagesource_i.h" #include "rawimagesource_i.h"
#include "jaggedarray.h" #include "jaggedarray.h"

View File

@ -21,7 +21,6 @@
#include <cstdio> #include <cstdio>
#include <memory> #include <memory>
#include "rawimage.h"
#include <string> #include <string>
#include <glibmm.h> #include <glibmm.h>
#include "../rtexif/rtexif.h" #include "../rtexif/rtexif.h"

View File

@ -19,6 +19,7 @@
*/ */
#include "pdaflinesfilter.h" #include "pdaflinesfilter.h"
#include "rawimage.h"
#include "settings.h" #include "settings.h"
#include <iostream> #include <iostream>
#include "camconst.h" #include "camconst.h"

View File

@ -26,6 +26,8 @@
namespace rtengine { namespace rtengine {
class RawImage;
class PDAFLinesFilter: public rtengine::NonCopyable class PDAFLinesFilter: public rtengine::NonCopyable
{ {
public: public:

View File

@ -16,8 +16,7 @@
* You should have received a copy of the GNU General Public License * You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>. * along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/ */
#ifndef __RAWIMAGE_H #pragma once
#define __RAWIMAGE_H
#include <ctime> #include <ctime>
#include <cmath> #include <cmath>
@ -307,5 +306,3 @@ public:
}; };
} }
#endif // __RAWIMAGE_H

View File

@ -21,6 +21,7 @@
#include "rtengine.h" #include "rtengine.h"
#include "imagefloat.h" #include "imagefloat.h"
#include "rawimage.h"
#include "rawimagesource.h" #include "rawimagesource.h"
#include "rawimagesource_i.h" #include "rawimagesource_i.h"
#include "jaggedarray.h" #include "jaggedarray.h"
@ -501,6 +502,26 @@ RawImageSource::~RawImageSource ()
} }
} }
unsigned RawImageSource::FC(int row, int col) const
{
return ri->FC(row, col);
}
eSensorType RawImageSource::getSensorType () const
{
return ri != nullptr ? ri->getSensorType() : ST_NONE;
}
bool RawImageSource::isMono() const
{
return ri->get_colors() == 1;
}
int RawImageSource::getRotateDegree() const
{
return ri->get_rotateDegree();
}
//%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% //%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
void RawImageSource::transformRect (const PreviewProps &pp, int tran, int &ssx1, int &ssy1, int &width, int &height, int &fw) void RawImageSource::transformRect (const PreviewProps &pp, int tran, int &ssx1, int &ssy1, int &width, int &height, int &fw)

View File

@ -33,7 +33,7 @@
namespace rtengine namespace rtengine
{ {
class RawImage;
class DiagonalCurve; class DiagonalCurve;
class RetinextransmissionCurve; class RetinextransmissionCurve;
class RetinexgaintransmissionCurve; class RetinexgaintransmissionCurve;
@ -110,10 +110,7 @@ protected:
void transformRect (const PreviewProps &pp, int tran, int &sx1, int &sy1, int &width, int &height, int &fw); void transformRect (const PreviewProps &pp, int tran, int &sx1, int &sy1, int &width, int &height, int &fw);
void transformPosition (int x, int y, int tran, int& tx, int& ty); void transformPosition (int x, int y, int tran, int& tx, int& ty);
unsigned FC(int row, int col) const unsigned FC(int row, int col) const;
{
return ri->FC(row, col);
}
inline void getRowStartEnd (int x, int &start, int &end); inline void getRowStartEnd (int x, int &start, int &end);
static void getProfilePreprocParams(cmsHPROFILE in, float& gammafac, float& lineFac, float& lineSum); static void getProfilePreprocParams(cmsHPROFILE in, float& gammafac, float& lineFac, float& lineSum);
@ -147,15 +144,9 @@ public:
void scaleColors (int winx, int winy, int winw, int winh, const procparams::RAWParams &raw, array2D<float> &rawData); // raw for cblack void scaleColors (int winx, int winy, int winw, int winh, const procparams::RAWParams &raw, array2D<float> &rawData); // raw for cblack
void getImage (const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const procparams::ToneCurveParams &hrp, const procparams::RAWParams &raw) override; void getImage (const ColorTemp &ctemp, int tran, Imagefloat* image, const PreviewProps &pp, const procparams::ToneCurveParams &hrp, const procparams::RAWParams &raw) override;
eSensorType getSensorType () const override eSensorType getSensorType () const override;
{ bool isMono () const override;
return ri != nullptr ? ri->getSensorType() : ST_NONE; ColorTemp getWB () const override
}
bool isMono () const override
{
return ri->get_colors() == 1;
}
ColorTemp getWB () const override
{ {
return camera_wb; return camera_wb;
} }
@ -173,10 +164,7 @@ public:
void getFullSize (int& w, int& h, int tr = TR_NONE) override; void getFullSize (int& w, int& h, int tr = TR_NONE) override;
void getSize (const PreviewProps &pp, int& w, int& h) override; void getSize (const PreviewProps &pp, int& w, int& h) override;
int getRotateDegree() const override int getRotateDegree() const override;
{
return ri->get_rotateDegree();
}
ImageMatrices* getImageMatrices () override ImageMatrices* getImageMatrices () override
{ {

View File

@ -21,6 +21,7 @@
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
#include "rtengine.h" #include "rtengine.h"
#include "rawimage.h"
#include "rawimagesource.h" #include "rawimagesource.h"
#include "procparams.h" #include "procparams.h"
#include "../rtgui/multilangmgr.h" #include "../rtgui/multilangmgr.h"

View File

@ -20,6 +20,7 @@
//////////////////////////////////////////////////////////////// ////////////////////////////////////////////////////////////////
#include "rtengine.h" #include "rtengine.h"
#include "rawimage.h"
#include "rawimagesource.h" #include "rawimagesource.h"
#include "rt_algo.h" #include "rt_algo.h"
#include "rt_math.h" #include "rt_math.h"

View File

@ -22,7 +22,6 @@
#include <gtkmm.h> #include <gtkmm.h>
#include "adjuster.h" #include "adjuster.h"
#include "toolpanel.h" #include "toolpanel.h"
#include "../rtengine/rawimage.h"
class BayerPreProcess : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel class BayerPreProcess : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel
{ {

View File

@ -24,7 +24,6 @@
#include "toolpanel.h" #include "toolpanel.h"
#include "adjuster.h" #include "adjuster.h"
#include "guiutils.h" #include "guiutils.h"
#include "../rtengine/rawimage.h"
class PreProcess : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel class PreProcess : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel
{ {

View File

@ -22,7 +22,6 @@
#include <gtkmm.h> #include <gtkmm.h>
#include "adjuster.h" #include "adjuster.h"
#include "toolpanel.h" #include "toolpanel.h"
#include "../rtengine/rawimage.h"
class RAWExposure : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel class RAWExposure : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel
{ {

View File

@ -22,7 +22,6 @@
#include <gtkmm.h> #include <gtkmm.h>
#include "adjuster.h" #include "adjuster.h"
#include "toolpanel.h" #include "toolpanel.h"
#include "../rtengine/rawimage.h"
class XTransRAWExposure : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel class XTransRAWExposure : public ToolParamBlock, public AdjusterListener, public FoldableToolPanel
{ {