|
Algorithm 1: The Conditional Shifting Operation |
|
Input: Mandelbrot set M and the channels R2, G2, and B2. |
-
1:
forI = 1:n
-
2:
find the maximum value of ith column elements of M and denote it as maxi
-
3:
find the maximum values of the ith row elements of R2, G2, and B2 and denote them as maxri, maxgi and maxbi, respectively, as follows:
-
4:
case 1:
-
5:
ifmaxi < maxbi, then
-
6:
perform left cyclic shift on ith elements of R2 for maxi times
-
7:
else
-
8:
perform right cyclic shift on ith elements of R2 for maxi times
-
9:
end if
-
10:
end
-
11:
case 2:
-
12:
ifmaxi < maxri
then
-
13:
perform left cyclic shift on ith elements of G2 for maxi times
-
14:
else
-
15:
perform right cyclic shift on ith elements of G2 for maxi times
-
16:
end if
-
17:
end
-
18:
case 3:
-
19:
ifmaxi < maxgi
then
-
20:
perform left cyclic shift on ith elements of B2 for maxi times
-
21:
else
-
22:
perform right cyclic shift on ith elements of B2 for maxi times
-
23:
end if
-
24:
end
-
25:
end for
-
26:
Finally, when the conditional shifting is finished, R3, G3, and B3 are obtained.
|