Further reduction of include dependencies

This commit is contained in:
Ingo Weyrich 2019-11-01 12:51:08 +01:00
parent 785273e7bf
commit 962f81f6bc
12 changed files with 93 additions and 59 deletions

View File

@ -28,6 +28,7 @@
#include <sstream>
#include <string>
#include "cachemanager.h"
#include "thumbnail.h"
#include "batchqueue.h"
#include "multilangmgr.h"

View File

@ -17,8 +17,24 @@
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include "bqentryupdater.h"
#include <gtkmm.h>
#include "guiutils.h"
#include "../rtengine/utils.h"
namespace
{
void thumbInterp(const unsigned char* src, int sw, int sh, unsigned char* dst, int dw, int dh)
{
if (options.thumbInterp == 0) {
rtengine::nearestInterp (src, sw, sh, dst, dw, dh);
} else if (options.thumbInterp == 1) {
rtengine::bilinearInterp (src, sw, sh, dst, dw, dh);
}
}
}
BatchQueueEntryUpdater batchQueueEntryUpdater;
@ -27,7 +43,7 @@ BatchQueueEntryUpdater::BatchQueueEntryUpdater ()
{
}
void BatchQueueEntryUpdater::process (guint8* oimg, int ow, int oh, int newh, BQEntryUpdateListener* listener, rtengine::ProcParams* pparams, Thumbnail* thumbnail)
void BatchQueueEntryUpdater::process (guint8* oimg, int ow, int oh, int newh, BQEntryUpdateListener* listener, rtengine::procparams::ProcParams* pparams, Thumbnail* thumbnail)
{
if (!oimg && (!pparams || !thumbnail)) {
//printf("WARNING! !oimg && (!pparams || !thumbnail)\n");

View File

@ -48,7 +48,7 @@ class BatchQueueEntryUpdater
guint8* oimg;
int ow, oh, newh;
BQEntryUpdateListener* listener;
rtengine::ProcParams* pparams;
rtengine::procparams::ProcParams* pparams;
Thumbnail* thumbnail;
};
@ -62,7 +62,7 @@ protected:
public:
BatchQueueEntryUpdater ();
void process (guint8* oimg, int ow, int oh, int newh, BQEntryUpdateListener* listener, rtengine::ProcParams* pparams = nullptr, Thumbnail* thumbnail = nullptr);
void process (guint8* oimg, int ow, int oh, int newh, BQEntryUpdateListener* listener, rtengine::procparams::ProcParams* pparams = nullptr, Thumbnail* thumbnail = nullptr);
void removeJobs (BQEntryUpdateListener* listener);
void terminate ();

View File

@ -217,16 +217,6 @@ bool removeIfThere (Gtk::Container* cont, Gtk::Widget* w, bool increference)
}
}
void thumbInterp (const unsigned char* src, int sw, int sh, unsigned char* dst, int dw, int dh)
{
if (options.thumbInterp == 0) {
rtengine::nearestInterp (src, sw, sh, dst, dw, dh);
} else if (options.thumbInterp == 1) {
rtengine::bilinearInterp (src, sw, sh, dst, dw, dh);
}
}
bool confirmOverwrite (Gtk::Window& parent, const std::string& filename)
{
bool safe = true;

View File

@ -48,7 +48,6 @@ class RTImage;
Glib::ustring escapeHtmlChars(const Glib::ustring &src);
bool removeIfThere (Gtk::Container* cont, Gtk::Widget* w, bool increference = true);
void thumbInterp (const unsigned char* src, int sw, int sh, unsigned char* dst, int dw, int dh);
bool confirmOverwrite (Gtk::Window& parent, const std::string& filename);
void writeFailed (Gtk::Window& parent, const std::string& filename);
void drawCrop (Cairo::RefPtr<Cairo::Context> cr, int imx, int imy, int imw, int imh, int startx, int starty, double scale, const rtengine::procparams::CropParams& cparams, bool drawGuide = true, bool useBgColor = true, bool fullImageVisible = true);

View File

@ -33,6 +33,7 @@
#include <cstdlib>
#include <locale.h>
#include <lensfun.h>
#include "cachemanager.h"
#include "options.h"
#include "soundman.h"
#include "rtimage.h"

View File

@ -18,6 +18,8 @@
*/
#include <set>
#include "cachemanager.h"
#include "filebrowserentry.h"
#include "previewloader.h"
#include "guiutils.h"
#include "threadutils.h"

View File

@ -22,10 +22,10 @@
#include <glibmm/ustring.h>
#include "filebrowserentry.h"
#include "../rtengine/noncopyable.h"
class FileBrowserEntry;
class PreviewLoaderListener
{
public:

View File

@ -88,7 +88,7 @@ void PreviewWindow::updatePreviewImage ()
cc->fill();
if (previewHandler->getCropParams().enabled) {
rtengine::CropParams cparams = previewHandler->getCropParams();
rtengine::procparams::CropParams cparams = previewHandler->getCropParams();
switch (options.cropGuides) {
case Options::CROP_GUIDE_NONE:
cparams.guide = "None";

View File

@ -19,6 +19,7 @@
#include <gtkmm.h>
#include "rtwindow.h"
#include "cachemanager.h"
#include "preferences.h"
#include "iccprofilecreator.h"
#include "cursormanager.h"

View File

@ -15,6 +15,7 @@
* You should have received a copy of the GNU General Public License
* along with RawTherapee. If not, see <https://www.gnu.org/licenses/>.
*/
#include "cachemanager.h"
#include "multilangmgr.h"
#include "thumbnail.h"
#include <sstream>
@ -25,6 +26,7 @@
#include "../rtengine/colortemp.h"
#include "../rtengine/imagedata.h"
#include "../rtengine/procparams.h"
#include "../rtengine/rtthumbnail.h"
#include <glib/gstdio.h>
#include "../rtengine/dynamicprofile.h"
@ -1151,3 +1153,48 @@ bool Thumbnail::imageLoad(bool loading)
return false;
}
void Thumbnail::getCamWB(double& temp, double& green) const
{
if (tpp) {
tpp->getCamWB (temp, green);
} else {
temp = green = -1.0;
}
}
void Thumbnail::getSpotWB(int x, int y, int rect, double& temp, double& green)
{
if (tpp) {
tpp->getSpotWB (getProcParams(), x, y, rect, temp, green);
} else {
temp = green = -1.0;
}
}
void Thumbnail::applyAutoExp (rtengine::procparams::ProcParams& pparams)
{
if (tpp) {
tpp->applyAutoExp (pparams);
}
}
const CacheImageData* Thumbnail::getCacheImageData()
{
return &cfs;
}
std::string Thumbnail::getMD5() const
{
return cfs.md5;
}
bool Thumbnail::isQuick() const
{
return cfs.thumbImgType == CacheImageData::QUICK_THUMBNAIL;
}
bool Thumbnail::isPParamsValid() const
{
return pparamsValid;
}

View File

@ -24,13 +24,21 @@
#include <glibmm/ustring.h>
#include "cacheimagedata.h"
#include "cachemanager.h"
#include "threadutils.h"
#include "thumbnaillistener.h"
#include "../rtengine/rtengine.h"
#include "../rtengine/rtthumbnail.h"
namespace rtengine
{
class Thumbnail;
namespace procparams
{
class ProcParams;
}
}
class CacheManager;
struct ParamsEdited;
@ -98,14 +106,8 @@ public:
void notifylisterners_procParamsChanged(int whoChangedIt);
bool isQuick() const
{
return cfs.thumbImgType == CacheImageData::QUICK_THUMBNAIL;
}
bool isPParamsValid() const
{
return pparamsValid;
}
bool isQuick() const;
bool isPParamsValid() const;
bool isRecentlySaved () const;
void imageDeveloped ();
void imageEnqueued ();
@ -123,29 +125,10 @@ public:
const Glib::ustring& getExifString () const;
const Glib::ustring& getDateTimeString () const;
void getCamWB (double& temp, double& green) const
{
if (tpp) {
tpp->getCamWB (temp, green);
} else {
temp = green = -1.0;
}
}
void getCamWB (double& temp, double& green) const;
void getAutoWB (double& temp, double& green, double equal, double tempBias);
void getSpotWB (int x, int y, int rect, double& temp, double& green)
{
if (tpp) {
tpp->getSpotWB (getProcParams(), x, y, rect, temp, green);
} else {
temp = green = -1.0;
}
}
void applyAutoExp (rtengine::procparams::ProcParams& pparams)
{
if (tpp) {
tpp->applyAutoExp (pparams);
}
}
void getSpotWB (int x, int y, int rect, double& temp, double& green);
void applyAutoExp (rtengine::procparams::ProcParams& pparams);
ThFileType getType ();
Glib::ustring getFileName () const
@ -156,14 +139,8 @@ public:
bool isSupported ();
const CacheImageData* getCacheImageData()
{
return &cfs;
}
std::string getMD5 () const
{
return cfs.md5;
}
const CacheImageData* getCacheImageData();
std::string getMD5 () const;
int getRank () const;
void setRank (int rank);