Space Diag Scan -Information Coding:




Digramme showing codes for Locations and Directions
        for diagonal scan

Making the codes:

Location:
Each parameter system (for X and Y) has a variable flag that signals if the current value is equal to the minimum value, the maximum value -or is between these values:

The values for these flags are:
Minimum => 1
Between  => 0
Maximum => 2

Each location within the (2-dimensional) scanning area can thus be identified in terms of combinations of the values of these two flags.

                I.e. Minimum, Maximum   (1,2) => Bottom left corner
                       Between, Between      (0,0) => Central area
                   Between, Minimum
     (0,1) => Top Horizontal Edge

Dealing with two numbers is rather awkward
 --so we map them into a single number using the formula:
 
Code = (3 x Y-flag) + X-flag:

i.e.         X-flag => 0 1 2 0 1 2 0 1 2
        3 x Y-flag => 0 0 0 3 3 3 6 6 6
                               ---------------------------   +
                                0 1 2 3 4 5 6 7 8              =>    Location Code
                               ---------------------------


Direction:
The direction of the scan is controlled by incrementing the current (2-dimensional) position by a constant step (the size of the cells contained within the area). The size of the step can be variable -if one
multiplies it by -1, 0, +1 -which actually defines the direction of the increment -and thus (when both parameters are paired) the direction within a 2-dimensional area.

i.e.   X   Y
        -1,  -1    =>  Diagonal towards Bottom left corner
          0,  0     => No movement
          0,  -1    => Vertical upward movement

Note:  Movement is relative to Locations -but the coding is different:
                So we map (convert)  the direction data :

                                                 -1 => 1
                                                   0 => 0
                                                 +1 => 2

                and then code the result (for X and Y) in the same way as the Location code

                                                                                                             (see diagram above)

-------------------------------


Visual link to Algoritm for
          java programme                           Visual
          link to Notes on Java programme


Visual link to java programme


---------------------------------------------------------
click on relevant image to link to notes or Java programmes
---------------------------------------------------------

Creating A Space For Change
Data Space
Klee index




Trevor Batten
Baclayon 2011
home