chalk

kis_perspectivetransform_worker.h
1/*
2 * This file is part of Chalk
3 *
4 * Copyright (c) 2006 Cyrille Berger <cberger@cberger.net>
5 *
6 * This program is free software; you can redistribute it and/or modify
7 * it under the terms of the GNU General Public License as published by
8 * the Free Software Foundation; version 2 of the License.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20#ifndef KIS_PERSPECTIVETRANSFORM_WORKER_H
21#define KIS_PERSPECTIVETRANSFORM_WORKER_H
22
23#include "kis_types.h"
24#include "kis_progress_subject.h"
25
26class KisPoint;
27class KisProgressDisplayInterface;
28
29class KisPerspectiveTransformWorker : public KisProgressSubject
30{
31 public:
32 KisPerspectiveTransformWorker(KisPaintDeviceSP dev, const KisPoint& topLeft, const KisPoint& topRight, const KisPoint& bottomLeft, const KisPoint& bottomRight, KisProgressDisplayInterface *progress);
33
34 ~KisPerspectiveTransformWorker();
35
36 void run();
37 bool isCanceled() { return m_cancelRequested; };
38 private:
39 virtual void cancel() { m_cancelRequested = true; }
40 private:
41 TQ_INT32 m_progressTotalSteps;
42 TQ_INT32 m_lastProgressReport;
43 TQ_INT32 m_progressStep;
44 double m_xcenter, m_ycenter, m_p, m_q;
45 KisPaintDeviceSP m_dev;
46 bool m_cancelRequested;
47 KisProgressDisplayInterface *m_progress;
48 double m_matrix[3][3];
49 TQRect m_r;
50};
51
52#endif
A double-based point class that can return it's coordinates approximated to integers.
Definition kis_point.h:28