This commit is contained in:
2026-03-19 14:54:09 +03:00
parent 7145b66e0e
commit 37036f8f75
26 changed files with 5466 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
@startuml
title PMA alpha blending в blendPixelAtBuffer
start
:Input dst pixel, src PMA pixel,\ntransform opacity;
if (pixel outside buffer?) then (yes)
stop
endif
if (replace_mode?) then (yes)
:dst = src;
stop
endif
:a = (src.a / 255) * opacity;
:inv_a = 1 - a;
:src_rgb = src.rgb * opacity;
:dst.r = clamp(src_r + inv_a * dst.r);
:dst.g = clamp(src_g + inv_a * dst.g);
:dst.b = clamp(src_b + inv_a * dst.b);
:dst.a = clamp(a*255 + inv_a * dst.a);
:Store dst pixel;
stop
@enduml