.
...
r
Trio64V+ Integrated Graphics/Video Accelerator
53
Incorporated
be cleared
to
0
to
also specify secondary stream
on
top.
Similarly,
If
MMB1AO_26-24 =
001
b (pri-
mary
stream
on
top), then MMB1DC_30
must
be
set
to
1
to
also specify
primary
stream on top. The
next
step is
to
define
when
to
stop fetching pixels
for
a line
from
memory
and when
to
restart
fetching them. The
goal
is
to
not fetch those
pixels
in
the background
window
that
are cov-
ered
up
by
the
opaque rectangular overlay
win-
dow,
thus
saving
memory
bandwidth.
The
first
pixel
that
does
not
need
to
be fetched is
at
horizontal position
X1
shown in Figure 10-2.
This is
programmed
in
MMB15B_26-16. The start-
ing
pixel position
for
the background
(XO)
is
programmed
in
MMB1FO_26-16. The difference
(X1
-
XO)
must
be converted into
quadwords
and
then
programmed
in
MMB1 DC_12-3. The value is
(X1
-
XO)
x bytes per pixel/4.
If
the result is a
fraction,
it
is rounded up
to
the next highest
integer
to
ensure
that
the first pixel
not
fetched
in
inside
the
opaque overlay
window.
Note
that
if
the secondary stream is in the background,
then
the value is
(XO
- X1) x bytes per pixel!4,
again rounded up.
Pixel fetching
must
start again before
or
at the
last pixel
position
ofthe
opaque overlay
window.
Using
the
terms
in Figure 10-2, this position is
(X1
-
XO)
+ W1,
with
W1
programmed
in MMB1FC_26-
16
(secondary stream is on top). Converting
to
quadwords,
the
value is [(X1 -
XO)
+ W1] x bytes
per
pixel!4.
If
the
result is a fraction, the result is
truncated
to
the next lowest integer (minus
1)
and
programmed
in
MMB1DC_2B-19. Note
that
if
the secondary stream is in the background, then
(XO
-
X1)
is
used
and
W1 is
the
value
in
MMB1F4_26-16
(primary
stream is on top).
Opaque
overlay control cannot be used
with
key-
ing
or
blending
and should never
be
enabled
when
one
of
these modes is being used.
10.3.2 Blending
These
modes
are items 3 and 4 in the compose
modes
list. The blender accepts the
primary
and
secondary
pixel streams and blends
them
with
an
arithmetic
weighting.
The result
isthen
over-
laid
with
the cursor stream. Both blender inputs
are
RGB
B.B.8
from
the outputs
of
the
primary
stream
interpolator
and secondary stream color
space converter. Note
that
blending
makes sense
only
when both streams are defined.
In
addition,
when
blending is selected, the concept
of
back-
ground/foreground
or
top
and
bottom
window
has
no
meaning.
Two
types
of
blending are provided: dissolve and
fade.
When
dissolve is chosen,
the
output
pixels are
generated using the
following
equation:
!Pp x
Kp
+
Ps
x
(B
- Kp)]/B
Pp
and
Ps
are the
primary
and secondary stream
pixel colors respectively,
both
RGB
8.B.B.
Kp
is
the
primary
stream
weighting
factor. It is a 3-bit
value
programmed
in
MMB1AO_12-10.
This
weight
value is applied
to
each
of
the three
color
values
for
the pixel.
If
Kp
=
0,
only
the secondary
stream is
displayed. As
Kp
is increased,
more
of
the
pixel
color
from
the
primary
stream
is
blended
into
output.
At
the
maximum
(Kp = 7
or
111
b), 7/Bths
of
the color
will
be due
to
the
pri-
mary
stream and 1/Bth
will
be due
to
the secon-
dary
stream. Therefore,
by
starting
with
the
primary
stream only, then overlaying the secon-
dary stream
with
Kp
values decreasing
from
7
to
0,
the overlay
window
can be dissolved
gradually
from
primary stream
to
secondary stream. Note
that
when the
Kp
value is reprogrammed, its
new
value does
not
take effect until
the
next
VSYNC,
so
it
can
be
reprogrammed
during
frame display
without
disruptive effects.
When fade is chosen, the
output
pixels are gen-
erated using the
following
equation:
!Pp x
Kp
+
Ps
x
Ks]/B,
where
Kp
+
Ks
must
be
::;
B.
Ks
is the secondary stream
weighting
factor. It is
a 3-bit
value programmed in MM81
A03-2.
This
weight
value is applied
to
each
of
the three
color
values
for
the pixel. Note
that
when fading is
selected, the default values
for
Kp
and
Ks
(both
0)
result in a color value
of
O.
As
with
Kp,
when
the
Ks
value is reprogrammed, its
new
value
does
not
take effect until
the
next
VSYNC.
STREAMS
PROCESSOR
10-7