Report
This commit is contained in:
27
Report/uml/pma-alpha-blending.puml
Normal file
27
Report/uml/pma-alpha-blending.puml
Normal 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
|
||||
Reference in New Issue
Block a user