简体   繁体   English

HTML canvas globalCompositeOperation模式的规范在哪里?

[英]Where are the specs of HTML canvas globalCompositeOperation modes?

I've been wading through terabytes of erudite essays on various aspects of canvas blending modes lately, and even found beautiful test pages like this one . 最近,我一直在遍历数十亿字节的关于画布混合模式各个方面的博学论文,甚至发现了像这样的精美测试页。

However, I could only find the vaguest description of what the different modes do, on a pixel-per-pixel basis, including the way alpha channel is used either in selecting src/dest pixels or in combining src/dest values. 但是,我只能在每个像素的基础上找到关于不同模式的模糊描述,包括在选择src / dest像素或组合src / dest值时使用alpha通道的方式。

Could a kind soul point me to a reliable source? 请问一个善良的灵魂可以向我提供可靠的消息来源吗?

Formal specifications for the HTML5 canvas 2d context are published by the WhatWG and the World Wide Web Consortium . HTML5 canvas 2d上下文的正式规范由WhatWG万维网联合会发布

The WhatWG references a separate spec for the composite operation values. WhatWG为复合操作值引用了单独的规范

The W3 defines it as follows: 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. 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 HTML 5 canvas globalCompositeOperation(橡皮擦)问题 - HTML 5 canvas globalCompositeOperation (eraser) issues html5 Canvas中的自定义globalCompositeOperation - Custom globalCompositeOperation in html5 Canvas 如何使用globalCompositeOperation来测试画布混合模式 - How to feature test canvas blend modes using globalCompositeOperation HTML5 Canvas:如何伪造globalCompositeOperation =“darker” - HTML5 Canvas: How to fake globalCompositeOperation=“darker” JS:如何获取受支持的HTML画布globalCompositeOperation类型的列表 - JS: How to get list of supported HTML canvas globalCompositeOperation types Quartz 2D 实现 html5 canvas globalCompositeOperation - Quartz 2D implementing html5 canvas globalCompositeOperation HTML5 Canvas 用于叠加梯度的 globalCompositeOperation 没有加起来达到更高的强度? - HTML5 Canvas globalCompositeOperation for overlaying gradients not adding up to higher intensity? 测试浏览器是否对globalCompositeOperation画布属性支持“乘” - Test if browser supports “multiply” for globalCompositeOperation canvas property 将globalCompositeOperation与canvas元素之外的元素一起使用 - Use globalCompositeOperation with elements outside of canvas element javascript canvas。 在全局组合操作之间切换 - javascript canvas. switch between globalcompositeoperation
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM