Note: Descriptions are shown in the official language in which they were submitted.
Description
A METHOD AND SYSTEM FOR GENERATING COMPILED
RASTER OPER~TION CODE
Technical Field
This invention relates generally to a computer
system ~or displaying bitmaps, and more particularly, a
method and apparatus ~or combining multiple bitmaps.
.
g~g~ __d of the Inven~ion.
: The output devices of personal computers often
include bitmap graphics devices. A bitmap yraphics device
typically includes a graphics adapter, which has a display
memory, and a display screen. The bitmap graphics device
inputs a bitmap to be displayed and then displays that
bitmap on the display screen. A bitmap is a matrix of
bits that defines an image that is to be displayed in a
rectangular area on a display screen~ Each bit in a
bitmap corresponds to one picture element (pixel) on the
display scre~n. To disp~ay computer output data, a bitmap
~:~ graphics device reads the bitmap stored in the display
~` memory and renders the corresponding imagQ on the display
screen. If a bit in the display memory is 1, then the
bitmap graphics device turns on the corresponding pixel on
: the display screen. If a bit in the display memory is 0,
then the bitmap graphics device turns of~ the
corresponding pixel on the display screen. By changing
the contents of the display memory, for instance, by
loading a new bitmap, a computer program can effect a
change on the display screen.
A computer program typically generates a bitmap
~ in program memory, and then copies the bitmap to the
: display memory. Copying from program memory to display
~; 35 memory can be relatively time-consuming because bitmaps
. are often quite large and can contain one million or more
-- bits. To improve performance and facilitate computer
' ' :
~ : ., . , .:
.: : . ~ . . . . .
:
, ~ , ,
2 ~
programming, typical graphically-oriented operating
systems provide routines that are optimized to copy
bitmaps from program memory to display memo~y. These
routines are known as bit block-transfer (bitBLT)
5 routines. In general, these bitBLT routines can read as
input a source bitmap and a destination bitmap, which is
typically in display memoryO These bitBLT routines copy
the source bitmap to the destination bitmap in an
e~ficient manner.
BitBLT routines are optimized to copy a computer
word of data at a time, rather than just a slngle bit at a
time. A computer word is a number of bits that the
computer operates on as a unit. Computer words typi~ally
comprise 8, 16, or 32 bits~
Figures lA and lB are diagrams of a display
memory showing the results of various bitBLT operations.
Fiqure lA shows the display memory be~ore executing the
bitBLT routine, and Figure lB shows the display memory
a~ter executing the bitBLT routine. Figures lC and lD are
diagram~ of the display screen corresponding to Figures lA
and lB, respectively.
Figure 2 is a diagram showing sample source
- bitmaps of an image of an arrow. The outlined arrow
bitmap 201 is a matrix o~ bits that is 32 bits high by 32
2~ bits wide. To display the outlined arrow bitmap 201 on
the display screen at location 111, a program, when
c~lling a bitBLT routine, would specify that the outlined
arrow bitmap 201 is the source bitmap and specify that the
display memory bitmap 101 is the destination bitmap
corresponding to location 111 on the display screen. The
~itBLT routine then copies the outlined arrow bitmap 201
to the display memory bitmap 101. When the outlined arrow
bitmap 201 is copied to the display memory bitmap lO1, the
; bits in the 32 by 32 bit matrix in the display memory
bitmap lOl are overwritten hy the outlined arrow bitmap
~01 as shown by display memory bitmap 105. To display thP
so~id arrow bitmap 202 on the display screen at location
~ ' ' .
:-
,: ' :
'', ' ,,
` '
': ' ~, , '
3 2~9~
112, a program would specify that the solid arrow bitmap
202 is the source bitmap and specify that the display
memory bitmap 102 is the destination bitmap correspondi~g
to location 112 on the display screen. The bitBLT routine
S then copies the solid arrow bitmap 202 to t~e display
memory bitmap 102. The bits in the 32 by 32 bit matrix in
the display memory bitmap 102 are overwritten by the solid
arrow bitmap 202, as shown by display memory bitmap 106.
In certain situations, a program may want to
display an arrow that is transparent. A transparent arrow
is shown displayed at location 117 on the disp}ay screen.
The transparen~ arrow is an arrow in which the underlying
screen display is left intact except for the outline o~
the arrow. To provide this capability, typical bitBLT
routines, in addition to copying bitmaps, permit Boolean
logic operations to be performed on a bit-by-bit basis on
the source and destination bitmaps. For ~xample, to
generate the transparent arrow as shown at location 117,
the program specifies the outlined arrow bitmap 201 as the
source bitmap, the display memory bitmap 103 as the
destination bitmap, and the AND operation when invoking
the bitBLT routine. The bitBLT routine retrieves each bit
~rom the outlined arrow bitmap 201 and the corresponding
bit from the display memory bitmap 103l performs the AND
operation on the bits, and stores th~ result in the
display memory bitmap 103, resulting in the display memory
bitmap 107.
Although the bitBLr routines that perform
copying and Boolean operations on source and destination
bitmaps provide considerable flexibility, ~here are
certain computer graphics operations that require invoking
these bitBLT routines more than once~ For example, if a
: program were to output an arrow as shown at location 118,
the program would first invoke the bitB~T routine
speci~ying the solid arrow bitmap 202 as the ~ource
bitmap, the display memory bitmap 104 as the destination
bitmapl and the AND operation. The program would then
.
.
. . ,, . .~ . :
. ~:
:` ` : . . , j .:
~as~
invoke the bitBLT routine specifying the arrow bitmap 203
as the source bitmap, the display memory bitmap 104 as the
destination bitmap, and the exclusive-OR operation. The
invoking of the bitBLT routine twice results in each bit
in the destination bitmap 108 being read ~rom and written
to twice. When a destination bitmap is larye, ~he reading
and writing o each bit twice can result in unacceptable
performance.
~ecause copying large bitmaps can ~e expensive,
typical bitBLT routines have been generalized to allow two
source bitmaps to be designated, along with a destination
bitmap and a Boolean oparation. For axample, to gsnerate
the arrow at location 118, the invoking program would
designate solid arrow bitmap 202 as the ~irst source
bitmap (S1), arrow bitmap 203 as the second source bitmap
(S23, and display memory bitmap 104 as the destination
bitmap ~D~, along with Boolean operations that specify Sl
i5 to be logically ANDed with D, and that the result is to
be logically exclusive-ORed with S2. In standard Boolean
20 algebra notation, that function would be specified as: :
(Sl & D) ~ S2
- wh~re & represents~ the Boolean AND operator and where
represents the Boolean exclusive-OR operator.
Although it is possible to develop bit~LT
routines that provide Boolean operations on an arbitrary
number of source bitmaps, in practice, bitBLT routines
typically support only two source bitmaps. When two
source bitmaps are designated, the three bitmaps S1, S2,
and D can be combined using Boolean operators in 256
: unique ways. Each way of combining the three bitmaps is
re~erred to as a logical operation or a raster operation.
:
:
:~
. . .
2 ~ ~ 9 ~ ~ L~
TABLE I
Sl 11110000
S2 1 1 0 O 1 1 0 0Boolean
D __l O 1 0 1 0 1 0~unction
Result: O o O O O O ~ o O
ooo1ooo1 ~S2¦D)'
O 0110011 S;~ ' '
O 1 0 0 0 1 0 0S2 ~ D'
01010101 1
~ 1011010 S~
O 1 1 O O 1 1 O S2 ~E3 D
O 1 1 O 1 1 O ( 52 ~ D) ~ S1
1 O O O 1 O O O S2 ~ D
1 O 1 1 1 O 1 1 S1' ¦D
11ooooOO S2~S
11oo11o S2
0 1 1 1 0 S2 I D
1 1 1 1 0 0 Sl
1 1 1 1 1 0 1 1 S2~ ¦S1ID ~:
. . 11111111 1
- Table I shows a subset of the 256 logi~al
operations which designate how the S1, S2, and D bitmaps
can be combined. The column entitled "Boolean Function"
shows the Boolean function, comprised of bitmaps and
- ~Boolean operators, which gPnerates the corrRsponding
result.
., . ~
6 2 ~
TABL~ II
-_ S2 D _ _ & ~ tS1 & D) ~ S-2
o 0 o 0 o
O ~ O
0 1 ~ O
0 1 1 0
o O o O
~0 1 0
0 0
0
For example, to generate display memory bitmap
15 108, the program specifies the bit string "01101100
~hexadecimal 6CH) as the logical operation to be
performed. The logical operation 6CH specifies the result
: fox each of the eight possible combination of values ~or
S1, 5~, and D. Table II shows the values o~ the input
bitmaps and the intermediate and final results achieved by
the BOO1Qan function correspondin~ to logical operation
6CH .
TABLE III
for h = 0, Height
~or w - 0, Width
~h,w] = (S1~h,w] & Dth~w]) ~ 52[hrW] :
endfox
endfor
Table III illustrates pseudo~od~ for th~ bitBLT
routine that implements the logical operatiQn 6CE. The : :
variable H~ight represents the number of row~ in each
bitmap an~ the variable Width represents the number of
column~ of bits in each bitmap divided by the word width.
~' .
- :: . . ~ . . . .
7 2~9~
In this example, the width of each bitmap is assumed to be
an integral num~er o~ computer words.
~! :.
MOV h, height
outerloop: ~OV w, width
innerloop: MOV di, Sl[h,w~ common :~-
MOV si, S2[h,w] :~:
MOV dx, D~h,w3
logicalMOV ax, di
operation- _ AND ax, dx
speGific XOR ax, si
MOV D[h,w], ax
DEC w
JNZ innerloop c~mmon
DEC h
JNZ outerloop
`
20Table rv shows Intel 80386 assembly language :~
pseudocode that implements the logical :operation 6CH. .
: Typical prior art bitBL~ routi~es may have a separate ~-
section of ode to implement each o~ the 256 logical
: operations. ~owever, some bitBLT routine implemantations
recognize that a portion of the code is common to all
logical operations and a portion of the code i~ logical
operation-specific. As shown in Table IV, the three
middle statements are the logical operation specific code ~:
for th~ logizal operation 6C~. In this code, these three ~:~
s~atements:load the ax register with S1 bitmap, logically
: AND the D bitmap into the ax register, and then logically ~:
~; excl~sive-OR the S2 bitmap with th~ ax register. The five
statements precedi~g and the five ~tatements following the
logical operation-specific code control the looping
~- 35 throug~ the bitmaps and are common to all logical
operations. :
.',' ~'
, ~ .
`~:
,--- : . : - .
- ,. -
.- .,; . : . . ~: . :
- ~, : : . . : , ... .. .
- .,~ ~ :
8 2 ~
To improve performance, prior art bitBLT
r~utines store the logical operation-specific code for
each of the 256 logical operations in a table and store
just one copy of the common code. When the bitBL'r rou~ine
is called with a logical operation designation, sush as
6CH, the bitBLT routine generates the code to implement
the logical operation by retrieving the appropriate
logical operation-specific code ~rom the table and
combining the retrieved code with the common code. The
lo bitBLT routine then executes the generated code to per~orm
the logical operation. The process of generating the code
to ex~cute is referred to as bitBLT compiling.
These prior art bitBLT routines generate
e~ficient code at execution time. However, these routines
require the storage of 256 logical operation-specific code
~egments. In addition, it can take considerable
programming effort to develop and test these 256 code
segments.
Summary of the Invention
It is an object og the present invention to
provide a method and system for generating e~ficient code
for a bitBLT routine.
: It is another object of the present invention to
provide a method and system developing a bitBLll routine
that reduces the of number code segments that need to be
stored~
It is another object of the present invention to
provide an apparatus for performing logical operations on
a plurality of bitmaps.
: These and other objects, which will become
apparen'c as the invention is more fully described below,
are obtained by a method and system for generating
computer code to implement logical operations to be
performed on a plurality of bitmaps. In a preferred
embodiment, a Boolean equation is specified having a
plurality o~ terms defined by Boolean operations. Code
- ~
- :, .; '
segments are generated that implement each of the Bool an
operations of the terms. When executing a bitBLT routine,
a logical operation and a plurality of bitmaps are
specified. The bitBLT routine determines which of the
generated code segments are needed to implement the
specified logical operation. The determined code segments
are then retrieved and combined to form the computer code
that implements a logical operation. The computer code
oan then be executed to effect a bitBLT with a logical
operation.
~rie ~ tion ~- tb- QT~ 9- ~`
Figures lA and lB are diagrams of a display
memory showing the results of various bitBLT operations.
Figures lC and lD are diagrams of the display
screen corresponding to Figures lA and lB, respectively.
Figure 2 is a diagram showing sample source
bitmaps of an image of an arrow.
Figure 4 is a flow diagram of a routine to
generate the compiled code that is executed by the bitBLT
routine.
Figure 5 is a schematic diagram of a hardware
implementation of the present inv~ntion.
Detailed Description of the Invention
The present invention provides a method and
system for implementing a bitBLT routine which reduces the
storage re~uirements o~ the routine and provides for more
rapid developing of the routine. In a preferred
embodiment, a bitBLT routine that accommodates two source
bitmaps and a destination bitmap stores 8 code segments
and a mapping table, rather than the 256 logical
operation-specific code segments used in prior art
systems.
The present invention recognizes that each of
the 256 logical operations can be represented by the
following equation:
':
,.
: .
, , ' , .
., . : . : , -., ., . ~:
~ 3~f~
~g~ ,
F~Sl/S2~D) = aO-l ~3 al~Sl 0 c~2.S2 ~3 a3.D ~3
~4-SlS2 ~ 5~-SlD 0 (X6-S2~) ~13 Cl7o
where ~0 . . . ~7 are logical operation-speci~ic
coefficients o~ the equation, where ~ represents the
Boolean exclusive-OR operator, where . or juxtaposition
represent the Boolean AND operator, and where logical 1,
Sl, . O ., S1S2D are ~he 8 terms of the equation re~erred
to as terms 0 through 7.
Each one of the ~56 logical operations can be
represented by Equation 1 with a unique sPt of
coe~ficients. For example, the logical operation 6C~ can
be represented by the set of coe~icients aO=0, a1=ot
a2=1, a3=0, a4=0, a~=1, a6=0~ a7=o (001001002 or 24H).
The following equation shows the logical operation 6C~ as
expressed in Equation 1 with the coefficients 24~:
20E~g3~1ss_2
F6~(S1,S2,D) = 0.1 ~ O-S~ S2 ~ 0-D ~ OOSlS2 ~ ~.
1.5~ 13 0-S21) ~3 -SlS2~
:
Since the value 0 logically ANDed with ~ny other value
results in 0, the above equation can be æimplified to the
following equation:
Eauation 3
F6CH ~ S1, S2,D) = S2 ~ SlD
: 30
For each of the 256 logical operation~, there is a unique
: set of coe~ficients which generate the logical operation.
In a preferred embodiment, the present invention
stores 8 code segments, one for each term in Equation 1,
~,
:~ , : .
11 2~
and stores the coefficients to each of the 256 logical
operations into a mapping table called a coefficient
table~ When the bitBLT routine receives a logical
operation, it retrieves the coe~ficients corresponding to
the logical operation designator from a coefficient table,
retrieves the code segments corresponding to the terms
with a coe~ficient equal to 1, and combines the retrieved
code se~ments with common code to generate the compiled
code.
ABLE V
CodeSeg[0] NOT ax
CodeSeg[1] XOR ax,di
CodeSeg[2] XOR ax,si
CodeSeg~3] XOR ax,dx
CodeSeg~4] MOV bx,di
AND bx,si
XOR ax,bx
CodeSeg[5] MOV bx,di
AND bx,dx
XOR ax,bx
CodeSeg[6] MOV bx,si
AND bx,dx
XOR ax,bx
CodeSeg[7J MOV bx,di
AND bx,si :
~ND bx,dx
XOR ax,bx
... _.. , . .. , .. . . . . .. ... . _, ,_ _ , _ , _, -- ",
: -, . ~ . ,
. .
- ~ . .
~2 `
Table V shows eight Intel 80386 assembly
language code seyments which correspond to each of the
eight terms of Equation 1. The common code is the same as
used in prior systems, except khat the ax register is
5 cleared before the logical operation specific-code is
executed.
Continuing with the above example, when the
bitBLT routine receives the logical operation 6CH, it uses
the 6CH as an index into the coef~icient table to retrieve
the value 24HI which represents the set of coeffisients to
be applied to Equation 1. The bitBLT routine then
retrieves th~ code ~egments for t~rm 2 and t rm 5 tthe
coefficient 24H indicating that coefficients a2 and a5
are ~et to 1~ and combines those code segments with ~he
common code to form the compiled cod~. Table VI shows the
logical operation~specific code generated for logical
operation 6CH.
In a preferred embodiment, the present invention
also stoxes eight alternate code segments, one for each
term in Equation 1~ When the bitBLT routine retrieves
code segments, the first code segment of the complied code
is an alternate code segment. The alternate code segments
are optimized to be the ~irst code segment exscuted as
- part of the compiled code. In particular, the fir~t code
segments store the value of the term into the ax register,
rather than exclusively ORing the value o~ the term into
the ax register. Thuæ, it is not necessary to load the ax
register with a zero value in the common code, except when
the coefficients are "00000000" which indicate that none
:30 o~ the code seqments are to be used and the re~ult is 0.
Also, the use of alternate code se~ments produces smaller
compiled code and improved performance. Alternate Table V
shows Inte} 80386 assembly language code for the eight
alternate code se~ments.
~:
-
., ..... . .: , . . ~ :
13
ALTERNATIVE TABLE_V
AltCodeSeg[O] MOV ax,OFFFFh
AltCo~eSeg[1~ MOV ax,di
AltCodeSeg[2] MOV ax,si
AltCodeSeg~3] MOV ax,dx
AltCodeSeg~4] MOV ax,di ~;
~ND ax,si
AltCodeSeg[5] MOV ax,di
AND ax,dx
AltCodeSeg~6] MOV ax,si
AND ax,dx
AltCodeSeg E 7] MOV ax,di
AND ax,si ~:
AND ax,dx
TABLE VI
CodeSeg~2] XOR ax,si
: ~OV bx,di
CodeSeg[5] ~ND bx,dx
~COR ax,bx
Figure 4 is a flow diagram of a routine togenerate the compiled code that is executed by the bitBhT
routine. This routine inputs a logical operation and
generates the compiled code which implements the logical
opera~ion. Table VI shows the compiled code that is
~;: generated when the logical operation is 6C~. The routine
uses the common code, the code segment table, and the
,
. - ~
' . - : :
- ., ~ . : .
14
coefficient table. In step 401, the routine retrieves the
c~efficients from the coefficient table indexed by the
logical operation. The coefficient table contains one
enkry for each of the 256 logical operati~ns. Each entry
contains the ~oefficients that implement the logical
operation for Equation 1.
TABL~ VII
MOV h, height
outerloop: MOV w, width
innarloop: MOV di,S1[h,w~ Be~ore
MOV si,S2[h,w] Common
MOV dx,D[h,w] Code
MOV ax,O
XOR ax, si Logical
~OV bx, di Operation
AND bx, dx 6CH Code
XOR ax, bx
MOV D[h,w], ax
DEC w After
JNZ inner loop Common
DEC h Code
JNZ outer loop
In step 402, the routine retrieves the ~efore Common Code
as shown in Table VII and stores that code as part of the
compiled code. In steps 403-408, the routine loops,
determining whether each retrieved coefficient i$ a O or a
1. If the coefficient is a 1, then the routine retrieves
the corresponding code segment from the code segment table
of Table V and adds the retrieved code segment to the
compiled code. In step 403, the routine initializes index
i to 0. Index i is us~d to reference the coefficients and
corresponding code segments. In step 404~ i~ coefficient
;
- - :,, - - . ., . ,
, : . :
,
- :. ,
:
1S 2 ~
ai is equal to 1, then the code segment for that
coefficient is to be retrieved and the routine continues
at step 405, else the routine continues at step 407. In
step 405, the routine retrieves the code se~ment
corresponding to coefficient ai from the code segment
table. In step 406, the routine adds the retrieved code
segment to the compiled code. In step 407, the routine
increments index i to point to the next coefficient~ In
step 408, iE index i equals 8, then all the coefficients
have been processed and the routine continues at step flOg,
else the routine loops to step 404 to check tha next
coa~ficient. In step 409, the routine retrieves the After
Common Code a~ shown in Table VII and add~ it to the
compiled code. The routine then returns.
TABLE VIII
for a = 0, 255
logical op - 0
for Sl = 1, 0
for S2 = 1, 0
for D = 1, 0
logical op = logical op * 2+(aO ~ a1S1 ~ ~2~2
~ ~3D ~ ~4S1S2 ~ ~sS~D ~ a6S2D
a7SlS2D~
endfor
endfor
endfor
: Coefficient Table[logical op] = a
endfor
. 30
In one embodiment, the coefficient table is
generated by the algorithm shown in Table VII~. This
algorithm generates a unique 8-bit logical operation for
: each of the 256 possible coefficients and then stores the
coefficient in the coe~ficient table indexed by the
logical operation. When the logical operation-specific
code is generated, the logical operation is used as an
:
~ . .
- ,
:: . : , .
.
16
index into the coefficient table to retrieve the
corresponding coefficient.
In a preferred embodim~nt, the Before Common
Code of Table VII is optimized to load only those bitmaps
which are actually used by the logical operation-sp~cific
code. For example, if the logical operation 3CH is
specified, then the coefficient 60H is retrieved ~rom the
coefficiant table. The resulting minimized equation is:
F3CH~Sl,S2,19) = Sl ~ S2 .
Since this equation does not use the D bitmap, the Be~ore
Common Code does not need to load the bits ~rom the D
bitmap into the dx register. The Before Common Code can
thus be tailored so that the bits from the D bitmap are
only loaded when coefficients 5, 6, or 7 are set.
Similarlyl the bits from the Sl and S2 bitmaps need only
be loadPd when their corresponding coefficients are set.
In addition, typical bitBLT routines check the validity o~
the S1, S2, and D bitmaps before executing the compiled
code. If, however, a logical operation does not require
th~ loading of the Sl and S2 bitmaps, then this validity
checking does not need to be per*ormed. The validity
ch~cking of the D bitmap typically needs to be perform~d
as it is accessed when storing the result in the After
Common Code.
~ igure 5 is a schemakic diagram of a hardware
implementation of the present invention. The hardware
includes logical operation register 501, coef~icient table
read-only memory (ROM) 502, parallel-to-serial shift
registers 503, 504, and 505, AND gates 511-517, parity
generator 520, and serial-to-parallel shift register 521.
The logical operation register 501 outputs (aO ... a73
address the coefficient table ROM 501, which i~ a 256 x 8
bit ROM. The coefficient table ROM contain~ the set of
~oefficients ~or Equation 1 generated by the pseudocode of ~;
Table VIII at the addrPss corresponding to the logical
;; . . , ~ , . - . , . ~
`: '' ' ' ~'. ~ "'. ',:
2 ~
operation. The dataline aO is input to the parity
generator 520 and datalines a1 through ~7 are input to AND
~ates 511 through 517, respectively. The dataline $1 ~rom
shift register 503 is input into AND gates 511, 514, 51S,
and 517~ The dataline S2 ~rom shift register 504 is input
into AND gates 512, 514, 516, and 517. The dataline D
from shi~t register 505 is input into AND gates 513, 515,
516, and 517. The output from the AN~ gates 511 through
517 are input to the parity generator 520. The output o~
the parity generator 520 i5 input into the shi~t register
521.
In operation, logical operation register 501 is
loadad with the logical operation to be performed.
Coefficient table ROM 502 translates the logical operation
to the corresponding coe~ficients. Shift registers 503,
504, and 505 are loaded with data from bitmaps S1, S2, and
D, respectively. The AND gates 511-517 generate the
results of seven of the terms of Equation 1 which are
input into parity generator 520. The eighth term is
generated by the aO data line which is input directly into
the parity generator 520. The parity generator 520
performs an equivalent of the logical exclusive-OR
operations of Equation 1. The output of parity generator
520 is input into shift register 521. The logical
operation i9 performed by sequentially loading shift
registars 503, 504, 505 with data from bitmaps S1, S2, and
D, respectively. Th~ shift registers 503, 504, 505 are
then shifted sequentially to datalines S1, S~, and D. For
each shift of the shift registers 503, 504, 505, the
output of parity generator 520 is the result of the
logical operation stored in the logical operation register
501. The output of the parity generator 520 is input into
the shift register 521, which stores the result of the
logical operation, which can then be written to a display
memory. In an alternate embodiment, the coefficient
mapping is performPd in software, and the coefficient
table ROM 502 is not needed. Rather, the logical
~ .
,. .~ . ~ ~ , . .
.
'J , ~ .' . ~ '
' , . . , . ~ ' .
18
.
operation register 501 is loaded with the coe~ficients
directly.
Although the function of Equation 1 is used in a
praferred embodiment, one skilled in the art will
appreciate that other equations o~ eight terms could be
used as well. For example, the following equation:
Equatlon_4
F(Sl,S2,D) = ~oS1S2D + ~lS1S2D' + ~2S1S2'D + ~3Sls2
lO~4Sl S2D + ~5S1 S2DI + ~6S11S'2D + ~7Sl'S2lD~
where ~0 . . . ~7 represent the coefficients, where
represents the Roolean inclusive-OR operator, where
indicates the Boolean complement operator, and where ;,
juxtaposition indicates the Boolean AND operator. A code
se~ent is generated for each term o~ Equatio~ 4. Using
Equation 4, no translation is necessary to generate the
coefficients. The coefficients correspond to the logical
operation. When using Equation 4, similar optimizations
can be used to determine whether to load certain bitmaps.
Although the present invention has been
described in terms o~ preferred embodiments, it is not
intended that the invention be limited to thPse
embodiments. For example, the present invention can be
used with color bitmaps (multiplanar~ by applying the
compiled code to each plane. In addition, one skilled in
the art would recognize that the methods of the present
inventiorl can be applied to bitBLT routines that use more
than two source bitmaps. For example, a bitBLT routine
with thxee source bitmaps would use an equation of 16
terms and store 16 code segments, rather than the 65,536
logical operation specific-code se~ments that prior art
methods would employ. Modifications within the spirit of
the invention will be apparent to those skilled in the
art. The scope of the present invention is defined by the
- claims that follow.
.~ .
": :~ . ' ' ; ' ' : ' . '
.,