If
n
is normalized that means if the length of
n
is 1 then the dot product of
0
p
p
−
and
n
is the projection of
0
p
p
−
to
n
and this is the distance
d
of the point
P to the line. In this case f(x,y) is describing the distance of the pixel with the
coordinates (x,y) to the line.
To calculate the distance of every pixel of the bounding box incrementally first the
distance to the line at origin has to be calculated:
c
n
p
f
=
⋅
−
=
0
)
0
,
0
(
Then the increments for a step in x direction and a step in y direction have to be
calculated:
(
)
a
p
f
n
e
p
f
n
p
e
p
e
p
f
x
x
x
+
=
⋅
+
=
⋅
−
+
=
+
)
(
)
(
)
(
0
with
=
0
1
x
e
(
)
a
p
f
n
e
p
f
n
p
e
p
e
p
f
x
x
x
+
=
⋅
+
=
⋅
−
+
=
+
)
(
)
(
)
(
0
(
)
b
p
f
n
e
p
f
n
p
e
p
e
p
f
y
y
y
+
=
⋅
+
=
⋅
−
+
=
+
)
(
)
(
)
(
0
with
=
1
0
y
e
This means the new distance can be calculated from the old distance with the
increments
a
and
b
. A step in x direction changes the distance by
a
and a step
in y direction changes the distance by
b
. The distance of the origin to the line is
c
.
With this information the whole bounding box can be scanned. In case the
bounding box top left corner is not at the origin an offset has to be added.
Chapter 8
Drawing Engine
228
Preliminary User's Manual S19203EE1V3UM00
Summary of Contents for uPD72257
Page 39: ...Pin Functions Chapter 2 Preliminary User s Manual S19203EE1V3UM00 39...
Page 44: ...Chapter 2 Pin Functions 44 Preliminary User s Manual S19203EE1V3UM00...
Page 46: ...Chapter 2 Pin Functions 46 Preliminary User s Manual S19203EE1V3UM00...
Page 49: ...Pin Functions Chapter 2 Preliminary User s Manual S19203EE1V3UM00 49...
Page 52: ...Chapter 2 Pin Functions 52 Preliminary User s Manual S19203EE1V3UM00...
Page 54: ...Chapter 2 Pin Functions 54 Preliminary User s Manual S19203EE1V3UM00...
Page 331: ...External Memory Interface Controller Chapter 9 Preliminary User s Manual S19203EE1V3UM00 331...
Page 343: ......