Item n from mapping table i, where i is an integer between 0 and 3, inclusive, and n is and integer between 0 and 255, inclusive
Syntax
map(i,n)
Original Machine Code (in OPER resource) of Filter Factory 3.0 and 3.0.4 for Photoshop/Win32
58 | pop eax (param_n) | . |
5B | pop ebx (param_i) | . |
0B DB | or ebx,ebx | . |
7C 27 | jl +$27 (@@3) | if (param_i < 0) goto @@3; // return 0 |
83 FB 03 | cmp ebx,$03 (3) | . |
7F 22 | jnle +$22 (@@3) | if (param_i > 3) goto @@3; // return 0 |
0B C0 | or eax,eax | . |
7D 04 | jnl +$04 (@@1) | if (param_n >= 0) goto @@1; |
2B C0 | sub eax,eax | param_n = 0; // correct param_n to 0 if param_n < 0 |
EB 0B | jmp +$0b (@@2) | goto @@2; |
@@1: | @@1: | |
B9 FF 00 00 00 | mov ecx,$000000ff (255) | . |
3B C1 | cmp eax,ecx | . |
7E 02 | jle +$02 (@@2) | if (param_n <= 255) goto @@2; |
8B C1 | mov eax,ecx | param_n = 255; // correct param_n to 255 if param_n > 255 |
@@2: | @@2: | |
C1 E3 08 | shl ebx,$08 (8) | param_i = param_i * $100; // param_i: {$0, $1, $2, $3} -> {$0, $100, $200, $300} |
03 DF | add ebx,edi | . |
0F B6 84 18 78 01 00 00 | movzx eax,[eax+ebx+$00000178 (map)] | param_n = map[param_i, param_n]; // EDI[$178 + $100*param_i + param_n] |
EB 02 | jmp +$02 (@@4) | goto @@4; |
@@3: | @@3: | |
2B C0 | sub eax,eax | param_n = 0; |
@@4: | @@4: | |
50 | push eax | return param_n; |