<< 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.Complement
Complement Colors in an Image-Register (IR)
ANA.Complementary_Color
Complement a specified color-value
Intention
This command will complement all Colours in an IR. Complementary Colors are very good for Overlays as they are good readable.
If you specify P2, then the result will be stored in another IR, P2.
1. Just complement IR 0
This is what happens if you do not specify any parameters.
ANA.New|0|640|400
ANA.vgradient|0|&HFF0000|&H1000FF
ANA.show|0!
ANA.Complement
ANA.show|0!
ENR.
2. Complement any specified IR
If you just specify the Source IR, it will also be the destination of the Operation.
ANA.New|0|640|400
ANA.vgradient|0|&HFF0000|&H1000FF
ANA.show|0!
ANA.Complement|0
ANA.show|0!
ENR.
3. Complement any specified IR to another IR
If you specify the Source IR and Destination IR, the Result will be in another IR.
Anything that was in the Destination IR before will be discarded.
ANA.New|0|640|400
ANA.vgradient|0|&HFF0000|&H1000FF
ANA.copy|0|1
ANA.show|0!
ANA.show|1!
ANA.Complement|0|1
ANA.show|0!
ANA.show|1!
ENR.
Here is another Sample Picture.
Original Picture ANA.Complement
Sample for ANA.complementary_color.
VAF.$$PIA=?exeloc\Sara2.jpg
NEF.$$PIA
MBX.No such file.
ENR.
EIF.
ANA.Load|0|$$PIA
ANA.Show|0!
ANA.GetRes|0|$$XRE|$$YRE|$$SIZ
FOR.$$LOX|0|($$XRE/3*2)|2
PRT.Column: $$LOX/$$XRE
FOR.$$LOY|0|($$YRE/3*2)|1.6
ANA.getpixelcolor|0|$$LOX|$$LOY|$$PIB
ANA.complementary_color|$$PIB|$$PIC
ANA.Setpixelcolor|0|$$LOX|$$LOY|$$PIC
NEX.
NEX.
ANA.Show|0!
ENR.
Syntax
ANA.Complement[|P1][|P2]
Parameter Explanation
P1 - opt. Source Image-Register Number, Source-IR, if omitted, IR 0 will be used.
P2 - opt. Destination Image-Register Number, if omitted, IR P1 will be used as destination IR.
The Command will leave a 0/1 on the TOS. As always, a 0 means Error, while a 1 means "all fine".
ANA.Complementary_Color|P1[|P2]
Parameter Explanation
P1 - RGB-In Value, Example: &HF305A7
P2 - opt. Variable for result. If omitted TOS is used.
The Command will leave a 0/1 on the TOS. As always, a 0 means Error, while a 1 means "all fine".
Example
'***********************************
' ANA.Complement-Sample
'***********************************
ANA.New|0|640|400
ANA.vgradient|0|&HFF0000|&H1000FF
ANA.copy|0|1
ANA.show|0!
ANA.show|1!
ANA.Complement|0|1
ANA.show|0!
ANA.show|1!
ENR.
Remarks
This command is not very optimized, it may take a few seconds for a pictures to get complemented.
If you need Speed, you may want to use ANA.Invert instead.
Limitations:
-
See also: