Image/Pixel-Color Operations

<< Click to Display Table of Contents >>

Navigation:  3. Script Language > Image/Pixel-Color Operations > ANA. - Imageworks > Logic-Operations >

Image/Pixel-Color Operations

ANA.Invert - Invert Colors in IR

Previous Top Next


MiniRobotLanguage (MRL)

 

ANA.Invert

Invert Colors in an Image-Register (IR)

ANA.Inverse_Color

Invert specified RGB-Color

 

 

Intention

 

This command will Invert a specified RGB COlor or a compelte Image-Regster.

It will make yellow from blue, and black will become white.

If you specify P2, then the result will be stored in another IR, P2.

 

1. Just Invert 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.invert

ANA.show|0!

ENR.

 

 

2. Invert 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.invert|0

ANA.show|0!

ENR.

 

 

3. Invert 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.invert|0|1

ANA.show|0!

ANA.show|1!

ENR.

 

Here is another Sample Picture.

clip0184   clip0185            

    Original Picture                                        ANA.Inverse_Color                                  

 

 

4. Using ANA.Inverse_color|$$RGB|$$OUT

to work on partial Image-Registers.

 

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)|1.5

  'PRT.Column: $$LOX/$$XRE

  FOR.$$LOY|0|($$YRE/3*2)|1.5

    ANA.getpixelcolor|0|$$LOX|$$LOY|$$PIB

    ANA.inverse_color|$$PIB|$$PIC    

    ANA.Setpixelcolor|0|$$LOX|$$LOY|$$PIC    

  NEX.

NEX.

ANA.Show|0!

ENR.

 

 

 

clip0184   clip0225

 

 

Syntax

 

ANA.Invert[|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.Inverse_Color|P1[|P2]

 

Parameter Explanation

 

P1 - Source RGBIn-Value. Example: &H3AF80D

  P2 - opt. Destination 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.Inverse_Color-Sample

'***********************************

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.6

  'PRT.Column: $$LOX/$$XRE

  FOR.$$LOY|0|($$YRE/3*2)|2.6

    ANA.getpixelcolor|0|$$LOX|$$LOY|$$PIB

    ANA.inverse_color|$$PIB|$$PIC

    ANA.complementary_color|$$PIB|$$PID

    ANA.Setpixelcolor|0|$$LOX|$$LOY|$$PIC

    ANA.Setpixelcolor|0|($$LOX+1)|$$LOY|$$PID

  NEX.

NEX.

ANA.Show|0!

ENR.

 

 

clip0184   clip0224

 

 

Remarks

 

-

 

 

 

Limitations:

 

-

 

 

See also:

 

    ANA.Complement