#ifndef KCanvasMatrix_H
#define KCanvasMatrix_H
#if SVG_SUPPORT
#include "AffineTransform.h"
namespace WebCore {
enum KCMatrixOperationMode {
OPS_PREMUL = 1, OPS_POSTMUL = 2
};
class KCanvasPath;
class KCanvasMatrix
{
public:
KCanvasMatrix();
KCanvasMatrix(const AffineTransform &matrix);
KCanvasMatrix(const KCanvasMatrix &matrix);
KCanvasMatrix(double a, double b, double c, double d, double e, double f);
~KCanvasMatrix();
KCanvasMatrix &operator=(const AffineTransform &other);
KCanvasMatrix &operator=(const KCanvasMatrix &other);
bool operator==(const AffineTransform &other) const;
bool operator!=(const AffineTransform &other) const;
bool operator==(const KCanvasMatrix &other) const;
bool operator!=(const KCanvasMatrix &other) const;
void setOperationMode(KCMatrixOperationMode mode);
double a() const;
void setA(double a);
double b() const;
void setB(double b);
double c() const;
void setC(double c);
double d() const;
void setD(double d);
double e() const;
void setE(double e);
double f() const;
void setF(double f);
KCanvasMatrix &translate(double x, double y);
KCanvasMatrix &multiply(const KCanvasMatrix &other);
KCanvasMatrix &scale(double scaleFactorX, double scaleFactorY);
KCanvasMatrix &rotate(double angle);
KCanvasMatrix &rotateFromVector(double x, double y);
KCanvasMatrix &flipX();
KCanvasMatrix &flipY();
KCanvasMatrix &skewX(double angle);
KCanvasMatrix &skewY(double angle);
void reset();
void removeScale(double *xScale, double *yScale);
AffineTransform matrix() const;
private:
AffineTransform m_matrix;
KCMatrixOperationMode m_mode;
};
}
#endif // SVG_SUPPORT
#endif