2014-01-04 5 views
0

В последнее время я пробирался через терабайты эрудированных эссе по различным аспектам режимов смешивания холста и даже нашел красивые тестовые страницы, такие как this one.Где характеристики HTML-холста globalCompositeOperation?

Однако я мог найти только самое неопределенное описание того, что делают различные режимы на пиксельной основе, в том числе способ, которым альфа-канал используется либо при выборе src/dest пикселей, либо в сочетании значений src/dest ,

Не могли бы вы назвать добрую душу надежного источника?

ответ

1

Официальные спецификации для холста 2ds контекста HTML5 публикуются WhatWG и World Wide Web Consortium.

WhatWG ссылается на значения составных операций a separate spec.

W3 определяет его следующим образом:

source-atop 
    A atop B. Display the source image wherever both images are opaque. Display the destination image wherever the destination image is opaque but the source image is transparent. Display transparency elsewhere. 
source-in 
    A in B. Display the source image wherever both the source image and destination image are opaque. Display transparency elsewhere. 
source-out 
    A out B. Display the source image wherever the source image is opaque and the destination image is transparent. Display transparency elsewhere. 
source-over (default) 
    A over B. Display the source image wherever the source image is opaque. Display the destination image elsewhere. 
destination-atop 
    B atop A. Same as source-atop but using the destination image instead of the source image and vice versa. 
destination-in 
    B in A. Same as source-in but using the destination image instead of the source image and vice versa. 
destination-out 
    B out A. Same as source-out but using the destination image instead of the source image and vice versa. 
destination-over 
    B over A. Same as source-over but using the destination image instead of the source image and vice versa. 
lighter 
    A plus B. Display the sum of the source image and destination image, with color values approaching 255 (100%) as a limit. 
copy 
    A (B is ignored). Display the source image instead of the destination image. 
xor 
    A xor B. Exclusive OR of the source image and destination image. 
vendorName-operationName 
    Vendor-specific extensions to the list of composition operators should use this syntax. 
+0

вправо, [что, кажется, один] (http://dev.w3.org/fxtf/compositing-1/#advancedcompositing). Я посмотрю на это. Большое спасибо. –

Смежные вопросы