Make UEFI boot-platform build again
[haiku.git] / src / libs / icon / transformable / Transformable.h
blobaac1740ac5f723c4bb075ac9ecabb5d44e726be5
1 /*
2 * Copyright 2006, Haiku.
3 * Distributed under the terms of the MIT License.
5 * Authors:
6 * Stephan Aßmus <superstippi@gmx.de>
7 */
9 #ifndef TRANSFORMABLE_H
10 #define TRANSFORMABLE_H
12 #include <Rect.h>
14 #include <agg_trans_affine.h>
16 #include "IconBuild.h"
19 _BEGIN_ICON_NAMESPACE
22 class Transformable : public agg::trans_affine {
23 public:
24 enum {
25 matrix_size = 6,
28 Transformable();
29 Transformable(const Transformable& other);
30 virtual ~Transformable();
32 void StoreTo(double matrix[matrix_size]) const;
33 void LoadFrom(const double matrix[matrix_size]);
35 // set to or combine with other matrix
36 void SetTransform(const Transformable& other);
37 Transformable& operator=(const Transformable& other);
38 Transformable& Multiply(const Transformable& other);
39 virtual void Reset();
41 void Invert();
43 bool IsIdentity() const;
44 bool IsTranslationOnly() const;
45 bool IsNotDistorted() const;
46 bool IsValid() const;
48 bool operator==(const Transformable& other) const;
49 bool operator!=(const Transformable& other) const;
51 // transforms coordiantes
52 void Transform(double* x, double* y) const;
53 void Transform(BPoint* point) const;
54 BPoint Transform(const BPoint& point) const;
56 void InverseTransform(double* x, double* y) const;
57 void InverseTransform(BPoint* point) const;
58 BPoint InverseTransform(const BPoint& point) const;
60 // transforms the rectangle "bounds" and
61 // returns the *bounding box* of that
62 BRect TransformBounds(BRect bounds) const;
64 // some convenience functions
65 virtual void TranslateBy(BPoint offset);
66 virtual void RotateBy(BPoint origin, double degrees);
67 virtual void ScaleBy(BPoint origin, double xScale, double yScale);
68 virtual void ShearBy(BPoint origin, double xShear, double yShear);
70 virtual void TransformationChanged();
71 // hook function that is called when the transformation
72 // is changed for some reason
76 _END_ICON_NAMESPACE
79 _USING_ICON_NAMESPACE
82 #endif // TRANSFORMABLE_H