tbx
0.7.3
Main Page
Related Pages
Namespaces
Classes
Files
File List
tbx
drawtransform.h
1
/*
2
* tbx RISC OS toolbox library
3
*
4
* Copyright (C) 2010-2012 Alan Buckley All Rights Reserved.
5
*
6
* Permission is hereby granted, free of charge, to any person obtaining a
7
* copy of this software and associated documentation files (the "Software"),
8
* to deal in the Software without restriction, including without limitation
9
* the rights to use, copy, modify, merge, publish, distribute, sublicense,
10
* and/or sell copies of the Software, and to permit persons to whom the
11
* Software is furnished to do so, subject to the following conditions:
12
*
13
* The above copyright notice and this permission notice shall be included
14
* in all copies or substantial portions of the Software.
15
*
16
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
21
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
22
* THE SOFTWARE.
23
*/
24
/*
25
* drawtransform.h
26
*
27
* Created on: 2 Nov 2010
28
* Author: alanb
29
*/
30
31
#ifndef TBX_DRAWTRANSFORM_H_
32
#define TBX_DRAWTRANSFORM_H_
33
34
#include "fixed16.h"
35
36
namespace
tbx
37
{
59
class
DrawTransform
60
{
61
public
:
62
Fixed16
a
;
63
Fixed16
b
;
64
Fixed16
c
;
65
Fixed16
d
;
66
int
e
;
67
int
f
;
68
73
DrawTransform
() {
a
=
d
= 1;
b
=
c
=
e
=
f
= 0;}
74
78
void
translate_os
(
int
x,
int
y) {
e
= x << 8;
f
= y << 8;}
82
void
translate_os_x
(
int
x) {
e
= x << 8;}
86
void
translate_os_y
(
int
y) {
f
= y << 8;}
87
93
void
scale
(
int
scale
) {
a
=
d
=
scale
;
b
=
c
=0;}
94
100
void
scale
(
const
Fixed16
&
scale
) {
a
=
d
=
scale
;
b
=
c
=0;}
101
105
void
scale_os
() {
a
=
d
=256;
b
=
c
=0;}
106
};
107
}
108
109
#endif
/* TBX_DRAWTRANSFORM_H_ */
tbx::DrawTransform
Class to represent Drawing transforms.
Definition:
drawtransform.h:59
tbx::Fixed16
Class to represent a fixed point number with 16bits before and after the point.
Definition:
fixed16.h:39
tbx::DrawTransform::b
Fixed16 b
Top middle of transform matrix.
Definition:
drawtransform.h:63
tbx::DrawTransform::a
Fixed16 a
Top left of transform matrix.
Definition:
drawtransform.h:62
tbx::DrawTransform::e
int e
Translation in x direction in 256th of an OS unit.
Definition:
drawtransform.h:66
tbx::DrawTransform::translate_os_y
void translate_os_y(int y)
Set transform translation in os units.
Definition:
drawtransform.h:86
tbx::DrawTransform::c
Fixed16 c
Middle left of transform matrix.
Definition:
drawtransform.h:64
tbx::DrawTransform::scale_os
void scale_os()
Set matrix scale so 1 user unit = 1 os unit.
Definition:
drawtransform.h:105
tbx::DrawTransform::translate_os_x
void translate_os_x(int x)
Set transform translation in os units.
Definition:
drawtransform.h:82
tbx::DrawTransform::translate_os
void translate_os(int x, int y)
Set transform translation in os units.
Definition:
drawtransform.h:78
tbx::DrawTransform::f
int f
Translation in y direction in 256th of an OS unit.
Definition:
drawtransform.h:67
tbx::DrawTransform::DrawTransform
DrawTransform()
Create the identity draw transform.
Definition:
drawtransform.h:73
tbx::DrawTransform::d
Fixed16 d
Middle of transform matrix.
Definition:
drawtransform.h:65
tbx::DrawTransform::scale
void scale(int scale)
Set matrix to scale without rotation.
Definition:
drawtransform.h:93
tbx::DrawTransform::scale
void scale(const Fixed16 &scale)
Set matrix to scale without rotation.
Definition:
drawtransform.h:100
Generated on Tue Mar 1 2016 12:59:38 for tbx by
1.8.6