Image/Pixel-Color Operations

<< Click to Display Table of Contents >>

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

Image/Pixel-Color Operations

ANA.BlitShift - Move IR Content

Previous Top Next


MiniRobotLanguage (MRL)

 

ANA.BlitShift

Move Image-Register (IR) Content left, right, up or down

 

 

Intention

 

This command will move the content of an IR up, down, left or right by a specified number of pixels.

The underlying IR can be automatically increased in Size - or not.

 

 

BS1  > BS2

 

 

1. BlitShift with Source IR -> another IR

This will BlitShift the specified IR into another IR. Depending on the used Blitmode, the Content of the other IR will be part of the result.

 

ANA.New|0|200|100

ANA.hgradient|0|&HFF0000|&H1000F4

ANA.New|1|200|100

ANA.vgradient|1|&H00FF00|&H1F40F4

VAN.$$LOY=20

VAN.$$LOX=30

ANA.show|0!

ANA.show|1!

ANA.bsh|0|1|$$LOX|$$LOY|7

ANA.show|1!

ENR.

 

This is the above example, using Blitmode 7

 

BS3 + BS4       =     BS5

 

 

2. BlitShift over own IR

The result will vary depending on the used Blitmode.

 

ANA.New|0|200|100

ANA.hgradient|0|&HFF0000|&H1000F4

VAN.$$LOY=20

VAN.$$LOX=30

ANA.show|0!

ANA.bsh|0|0|$$LOX|$$LOY|7

ANA.show|0!

ENR.

 

 

BS6     BS7

 

 

2. BlitShift a 2D-Logi into a 3D-Logo

The result will vary depending on the Source Logo.

 

$$PAB=?exeloc\Pics\P3.jpg

 

$$BOR=10

CAL.$$BOB=$$BOR/2

 

IEF.$$PAB

  ANA.Load|1|$$PAB

  ANA.Show|1!

ELS.

  MBX.File does not exist:$crlf$$$PAT

EIF.

 

ANA.GetRes|1|$$XPO|$$YPO  

CAL.$$XPA=$$XPO+$$BOR

CAL.$$YPA=$$YPO+$$BOR

 

' Make a Resized Version of P3

ANA.New|2|$$XPA|$$YPA|1

ANA.New|3|$$XPA|$$YPA

 

' Now mix Shiftzed and Resized Version

ANA.bsh|3|1|$$BOB|$$BOB|2

ANA.Invert|1

ANA.MixTar|1|2|2

ANA.Invert|2

ANA.Show|2!

ENR.

 

 

P3                   clip0149

 

 

 

Syntax

 

ANA.BlitShift[|P1][|P2][|P3][|P4][|P5]

 

Parameter Explanation

 

P1 - opt. Source Image-Register number, if omitted, IR 0 will be used.

P2 - opt. Destination Image-Register number, if omitted, IR 0 will be used.

P3 - opt. X-Shift in Pixel, if omitted 0 is used

P4 - opt. Y-Shift in Pixel, if omitted 0 is used

P5 - opt. Blitmode

 

The Command will leave a 0/1 on the TOS. As always, a 0 means Error, while a 1 means "all fine".

 

 

Example

 

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

' ANA.BlitShift-Sample

' In this Sample we use a recorded 8x8 Pattern, that is filled into an IR

' and the blitted over a Picture. With the right "Shift" it will turn any a fitting Pattern into a black square.

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

' Load Picture

ANA.Load|1|TP8b.bmp

ANA.Mask|1

ANA.rcd|1|&H0|&H000101

 

' Load Fullpic to 0

ANA.Load|0|Soz_100.png

ANA.Mask|0

ANA.rcd|0|&H0|&H000101

 

ANA.copy|0|2

ANA.Show|0

 

STW.ct|Powergraph|debug

HTV.$$MYW

ANA.patternfillHwn|1|0|&HF0F0F0|$$MYW

' 0 ist nun das Multipattern

ANA.copy|2|1

 

VAN.$$LOY=0

VAN.$$LOX=2

ANA.show|0!

ANA.show|1!

ANA.bsh|0|1|$$LOX|$$LOY|7

 

ANA.show|1

' Find black pattern

ANA.scc|1|&H0|8|0

MMV.

MBX.!

ENR.

 

' Here you can see typical operation.
 

 

Picture 1:  This is the recorded Pattern                                Picture 2 This is the Fake-Site where we recorded the pattern                As a result of the Blit-Operation, the place where the pattern fits turns into a black Square.

 

Patternfill_ß1   Soznet   Overlay

 

 

As a result of the Blit-Operation with Blit-Mode 7, the place where the pattern fits turns black, see the black square in the Middle.

 

Overlay2

 

 

Remarks

 

-

 

 

 

Limitations:

 

-

 

 

See also: