krita
kis_transform_worker.h00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef KIS_TRANSFORM_WORKER_H_
00021 #define KIS_TRANSFORM_WORKER_H_
00022
00023 #include "kis_types.h"
00024 #include "kis_progress_subject.h"
00025
00026 class KisPaintDevice;
00027 class KisProgressDisplayInterface;
00028 class KisHLineIteratorPixel;
00029 class KisVLineIteratorPixel;
00030 class KisFilterStrategy;
00031
00032 class KisTransformWorker : public KisProgressSubject {
00033 typedef KisProgressSubject super;
00034
00035 public:
00036 KisTransformWorker(KisPaintDeviceSP dev, double xscale, double yscale,
00037 double xshear, double yshear, double rotation,
00038 Q_INT32 xtranslate, Q_INT32 ytranslate,
00039 KisProgressDisplayInterface *progress, KisFilterStrategy *filter);
00040 ~KisTransformWorker();
00041
00042 public:
00043 bool isCanceled() { return m_cancelRequested;};
00044
00045 bool run();
00046
00047 private:
00048
00049 template <class T> void transformPass(KisPaintDevice *src, KisPaintDevice *dst, double xscale, double shear, Q_INT32 dx, KisFilterStrategy *filterStrategy);
00050
00051 void rotateRight90(KisPaintDeviceSP src, KisPaintDeviceSP dst);
00052 void rotateLeft90(KisPaintDeviceSP src, KisPaintDeviceSP dst);
00053 void rotate180(KisPaintDeviceSP src, KisPaintDeviceSP dst);
00054
00055 private:
00056 KisPaintDeviceSP m_dev;
00057 double m_xscale, m_yscale;
00058 double m_xshear, m_yshear, m_rotation;
00059 Q_INT32 m_xtranslate, m_ytranslate;
00060 KisProgressDisplayInterface *m_progress;
00061 KisFilterStrategy *m_filter;
00062
00063 bool m_cancelRequested;
00064 virtual void cancel() { m_cancelRequested = true; }
00065 Q_INT32 m_progressTotalSteps;
00066 Q_INT32 m_progressStep;
00067 Q_INT32 m_progressScaler;
00068 Q_INT32 m_lastProgressReport;
00069 };
00070
00071
00072 inline KisTransformWorker::~KisTransformWorker()
00073 {
00074 }
00075
00076 #endif // KIS_TRANSFORM_VISITOR_H_
|