<< Click to Display Table of Contents >> Navigation: 3. Script Language > Image/Pixel-Color Operations > ANA. - Imageworks > Logic-Operations > Image/Pixel-Color Operations |
MiniRobotLanguage (MRL)
ANA.Mask
Mask bits out of an entire Image-Register (IR)
Intention
This command will Mask Bits from an IR using AND/OR/XOR/EQV/IMP/SIMP.
It will work on Bit-Level.
1. Mask Source IR with a Bit-Combination
This will mask always the same picture with a defined Bit-Combination.
VAF.$$PIA=?exeloc\Pics\Sarah_BG.png
ANA.Load|0|$$PIA
ANA.Show|0!
' Red | G | B
VAN.$$MAS=&B111000001000000011111111
GSB.DoIt|AND
GSB.DoIt|EQV
GSB.DoIt|SIMP
GSB.DoIt|OR
GSB.DoIt|IMP
GSB.DoIt|XOR
DMP.Speed
ANA.Show|1!
ENR.
:DoIt
VAR.$$OPE=§§_01
ANA.Mask|0|$$MAS|$$OPE|1
GSB.Print|1|$$OPE
RET.
VAN.$$NUM=§§_01
VAR.$$TXB=§§_02
DBP.$$MAS
VAN.$$COL=$H000000
VAN.$$LAA=&HFFFFFF
VAR.$$LAC=Segoe UI
VAN.$$XP1=100
$$XP1=16
$$YP1=60
VAN.$$SIZ=16
VAR.$$TXA=Mask: $$MAS -> &B111000001000000011111111
ANA.PrintAt|$$NUM|$$TXA|$$COL|$$LAA|$$XP1|$$YP1|$$SIZ|$$LAC|1
$$YP1=96
$$SIZ=64
ANA.PrintAt|$$NUM|$$TXB|$$COL|$$LAA|$$XP1|$$YP1|$$SIZ|$$LAC|1
ANA.Show|1!
RET.
Picture 1: Original Picture
Speed-Dump. The ANA.Mask takes about a Second per Picture.
' This is the same Script with just another Bit-Combination
'
VAF.$$PIA=?exeloc\Pics\Sarah_BG.png
ANA.Load|0|$$PIA
ANA.Show|0!
' Red | G | B
VAN.$$MAS=&B010101011010101001010101
GSB.DoIt|AND
GSB.DoIt|EQV
GSB.DoIt|SIMP
GSB.DoIt|OR
GSB.DoIt|IMP
GSB.DoIt|XOR
DMP.Speed
ANA.Show|1!
ENR.
:DoIt
VAR.$$OPE=§§_01
ANA.Mask|0|$$MAS|$$OPE|1
GSB.Print|1|$$OPE
RET.
VAN.$$NUM=§§_01
VAR.$$TXB=§§_02
DBP.$$MAS
VAN.$$COL=$H000000
VAN.$$LAA=&HFFFFFF
VAR.$$LAC=Segoe UI
VAN.$$XP1=100
$$XP1=16
$$YP1=60
VAN.$$SIZ=16
VAR.$$TXA=Mask: $$MAS -> &B010101011010101001010101
ANA.PrintAt|$$NUM|$$TXA|$$COL|$$LAA|$$XP1|$$YP1|$$SIZ|$$LAC|1
$$YP1=96
$$SIZ=64
ANA.PrintAt|$$NUM|$$TXB|$$COL|$$LAA|$$XP1|$$YP1|$$SIZ|$$LAC|1
ANA.Show|1!
RET.
Syntax
ANA.Mask[|P1][|P2][|P3][|P4][|P5]
Parameter Explanation
P1 - opt. Source Image-Register number, if omitted, IR 0 will be used.
P2 - opt. Mask - a 32 bit Integer can be given directly as Binary example: &B010101011010101001010101 if omitted, &B111100001111000011110000 is used.
P3 - opt. Logical Operator: AND, OR, XOR, EQV, IMP, SIMP can be used. Like this:
P4 - opt. Destination Image-Register number, if omitted, P1 will be used.
The Command will leave a 0/1 on the TOS. As always, a 0 means Error, while a 1 means "all fine".
Example
-
Remarks
-
Limitations:
-
See also: