FilterFactory - Symbol "i"

Back to function listing

Y value of the YUV color space.

Syntax

i

Synonyms

i0
i1

Formula

i=(76*r+150*g+29*b)/256    (the output range would be i=[0;254] )

Formula corrected in my patch:

i=(299*r+587*g+114*b)/1000    (the output range would be i=[0;255] )

Original Machine Code (in OPER resource) of Filter Factory 3.0 and 3.0.4 for Photoshop/Win32

8B 77 04 mov esi,[edi+$04] (g)
8D 34 B6 lea esi,[esi+esi*4]
03 F6 add esi,esi
8D 34 76 lea esi,[esi+esi*2]
8D 34 B6 lea esi,[esi+esi*4]
8B 4F 08 mov ecx,[edi+$08] (b)
8B D1 mov edx,ecx
C1 E1 03 shl ecx,$03 (3)
2B CA sub ecx,edx
8D 0C 8A lea ecx,[edx+ecx*4]
03 F1 add esi,ecx
8B 07 mov eax,[edi] (r)
8B C8 mov ecx,eax
8D 04 C0 lea eax,[eax+eax*8]
8D 04 41 lea eax,[ecx+eax*8]
8D 04 86 lea eax,[esi+eax*4]
99 cdq
81 E2 FF 00 00 00 and edx,$000000ff (255)
03 C2 add eax,edx
C1 F8 08 sar eax,$08 (8)
50 push eax