Changeset 208 for trunk/Packages/CevoComponents/EOTButton.pas
- Timestamp:
- May 8, 2020, 6:51:18 PM (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/CevoComponents/EOTButton.pas
r188 r208 47 47 begin 48 48 RegisterComponents('C-evo', [TEOTButton]); 49 end;50 51 procedure ImageOp_CBC(Dst, Src: TBitmap; xDst, yDst, xSrc, ySrc, w, h, Color0,52 Color2: integer);53 // Src is template54 // B channel = Color0 amp55 // G channel = background amp (old Dst content), 128=original brightness56 // R channel = Color2 amp57 type58 TPixel = array [0 .. 2] of Byte;59 var60 ix, iy, amp0, amp1, trans, Value: integer;61 SrcLine, DstLine: ^TPixel;62 begin63 Src.BeginUpdate;64 Dst.BeginUpdate;65 for iy := 0 to h - 1 do66 begin67 SrcLine := Src.ScanLine[ySrc + iy] + xSrc * (Src.RawImage.Description.BitsPerPixel shr 3);68 DstLine := Dst.ScanLine[yDst + iy] + xDst * (Dst.RawImage.Description.BitsPerPixel shr 3);69 for ix := 0 to w - 1 do70 begin71 trans := SrcLine[0] * 2; // green channel = transparency72 amp0 := SrcLine[1] * 2;73 amp1 := SrcLine[2] * 2;74 if trans <> $FF then75 begin76 Value := (DstLine[0] * trans + (Color2 shr 16 and $FF) * amp177 + (Color0 shr 16 and $FF) * amp0) div $FF;78 if Value < 256 then79 DstLine[0] := Value80 else81 DstLine[0] := 255;82 Value := (DstLine[1] * trans + (Color2 shr 8 and $FF) * amp183 + (Color0 shr 8 and $FF) * amp0) div $FF;84 if Value < 256 then85 DstLine[1] := Value86 else87 DstLine[1] := 255;88 Value := (DstLine[2] * trans + (Color2 and $FF) * amp1 +89 (Color0 and $FF) * amp0) div $FF;90 if Value < 256 then91 DstLine[2] := Value92 else93 DstLine[2] := 255;94 end;95 SrcLine := Pointer(SrcLine) + (Src.RawImage.Description.BitsPerPixel shr 3);96 DstLine := Pointer(DstLine) + (Dst.RawImage.Description.BitsPerPixel shr 3);97 end;98 end;99 Src.EndUpdate;100 Dst.EndUpdate;101 49 end; 102 50
Note:
See TracChangeset
for help on using the changeset viewer.