この文書は、W3C が作成し、草案として公開されている "SVG Compositing Specification" を日本語に翻訳したものです。
この翻訳のオリジナル URL (下記更新日現在): http://www.hcn.zaq.ne.jp/___/SVGCompositing/index.html
用語の対訳は SVG 1.1 仕様(第2版)日本語訳の用語定義, SVG Tiny 1.2 仕様の用語定義, およびこれらの日本語訳のその他の 用語の対訳 に準じます。
SVG 1.1 仕様など、他の SVG 関連の仕様の日本語訳も公開しています(サイトトップページ)。 この翻訳について誤訳等お気付きの点その他ありましたら、遠慮なく訳者( 連絡先 )までお知らせ願います。
翻訳開始日:2011-07-23, 最終更新日: 2012-01-11
Copyright © 2011 W3C® (MIT, ERCIM, Keio), All Rights Reserved. W3C liability, trademark and document use rules apply.
SVG はベクターグラフィックスを記述する言語ではあるが、通常はディスプレイまたは何らかの印刷メディアに描画される。 SVG 色合成モジュールはすべての範囲の Porter Duff 演算子 [PorterDuff] と混色モードのサポートを提供する。 このモジュールは目を引く効果を生成するラスターとベクターのオブジェクトの結合を可能にする。 SVG is a language for describing vector graphics, but it is typically rendered to a display or some form of print medium. The SVG Compositing module adds support for the full range of Porter and Duff operators [PorterDuff] and blending modes. The module allows for raster and vector objects to be combined to produce eye catching effects.
この文書はディスプレイと印刷環境のための SVG 色合成が利用するマークアップを定義する。 これはその技術的背景および、 SVG 1.1 Full や SVG 1.2 Tiny 仕様, 他の SVG モジュールと伴にどのように SVG 色合成仕様を利用するかについての指針を説明するものである。 This document defines the markup used by SVG Compositing for display and printing environments. It explains the technical background and gives guidelines on how to use the SVG Compositing specification with the SVG 1.1 Full and SVG 1.2 Tiny specifications and other SVG modules.
この節では公開時点におけるこの文書の位置付けについて述べます。 他の文書がこの文書に取って代わることがあります。 現在の W3C の公開物とこの技術報告書の最新版は W3C technical reports index ( http://www.w3.org/TR/ )で見られます。 This section describes the status of this document at the time of its publication. Other documents may supersede this document. A list of current W3C publications and the latest revision of this technical report can be found in the W3C technical reports index at http://www.w3.org/TR/.
この文書は 2011年5月15日付け SVG 色合成仕様の最終草案(Last Call Working Draft)です。 これはディスプレイと印刷のための SVG 固有の特色機能を定義します。 これは進行中の草案であり、この文書内の一部の説明は不完全かもしれません。 この文書は SVG Working Group の現時点における SVG のディスプレイと印刷における利用についての考えを示すものであり、安定版と見なされるべきではありません。 この仕様は SVG 色合成のための適合性基準と新たにおよび再導入される言語特色機能を定義し、SVG 色合成を表示と色合成に利用し得る方法を挙げます。 This document is the 15 March 2011 Last Call Working Draft of the SVG Compositing specification. It defines features of SVG specific to display and printing. It is a draft in progress; some descriptions in this document may be incomplete. This document shows the current thoughts of the SVG Working Group on the use of SVG for display and printing and should not yet be considered stable. This specification defines conformance criteria, new and reintroduced language features for SVG Compositing, and lists the ways SVG Compositing may be used for displaying and compositing.
この文書は W3C Interaction Domain における Graphics Activity の一部として W3C SVG Working Group により作成されました。 W3C SVG Working Group の目標については W3C SVG Charter で討論されています。 W3C SVG Working Group は公開ウェブページ http://www.w3.org/Graphics/SVG/ を維持管理しており、より背景的な情報もそこに含まれています。 この文書の著作者は SVG Working Group の協同者たちです。 This document has been produced by the W3C SVG Working Group as part of the Graphics Activity within the W3C Interaction Domain. The goals of the W3C SVG Working Group are discussed in the W3C SVG Charter. The W3C SVG Working Group maintains a public Web page, http://www.w3.org/Graphics/SVG/, that contains further background information. The authors of this document are the SVG Working Group participants.
この仕様に対するコメントがあれば www-svg@w3.org 宛に送って下さい: このメーリングリストは アーカイブ に記録されています。 このリストに加入し最初の投稿を行った時点でこのアーカイブに保持され公開されることに同意したものとみなされます。 このメーリングリストに加入されたい方は件名に "subscribe" と記したメールを www-svg-request@w3.org 宛てまで送って下さい。 Last Call に対するコメントは 2011年4月12日で締め切られます。 We explicitly invite comments on this specification. Please send them to www-svg@w3.org: the public email list for issues related to vector graphics on the Web(archives). Acceptance of the archiving policy is requested automatically upon first post to either list. To subscribe to this list, send an email to www-svg-request@w3.org with the word subscribe in the subject line. Last Call comments should be sent by 12 April 2011.
草案の公開は W3C Membership からの承認を意味するものではありません。 これは草案文書であり、いつでも他の文書により更新, 置換, 廃案の対象になり得ます。 この文書を進行中の作業以上のものとして引用することは妥当ではありません。 Publication as a Working Draft does not imply endorsement by the W3C Membership. This is a draft document and may be updated, replaced or obsoleted by other documents at any time. It is inappropriate to cite this document as other than work in progress.
この文書は 5 February 2004 W3C Patent Policy に従事しているグループにより作成されています。 W3C はグループの成果物に関連して public list of any patent disclosures の作成と維持管理を行っています。そのページには特許開示の手引きも含まれます。特許に関する実際的知識を持ち、そこに Essential Claim(s) が含まれていると主張する者は section 6 of the W3C Patent Policy に従って情報を公開しなければなりません。 This document was produced by a group operating under the 5 February 2004 W3C Patent Policy. W3C maintains a public list of any patent disclosures made in connection with the deliverables of the group; that page also includes instructions for disclosing a patent. An individual who has actual knowledge of a patent which the individual believes contains Essential Claim(s) must disclose the information in accordance with section 6 of the W3C Patent Policy.
この文書の主要な目的は一般からのフィードバックを促す所にあります。 フィードバックの最適な手段は www-svg@w3.org へメールを送信することです。 その際はメッセージの件名の中でコメントが対象にする仕様の部分を特定するように願います( "Compositing blend modes" 等)。 この文書の複数の部分に対するコメントがある場合は、別々に分けて送信されることが望まれます。 The main purpose of this document is to encourage public feedback. The best way to give feedback is by sending an email to www-svg@w3.org. Please identify in the subject line of your message the part of the specificationto which your comment refers (e.g Compositing blend modes). If you have comments on multiple areas of this document, then it is preferable to send several separate comments.
この文書についての一般からのコメントを歓迎します。 しかしながら、 SVG Working Group が明示的にフィードバックを欲している部分は限られています。 それらの部分にはこの文書の中でこのように見える様に class 属性値 'feedback' が付与されています。 The public are welcome to comment on any aspect in this document, but there are a few areas in which the SVG Working Group are explicitly requesting feedback. These areas are noted in place within this document with a class attribute value of 'feedback', which look like this.
この文書内の適合性についての言明は規定として記される。 また、この文書のすべての等式は規定である。 他のすべての内容は参考情報である。 この文書には何らかの RNG 定義 【 RNG - RELAX NG】 と重なる明示的な適合性基準の要求が含まれている。 もし2つの間に相反する部分が存在する場合、明示的な適合性基準を最終的な基準とする。 Conformance statements in this document are marked as normative, and all equations in this document are normative. All other content is informative. This document contains explicit conformance criteria that overlap with some RNG definitions in requirements. If there is any conflict between the two, the explicit conformance criteria are the definitive reference.
色合成とはいくつかのオブジェクト(およびその周辺領域)の色を結合(混合)する処理を意味する。 オブジェクトはその通常の色値(赤, 緑, 青)に加え、色の透明度を表現するチャンネルも持つ。 このチャンネルは一般にアルファチャンネルとして知られており、しばしばオブジェクトの「不透明度」( opacity )を表現するものと言われる。 実際、オブジェクトの不透明度はオブジェクトの色が色合成の際にどれだけの割合で利用されるかを制御する。 By definition compositing is the process by which the colors of objects (and their surrounding regions) are combined together. In addition to its regular color values (such as red, green, and blue), an object may contain a channel to represent the transparency of the color. This channel is commonly known as an alpha channel and is often said to represent the 'opacity' of an object. In effect the opacity of an object controls how much of the object's color is used when compositing.
アルファチャンネルも含めた色合成はアルファ合成と呼ばれる。 既定では SVG Full 1.1 [SVG11] と SVG Tiny 1.2 [SVGT12] はいずれも、背景を覆うオブジェクトによる結果の効果に 単純アルファ合成 を利用する。 覆っているオブジェクトが透明度を含んでいれば、背景の色はそのオブジェクトを透過して見えるようになる。 Compositing involving the alpha channel is referred to alpha compositing. By default SVG Full 1.1 [SVG11] and SVG Tiny 1.2 [SVGT12] both use Simple Alpha Compositing that gives a resultant effect of overlaying the object on to the background. If the overlayed object contains transparency, the color of the background may show through the overlayed object.
SVG 色合成モジュールは SVG 1.1/1.2/2.0 Requirements 文書 [SVGReqs] にて概要が述べられたグラフィカルな特色機能の中の色合成についての要件を満たすことを目指す。 この要件を達成するため、 SVG 色合成モジュールは SVG Full 1.1 [SVG11] および SVG Tiny 1.2 [SVGT12] の単純アルファ色合成モデルを拡張する。 この SVG モジュールは次のクリッピング/マスキング特色機能をサポートする: The SVG Compositing Module attempts to addresses compositing requirement for graphical features outlined in SVG 1.1/1.2/2.0 Requirements document [SVGReqs]. To achieve this requirement the SVG Compositing Module extends the Simple Alpha Compositing model in SVG Full 1.1 [SVG11] and SVG Tiny 1.2 [SVGT12]. This SVG module supports the following clipping/masking features:
この節は規定である。 This section in normative.
グループアルファとはグラフィカルな要素を入れ子に持つコンテナ要素に遭遇した際に、通常はメモリ内に作成される単チャンネルのオフスクリーンバッファである。 グループアルファバッファは グループ画像 バッファの中で背景が占める割合を記憶しておくために用いられる。 グループアルファは グループ画像 が キャンバス 上に合成されるとき、最終結果の中での グループ画像 が占める正確な量を与えるために利用される。 The group alpha is a single channel offscreen buffer that is typically created in-memory when a container element with nested graphical elements is encountered. The group alpha buffer is used to track percentage of the background in the group image buffer. When the group image is composited on to the canvas, the group alpha is used to ensure that the correct amount of the group image is present in the final result.
グループ画像はグラフィカルな要素を入れ子に持つコンテナ要素に遭遇した際に、通常はメモリ内に作成されるオフスクリーンバッファである。 グループ画像バッファの初期化は ‘enable-background’ プロパティにより制御される。 コンテナ要素内の入れ子の要素はグループ画像バッファの中へ描画され、しかる後、そのグループがキャンバス上に合成される。 The group image is an offscreen buffer that is typically created in-memory when a container element with nested graphical elements is encountered. Initialisation of a group image buffer is controlled by the ‘enable-background’ property. Elements nested within the container element are rendered into the group image buffer. The group is then composited on to the canvas.
ホスト言語はそれぞれの要素により表現される塗り領域を定義する責を負う。 The host language is reponsible for defining the painted region represented by each element.
SVG の 図形, テキスト に対しては、 塗り領域 とは、フィルおよびストローク領域の和であり、その結果生成される外形線は(オブジェクトに適用される不透明度値とは関係無く)オブジェクトにより塗られるキャンバス上の領域を表現する。 オブジェクトの 塗り領域 の算出においては、 UA は最終的な塗り領域の決定にすべての フィルおよびストローク プロパティを利用しなければならない。 図形に配置されるマーカを作成する要素のフィルおよびストローク値もオブジェクトの塗り領域に寄与しなければならない。 For SVG shapes and text, the painted region is the union of fill and stroke regions producing a resultant outline that represents the canvas area painted by the object regardless of any opacity values applied to the object. When calculating the painted region of an object the user agent must use all fill and stroke properties to determine the final painted region. The fill and stroke values of elements that make up the markers placed on shape must contribute to the painted region of an object.
例えば:
SVG の 画像 と ビデオ に対しては、参照の計算値が有効なリソースを指すならば、その塗り領域はオブジェクトの境界になる。 そうでなければ、オブジェクトは塗り領域を持たない。 For SVG images and videos, if the computed value of the reference points to a valid resource, the painted region is the bounds of the object. Otherwise, the object has no painted region.
SVG フィルタ に対しては、塗り領域はそのフィルタを参照するオブジェクトの塗り領域になる。 For SVG filters, the painted region is the object's painted region that references the filter.
デジタル画像色合成 の論文に概要が述べられているように、 Thomas Porter と Tom Duff は色合成の代数式を定義した。 これらの結果による数式は現在では 12種類の "Porter Duff" 演算子として知られている。 "Porter Duff" 演算子はアルファチャンネル値を持つグラフィカルなオブジェクトの重なりがなす4つの部分画素領域の混合結果を定義する。 As out lined in their paper Compositing Digital Images, Thomas Porter and Tom Duff defined algebra expression for compositing. These expressions resulted in what is known today as the twelve "Porter Duff" operators. The "Porter Duff" operators define the results of mixing the four sub-pixel regions formed by the overlapping of graphical objects that have an alpha channel value.
グラフィックス要素は拡張 Porter-Duff 色合成モデルに基づき、キャンバス上のどの画素に対しても結果の色と不透明度が指定された ‘comp-op’ に従うように、キャンバス上にすでに描画された要素の上に合成される。 下に示される 12 の基本的な Porter-Duff 演算による結果は常に [0 … 1] 区間内の値になる。従って出力値に対する切り詰めは不要である。 Graphics elements are composited onto the elements already rendered on the canvas based on an extended Porter-Duff compositing model, in which the resulting color and opacity at any given pixel on the canvas depend on the ‘comp-op’ specified. The base set of 12 Porter-Duff operations shown below always result in a value between zero and one, and as such, no clamping of output values is required.
12 の基本的な Porter-Duff 演算に加え、いくつかの混色演算もサポートされる。 これらの混色演算は基本 Porter-Duff セットの拡張であり、より高機能な色合成のふるまいを提供する。 この拡張による演算結果は [0 … 1] 区間外の色と不透明度値をとり得る。 不透明度値は [0 … 1] 区間内に切り詰められるべきであり、積算済み色値は [0 … 不透明度値] 区間内に切り詰められるべきである。 In addition to the base set of 12 Porter-Duff operations, a number of blending operations are supported. These blending operations are extensions of the base Porter-Duff set and provide enhanced compositing behavior. The extended operations may result in color and opacity values outside the range zero to one. The opacity value should be clamped between zero and one inclusive, and the premultiplied color value should be clamped between zero and the opacity value inclusive.
次の図式に色合成において考察の対象になる1個の画素の中の4つの領域を示す。 The following diagram shows the four different regions of a single pixel that are considered when compositing.
結果の画素に上の図式のどの領域からの入力が含まれるかは色合成演算に依存する。 合成元または合成先のみが存在する領域については、入力を含めるか含めないかの選択がある。 いずれも存在する領域については、入力データの組み合わせについて種々のオプションが用意されている。 Depending on the compositing operation the resultant pixel includes input from one or more of the regions in the above diagram. For the regions where only source or destination are present, a choice of including or not including the input is available. For the region where both are present, various options are available for the combination of input data.
色合成演算子を含むグループについては、コンテナ要素自身の ‘comp-op’ プロパティがグループのキャンバスへの合成に利用される演算を与える。 ‘opacity’ など、コンテナ要素の他のプロパティは、子が結合された後の, グループが背景上に合成される前に行われる演算を指定する。 ‘enable-background’ および ‘knock-out’ プロパティは、グループバッファが利用される前の初期化の状態, グループの子の色合成に対する変更, 一部の場合においては子が描画された後の他の描画の後処理すべての前に行われる描画の後処理, を指定する。 For groups containing compositing operators, the operation used to composite the group onto the canvas is the ‘comp-op’ property of the container element itself. Other properties on container elements, such as ‘opacity’, specify operations that are performed after the children have been combined and before the group is composited onto the background. The ‘enable-background’ and ‘knock-out’ properties specify the state the group buffer is initialized to prior to use, any modification to the compositing of the group's children, and in some cases a post rendering step to be performed after rendering the children and prior to any other post rendering steps.
実装上の注意: 種々のコンテナ要素においてそれらの境界は描画前に計算される。 例えば、一般にグループの描画にはオフスクリーンバッファが必要になるが、そのサイズはグループ内に含まれるオブジェクトの境界の計算から決定される。 SVG 1.0 実装では一般にグループの境界はグループ内の各オブジェクトの境界の和から算出される。 グループ内のオブジェクトの結合に利用される色合成演算によっては、グループの境界を縮小し得るので、必要なメモリ量も少なく済む。 例えば、グループが2つのオブジェクト - オブジェクト A 'in' オブジェクト B - を含む場合、 グループの境界はそれらの境界の和よりもオブジェクト A の境界と B の境界の共通部分になる。 Implementation note: Various container elements calculate their bounds prior to rendering. For example, rendering a group generally requires an off-screen buffer, and the size of the buffer is determined by calculating the bounds of the objects contained within the group. SVG 1.0 implementations generally calculated the bounds of the group by calculating the union of the bounds of each of the objects within the group. Depending on the compositing operations used to combine objects within a group, the bounds of the group may be reduced, and so, reduce the memory requirements. For example, if a group contains two objects - object A 'in' object B - then the bounds of the group would be the intersection of the bounds of objects A and B as opposed to the union of their bounds.
コンテナ要素はバッファの生成を要するものとして定義されてはいるが、種々の最適化により UA がこのバッファの生成を選択しない場合も多々ある。 例えば、単体のオブジェクトからなるグループは、一度もバッファに描画することなく、直接背景に描画し得る場合もある。 While container elements are defined as requiring a buffer to be generated, it is often the case that a user agent using various optimizations can choose not to generate this buffer. For example, a group containing a single object could be directly rendered onto the background rather than into a buffer first.
以下の変数が背景成分, グループ成分, 追加の不透明度チャンネルバッファ成分の記述に用いられる。 この定義リストは規定である。 The following variables are used to describe the components of the background, group and extra opacity channel buffers. This definition list is normative.
オブジェクトを背景上に置く際に用いられる演算は次のようになる: The operation used to place objects onto the background is as follows:
Dca' = f(Sc, Dc) × Sa × Da + Y × Sca × (1-Da) + Z × Dca × (1-Sa)
Da' = X × Sa × Da + Y × Sa × (1-Da) + Z × Da × (1-Sa)
色合成演算によっては、上の等式は描画前に積算済みの値による式に簡約され得る。 各色合成演算に対し、次が指定される: Depending on the compositing operation, the above equation is resolved into an equation in terms of premultiplied values prior to rendering. The following are specified for each compositing operation:
X, Y, Z, f(Sc, Dc)
これらは次で定義される: defined as:
上の各値が合成先画素値の生成に利用されるかどうかは色合成演算に依存する。 Depending on the compositing operation, each of the above values may or may not be used in the generation of the destination pixel value.
この節は規定である。 This section in normative.
Porter-Duff 拡張混色演算を用いた色合成においては色と不透明度が [0 … 1] 区間外の値になり得る。 When compositing using Porter-Duff extended blending operations color and opacity values may fall outside the range zero to one.
UA は色と不透明度値を [0 … 1] 区間内に切り詰めなければならない。 A User Agent MUST clamp color and opacity values between zero and one inclusive.
UA は積算済みの色値を [0 … 1] 区間内に切り詰めなければならない。 A User Agent MUST clamp premultiplied color values between zero and one inclusive.
この節は規定である。 This section in normative.
‘clip-to-self’ プロパティは、オブジェクトがそれに覆われていない画素にも効果を及ぼし得るかどうかを決定し、 Java2D との互換性を提供する。 【訳者は Java2D との関連がわかっていないのでこの文の正確な意図を把握しきれていない】 The ‘clip-to-self’ property provides compatibility with Java2D by determining if the object effects pixels not covered by the object.
| 値: | object | canvas | inherit |
| 初期値: | canvas |
| 適用対象: |
描画対象になる要素すべて。 どの要素を描画対象とするかはホスト言語が責を負う。 SVG においては:コンテナ要素とグラフィックス要素。 All elements that render. The host language is responsible for stating which elements render. For SVG: container elements and graphics elements. |
| 継承: | しない |
| パーセント: | N/A |
| メディア: | 視覚 |
| アニメーション: | 可 |
オブジェクトの色合成は、オブジェクトに覆われていない領域に対しては完全に透明な合成元を合成先上に合成することにより、キャンバスのすべての画素に効果を及ぼし得る。 これが lacuna 値 。 Compositing an object effects all pixels on the canvas by compositing completely transparent source onto the destination for areas not covered by the object. This is the lacuna value.
オブジェクトの色合成は、オブジェクトの 塗り領域 によるオブジェクトに覆われている画素にのみ、効果を及ぼし得る。 Compositing an object only effects the pixels covered by the object as by the object's painted region.
‘clip-to-self’ プロパティが object に設定されたグラフィックス要素においては、要素の 塗り領域 の範囲内の画素に対してのみ効果を及ぼす。 ‘clip-to-self’ が object に設定されている所では、色合成演算の際に要素の 塗り領域 からクリッピングパスを作成できる。 要素がキャンバス上に合成される際は生成されたクリッピングパスを通して合成されるので、その要素の範囲外の画素には影響されない。 Graphics elements where the ‘clip-to-self’ property is set to object only effect the pixels within the extent of the element's painted region. A clipping path can be created from an element's painted region when performing a compositing operation where ‘clip-to-self’ is set to object. When the element is composited onto the canvas, it is composited through the generated clipping path and thus pixels outside of the extent of the element remain unmodified.
‘clip-to-self’ プロパティが object に設定されたコンテナ要素においては、 コンテナ要素の範囲内の画素のみに効果が及ぶ。 例えばコンテナ要素に2つの円が含まれていて、コンテナ要素の ‘clip-to-self’ プロパティが object であったならば、2つの円の外側の領域には効果が及ばない。 この演算を実行するためには、 UA はコンテナ要素内のそれぞれの要素の範囲を把握して、それらの要素の範囲のみが変更されるようにする必要がある。 これは各オブジェクトに対し 塗り領域 によるクリッピングパスを作成し、それらのクリッピングパスの和をとり、コンテナ要素内のすべての要素で覆われる画素の範囲を定義するクリッピングパスを生成することにより達成できる。 コンテナ要素がコンテナ要素を入れ子にする所では、結果のクリッピングパスを生成するために、その入れ子にされたコンテナ要素の中でも同じ演算が行われる。 コンテナ要素のキャンバスへの合成は、この結果のクリッピングパスを通して行われるので、コンテナ内の要素の範囲外の画素は影響されない。 Container elements where the ‘clip-to-self’ property is set to object only effect the pixels within the extend of the container element. For example, if a container element contains two circles, and the container element has the ‘clip-to-self’ property is set to object, then region outside the circles is unaffected. To perform this operation, the user agent needs to keep track of the extent of each of the elements within the container element and ensure that only the elements are modified. This can be produced by creating a clipping path from each object's painted region and unioning the clipping paths together to produce a resultant clipping path that defines the extent of the pixels covered by all the elements within the container element. Where a container element contains nested container elements, the operation is performed within the sub-container elements to produce the resultant clipping path. When the container element is composited onto the canvas, it is composited through the resultant clipping path and thus pixels outside of the extent of the elements within the container remain unmodified.
UA は ‘clip-to-self’ プロパティの指定に従って定まる画素領域に効果を及ぼさなければならない。 A User Agent MUST affect the pixel region as specified by the ‘clip-to-self’ property.
いくつかの色合成演算は合成先を除去しない。 これらの演算では ‘clip-to-self’ プロパティは何の効果もない。 合成先を除去する色合成演算は clear, src, src-in, dst-in, src-out, dst-atop である。 これらの演算は色合成演算の図式に示されている中で右側の青色の領域を除去する演算が該当する。 他のすべての演算においては ‘clip-to-self’ プロパティには何の効果もない。 Most compositing operations do not remove the destination and as such for these operations, the ‘clip-to-self’ property has no effect. The compositing operations that remove the destination are clear, src, src-in, dst-in, src-out and dst-atop. These operations are illustrated in the compositing operation diagrams and are the operations that remove the right-hand blue region in diagram. For all other operations the ‘clip-to-self’ property has no effect.
‘clip-to-self’ プロパティが canvas に設定されている一部のコンテナ要素に対しては、その境界の外側の背景にも効果を及ぼし得る。 For some container elements where the ‘clip-to-self’ property is set to canvas, the container element might effect the background outside bounds of the container element.
この節は規定である。 This section in normative.
‘enable-background’ プロパティはグループの色合成におけるグループ画像キャンバスがどのように初期化, 管理されるかを制御する。 The ‘enable-background’ property controls how the group image canvas for group compositing is initialized and managed.
| 値: | accumulate | new [ <x> <y> <width> <height> ] | inherit |
| 初期値: | accumulate |
| 適用対象: |
描画対象になる要素を含む要素。 どの要素が描画対象になる要素を含むものとするかはホスト言語が責を負う。 SVG においては:コンテナ要素。 Elements that contain elements that render. The host language is responsible for stating which elements contain elements that render. For SVG: container elements. |
| 継承: | しない |
| パーセント: | N/A |
| メディア: | 視覚 |
| アニメーション: | 不可 |
グループ画像 バッファは黒地透明に初期化されて確立される。 現在の要素のすべての子は新たな グループ画像 の中に描画されるものとする。 A group image buffer is established which is initialized to transparent black. All children of the current element shall be rendered into the new group image.
オプションの <x>, <y>, <width>, <height> パラメータは、利用空間においてオブジェクトが合成されるコンテナ要素の部分領域を指示する。 これらのパラメータは グループ画像 キャンバスのクリッピング矩形として働き、 SVG UA が要する一時画像バッファもコンテナ要素の実際の境界より小さくなり得る。 <x>, <y>, <width>, <height> のいずれかが指定されていない、あるいは <width>, <height> のいずれかに 1 より小さい値が指定されていた場合、オブジェクトは ‘enable-background’ プロパティが accumulate に設定されていたかのように合成される。 The optional <x>, <y>, <width> and <height> parameters indicate in user space, the subregion of the container element where objects are composited onto. These parameters act as a clipping rectangle on the group image canvas enabling the SVG usage agent to potentially allocate a smaller temporary image buffer than the effective bounds of the container element. If not all the <x>, <y>, <width> and <height> values are specified, or if either <width> or <height> are specified as a value less than 1, then the objects are composited as if the ‘enable-background’ property was set to accumulate.
グループ画像 バッファは現在のキャンバスの対応する領域の複製に初期化されて確立される。 加えて、 グループアルファ バッファは不透明に初期化されて確立される。 グループアルファ は グループ画像 内で背景が占める割合を格納するために利用される。 現在の要素のすべての子は グループ画像 の中へ描画されるものとする。 これが lacuna 値 。 A group image buffer is established which is initialized with corresponding area of the current canvas copied into it. Additionally, a group alpha buffer is established which is initialized to be opaque. The group alpha is used to store the percentage of background in the group image. All children of the current element shall be rendered into the group image. This is the lacuna value.
UA は ‘enable-background’ プロパティの指定に従ってコンテナ要素のバッファを初期化しなければならない。 A User Agent MUST initialize the buffer of the container element as specified by ‘enable-background’ property.
new のオプションのパラメタが与えられていて、そのどれかが指定されていない場合、 UA は ‘enable-background’ プロパティが accumulate に設定されていたかの様にコンテナ要素内の子を描画しなければならない。 A User Agent MUST render children with in a container element as if the ‘enable-background’ property was set to accumulate if not all the optional new parameters are specified when optional parameters are provided.
new のオプションの <width> または <height> パラメタが 1 より小さい場合、 UA は ‘enable-background’ プロパティが accumulate に設定されていたかの様にコンテナ要素内の子を描画しなければならない。 A User Agent MUST render children with in a container element as if the ‘enable-background’ property was set to accumulate if the new optional <width> or <height> parameters are less than 1.
‘enable-background’ が accumulate に設定されている場合、 UA はグループ内のオブジェクトの色合成から生じる追加の背景バッファに対する reduction を適用しなければならない。 A User Agent MUST apply the reduction to the additional background buffer caused by compositing an object in the group when ‘enable-background’ is set to accumulate.
‘enable-background’ が new に設定されたコンテナ要素に対しては、 そのコンテナ要素の グループ画像 バッファは透明に初期化される。 この グループ画像 はコンテナの子に対するキャンバスとして扱われる。 コンテナ要素の完全な内容が グループ画像 上に描画される際、バッファはコンテナ要素に指定された色合成演算を用いて キャンバス に合成される。 For a container element with ‘enable-background’ set to new, the container element's group image buffer is initially cleared to transparent. This group image is treated as the canvas for the containers's children. When the complete contents of the container element are rendered onto the group image, the buffer is composited onto the canvas using the container element's specified compositing operation.
‘enable-background’ が accumulate のコンテナ要素に対しては、 キャンバス の対応する領域がコンテナ要素の グループ画像 バッファの中へ複製される。 不透明度チャンネルのみを持つ グループアルファ バッファも作成される。 このバッファ Da(d) は グループ画像 内の背景が占める割合を格納し、初期状態は不透明である。 グループ画像 は通常通りグループの子に対するキャンバスとして扱われる。 加えて、オブジェクトが グループ画像, の中に置かれるのに伴い、それらは下に挙げる演算のいずれかを用いて Da(d) グループアルファ バッファにも置かれる。 コンテナ要素のすべての子が グループ画像 に合成された後、 グループ画像 は以下の段階を踏んで キャンバス に合併される。 For a container element with ‘enable-background’ set to accumulate, the corresponding area of the canvas is copied into the container element's group image buffer. A group alpha buffer which has only an opacity channel is also created. This buffer Da(d) stores the percentage of the background in the group image and is initially opaque. The group image is treated as the canvas for the children of the group as usual. Additionally, as objects are placed into the group image, they are also placed into the Da(d) group alpha buffer using one of the operations listed below. When all the children of the container element have been composited in to the group image the following steps are performed to merge the group image with the canvas.
‘enable-background’ が accumulate のコンテナ要素に対しては、 グループ画像 を背景( キャンバス )上に置くために用いられる色合成演算が変更される。 この演算はオブジェクトにより生じる背景に対するどの reduction にも適用される。 For container elements with an ‘enable-background’ set to accumulate, the compositing operation used to place the group image onto the background (canvas) is modified. The operation will apply any reduction to the background caused by the objects.
‘enable-background’ が accumulate のコンテナ要素内の要素が描かれる際は、下に示す標準的な等式がオブジェクトを グループ画像 の中に描く際に用いられる。 色合成演算に依存して下の2つの演算のいずれかが、オブジェクトを追加の グループアルファ バッファ Da(d) の中に描く際に用いられる。 When drawing elements within a container element with ‘enable-background’ set to accumulate, the standard equations as listed below are used to draw the object into the group image. Depending on the compositing operation, one of two operations listed below are used to draw the object into the extra group alpha buffer Da(d).
演算 clear, src, src-in, dst-in, src-out, dst-atop に対しては: For the operations clear, src, src-in, dst-in, src-out and dst-atop:
Da(d)' = 0
他のすべての色合成演算に対しては: For all other compositing operations:
Da(d)' = Da(d) × (1 - Sa)
一旦、コンテナ要素の内容がコンテナ要素の グループ画像 バッファに描画されれば、 ‘opacity’ や ‘filter’ 効果などの演算がバッファに適用される前に、以下の演算を用いて残りの背景 (キャンバス) がコンテナ要素のバッファから除去される: Once the contents of a container element are rendered into the container element's group image buffer and before operations such as ‘opacity’ or ‘filter’ effects are applied to the buffer, the remaining background (canvas) is removed from the container element's buffer using the following operations:
Dca1' = Dca1 - Dca0 × Da1(d)
Da1' = Da1 - Da0 × Da1(d)
この時点で Da1(d) は反転されるべきである。 反転された Da1(d) はコンテナ要素を背景に置く際に背景から除去される量を表現する。 At this point Da1(d) should be inverted. The inverted Da1(d) represents the amount of data to be removed from the background when placing the container element onto the background.
Da1(d)' = 1 - Da1(d)
次に行われる演算は ‘opacity’ や ‘filter’ 効果をコンテナ要素のバッファに適用するものである。 この段階において Da1 に対して行われる(いくつかの)演算は、 Da1(d) に対しても行われるべきものになる。 The next operation to perform is the application of ‘opacity’ or ‘filter’ effects to the container element's buffer. During this step, the operation(s) performed on Da1 should also be performed on Da1(d).
コンテナ要素の グループ画像 バッファを背景上に合成する際は、上に挙げた標準的な色合成演算ではなく、次の演算が用いられるべきである: When compositing the container element's group image buffer onto the background, rather than the standard compositing operation listed above, the following operations should be used:
Dca0' = f(Dc1,Dc0) × Da1 × Da0 + Y × Dca1 × (1-Da0) + Z × Dca0 × (1-Da1(d))
Da0' = X × Da1 × Da0 + Y × Da1 × (1-Da0) + Z × Da0 × (1-Da1(d))
上の等式の最後の項は Da ではなく Da(d) バッファを利用している。 The last term in the above equations uses the Da(d) buffer rather than Da.
フィルタは BackgroundImage と BackgroundAlpha 画像を通して最も近い祖先のグループのバッファにアクセスする。 フィルタを参照する要素の祖先のグループ要素に対し作成されたバッファがフィルタに渡される。 フィルタを参照する要素の祖先に ‘enable-background’ プロパティの値が new を持つものが存在しなければ、黒地透明がフィルタの入力に渡される。 Filters have access to the nearest ancestor group's buffer through the BackgroundImage and BackgroundAlpha images. The buffer created for the ancestor group element of the element referencing the filter, is passed to the filter. Where no ancestors of the element referencing the filter containing an ‘enable-background’ property value of new, transparent black is passed as input to the filter.
コンテナ要素はバッファの生成を要するものとして定義されてはいるが、種々の最適化により UA がこのバッファの生成を選択しない場合も多々ある。 例えば、単体のオブジェクトからなるグループは、一度もバッファに描画することなく、直接背景に描画し得る場合もある。 While container elements are defined as requiring a buffer to be generated, it is often the case that a user agent using various optimizations can choose not to generate this buffer. For example, a group containing a single object could be directly rendered onto the background rather than into a buffer first.
この節は規定である。 This section in normative.
‘knock-out’ プロパティは、オブジェクトの色と不透明度がコンテナ内で重なり合うオブジェクトの色と不透明度を置換するかどうかを決定する。 The ‘knock-out’ property determines if the color and opacity of an object replaces the color and opacity of objects it overlaps in the container.
| 値: | replace | preserve | inherit |
| 初期値: | preserve |
| 適用対象: |
描画対象になる要素を含む要素。 どの要素が描画対象になる要素を含むものとするかはホスト言語が責を負う。 SVG においては:コンテナ要素。 Elements that contain elements that render. The host language is responsible for stating which elements contain elements that render. For SVG: container elements. |
| 継承: | しない |
| パーセント: | N/A |
| メディア: | 視覚 |
| アニメーション: | 不可 |
オブジェクトの色と不透明度はコンテナ要素内の他のオブジェクトの色と不透明度を置換する。 The object color and opacity replaces that of other objects within the container element.
オブジェクトの色と不透明度は通常通りコンテナの色合成演算ごとに overlay される。 これが lacuna 値 。 The object color and opacity is overlayed normally as per the container compositing operation. This is the lacuna value.
‘knock-out’ プロパティが replace の複合グループに対しては、バッファが作成される。 バッファの初期内容、および、追加の不透明度チャンネルが作成されるかどうかは ‘enable-background’ プロパティの値に依存する。 For a complex group where the ‘knock-out’ property is set to replace, the buffer is created. The initial contents of the buffer and whether a secondary opacity channel is created depends on the value of the ‘enable-background’ property.
UA は ‘knock-out’ プロパティの指定に従ってコンテナ要素内のオブジェクトの色と不透明度に効果を及ぼさなければならない。 A User Agent MUST effect the color and opacity of the objects within the container element as specified by the ‘knock-out’ property.
コンテナ要素内のそれぞれのオブジェクトに対し、オブジェクトの色と不透明度は overlay するのではなく、他のオブジェクトの色と不透明度を置換する。 実際には、複合グループの子の色合成演算に対する合成先入力は、その複合グループに対する現在のバッファではなく、バッファの元の内容になる。 For each object within the container element, the object color and opacity replaces that of other objects, rather than overlaying it. In effect, the destination input to the compositing operations for the complex group's children is the original contents of the buffer, rather than the current buffer for the complex group.
knock-out: preserve の場合: For knock-out: preserve:
Dca1' = f(Sca, Sa, Dca1, Da1)
Da1' = f(Sa, Da1)
knock-out: replace かつ enable-background: new の場合: For knock-out: replace and enable-background: new:
Dca1' = f(Sca, Sa, 0, 0)
Da1' = f(Sa, 0)
knock-out: replace かつ enable-background: accumulate の場合: For knock-out: replace and enable-background: accumulate:
Dca1' = f(Sca, Sa, Dca0, Da0)
Da1' = f(Sa, Da0)
knockout グループの中の ‘clip-to-self’ プロパティが設定されていない要素は、事実上、グループ内の前の要素すべてをクリアする。 An element in a knockout group that does not have the ‘clip-to-self’ property set, in effect clears all prior elements in the group.
この節は規定である。 This section in normative.
‘comp-op’ プロパティは要素をキャンバス上に置く際に利用される色合成演算を決定する。 The ‘comp-op’ property determines the compositing operation used when placing elements onto the canvas.
| 値: | clear | src | dst | src-over | dst-over | src-in | dst-in | src-out | dst-out | src-atop | dst-atop | xor | plus | multiply | screen | overlay | darken | lighten | color-dodge | color-burn | hard-light | soft-light | difference | exclusion | inherit |
| 初期値: | src-over |
| 適用対象: |
描画対象になる要素すべて。 どの要素を描画対象とするかはホスト言語が責を負う。 SVG においては:コンテナ要素とグラフィックス要素。 All elements that render. The host language is responsible for stating which elements render. For SVG: container elements and graphics elements |
| 継承: | しない |
| パーセント: | N/A |
| メディア: | 視覚 |
| アニメーション: | 可 |
下の図式に各色合成演算に対する画素の部分領域ごとの出力を示す。 The diagram below shows the sub-pixel regions output by each of the compositing operations.
前節で述べられたように、親のコンテナ要素の境界は必要なメモリ量したがって画素の書き込み量も節減するように最適化し得る。 コンテナ要素の境界が一度定まれば、各要素はこれらの境界内の画素にのみ効果が及ぶ。 As discussed in the previous section, the bounds of the parent container element can be optimized to save in memory usage and hence, pixel writing requirements. Once the bounds of the parent container element have been determined, each element can only affect the pixels within those bounds.
UA は ‘comp-op’ プロパティの指定に従って、コンテナ要素内のオブジェクトの色と不透明度に効果を及ぼさなければならない。 A User Agent MUST effect the color and opacity of the objects within the container element as specified by the ‘comp-op’ property.
次の演算子は合成元が透明な所においても画素を変更する: clear, src, src-in, dst-in, src-out, dst-atop The following operators change pixels where the source is transparent: clear, src, src-in, dst-in, src-out and dst-atop.
UA はコンテナ要素を生成するための予備バッファを作成する必要が生じ得る。 既定の色合成演算子 src-over を用いるコンテナ要素に対する予備バッファの大きさは単純にコンテナ要素内の要素の境界の和になる。 他の色合成演算子が用いられた場合、コンテナ要素の境界は上の色合成演算子の図式から決定される。 境界は空の状態から開始され、色合成演算子は、コンテナ要素内の連続するオブジェクトのそれぞれの境界が、結果を置換するか, 結果との和をとるか, 結果との共通部分をとるかを指定する。 多くの色合成演算子では、境界は結果との和がとられる。 clear 色合成においては、現在の結果が空に設定される。 src, src-out, dst-atop, においては、境界は合成元の境界に設定される。 dst, dst-out, src-atop, においては、境界はそのままにされる。 src-in, dst-in においては、境界は結果との共通部分がとられる。 The user agent may be required to create a backing store in which to generate a container element. The size of the backing store for a container element using the default compositing operator src-over is simply the union of the bounds of the sub-elements of the container element. When other compositing operators are used, the bounds of the container element are determined using the compositing operator diagram above. Starting with an empty bounds, the compositing operator specifies that the bounds of each successive object within the container element either replaces the result or is unioned with the result or is intersected with the result. For most compositing operators the bounds are unioned with the result. For the clear composite the current result is set to empty. For src, src-out and dst-atop, the bounds are set to the source bounds. For dst, dst-out and src-atop, the bounds are left unchanged. For src-in and dst-in the bounds are intersected with the result.
下に挙げる色成分はすべて対応するアルファ値により積算済みの色成分情報を指す。 等式内に現れる下の識別子はそれぞれ識別子に後続して記されている意味を持つ。 All color components listed below refer to color component information premultiplied by the corresponding alpha value. The following identifiers have the attached meaning in the equations following on from the identifiers.
Sc - 合成元要素の色値
Sa - 合成元要素のアルファ値
Dc - 色合成前のキャンバスの色値
Da - 色合成前のキャンバスのアルファ値
Dc' - 色合成後のキャンバスの色値
Da' - 色合成後のキャンバスのアルファ値
Sc - The source element color value.
Sa - The source element alpha value.
Dc - The canvas color value prior to compositing.
Da - The canvas alpha value prior to compositing.
Dc' - The canvas color value post compositing.
Da' - The canvas alpha value post compositing.
キャンバスは色成分とオプションのアルファ成分を含む。 キャンバス上に新たな要素が置かれる際のキャンバス上の結果の画素値は以下の公式を用いて算出される。 The canvas contains color components and an optional alpha component. When placing new elements onto the canvas, the resulting pixel values on the canvas are calculated using the following equations.
合成先の色とアルファはいずれもクリアされる。 合成元および合成先のいずれも入力に利用されない。 Both the color and the alpha of the destination are cleared. Neither the source nor the destination are used as input.
f(Sc,Dc) = 0
X = 0
Y = 0
Z = 0
Dca' = 0
Da' = 0
合成元が合成先に複製される。 合成先は入力に利用されない。 The source is copied to the destination. The destination is not used as input.
f(Sc,Dc) = Sc
X = 1
Y = 1
Z = 0
Dca' = Sca × Da + Sca × (1 - Da)
= Sca
Da' = Sa × Da + Sa × (1 - Da)
= Sa
合成先には何も手は加えられない。 The destination is left untouched.
f(Sc,Dc) = Dc
X = 1
Y = 0
Z = 1
Dca' = Dca × Sa + Dca × (1 - Sa)
= Dca
Da' = Da × Sa + Da × (1 - Sa)
= Da
合成元は合成先上に合成される。 これが lacuna 値 。 The source is composited over the destination. This is the lacuna value.
f(Sc,Dc) = Sc
X = 1
Y = 1
Z = 1
Dca' = Sca × Da + Sca × (1 - Da) + Dca × (1 - Sa)
= Sca + Dca × (1 - Sa)
Da' = Sa × Da + Sa × (1 - Da) + Da × (1 - Sa)
= Sa + Da - Sa × Da
次の図式に src-over 色合成を示す: The following diagram shows src-over compositing:
合成先は合成元上に合成され、その結果が合成先を置換する。 The destination is composited over the source and the result replaces the destination.
f(Sc,Dc) = Dc
X = 1
Y = 1
Z = 1
Dca' = Dca × Sa + Sca × (1 - Da) + Dca × (1 - Sa)
= Dca + Sca × (1 - Da)
Da' = Da × Sa + Sa × (1 - Da) + Da × (1 - Sa)
= Sa + Da - Sa × Da
合成元のうち合成先の内側に入る部分が合成先を置換する。 The part of the source lying inside of the destination replaces the destination.
f(Sc,Dc) = Sc
X = 1
Y = 0
Z = 0
Dca' = Sca × Da
Da' = Sa × Da
次の図式に src-in 色合成を示す: The following diagram shows src-in compositing:
合成先のうち合成元の内側に入る部分が合成先を置換する。 The part of the destination lying inside of the source replaces the destination.
f(Sc,Dc) = Dc
X = 1
Y = 0
Z = 0
Dca' = Dca × Sa
Da' = Sa × Da
合成元のうち合成先の外側に出る部分が合成先を置換する。 The part of the source lying outside of the destination replaces the destination.
f(Sc,Dc) = 0
X = 0
Y = 1
Z = 0
Dca' = Sca × (1 - Da)
Da' = Sa × (1 - Da)
次の図式に src-out 色合成を示す: The following diagram shows src-out compositing:
合成先のうち合成元の外側に出る部分が合成先を置換する。 The part of the destination lying outside of the source replaces the destination.
f(Sc,Dc) = 0
X = 0
Y = 0
Z = 1
Dca' = Dca × (1 - Sa)
Da' = Da × (1 - Sa)
合成元のうち合成先の内側に入る部分が合成先上に合成される。 The part of the source lying inside of the destination is composited onto the destination.
f(Sc,Dc) = Sc
X = 1
Y = 0
Z = 1
Dca' = Sca × Da + Dca × (1 - Sa)
Da' = Sa × Da + Da × (1 - Sa)
= Da
次の図式に src-atop 色合成を示す: The following diagram shows src-atop compositing:
合成先のうち合成元の内側に入る部分が合成元上に合成され、合成先を置換する。 The part of the destination lying inside of the source is composited over the source and replaces the destination.
f(Sc,Dc) = Dc
X = 1
Y = 1
Z = 0
Dca' = Dca × Sa + Sca × (1 - Da)
Da' = Da × Sa + Sa × (1 - Da)
= Sa
合成元のうち合成先の外側に出る部分と合成先のうち合成元の外側に出る部分とが結合される。 The part of the source that lies outside of the destination is combined with the part of the destination that lies outside of the source.
f(Sc,Dc) = 0
X = 0
Y = 1
Z = 1
Dca' = Sca × (1 - Da) + Dca × (1 - Sa)
Da' = Sa × (1 - Da) + Da × (1 - Sa)
= Sa + Da - 2 × Sa × Da
12 の基本的な Porter-Duff 演算子に加えて、次の色合成演算による合成元と合成先の混色が追加される。 これらの演算子は色合成後の出力値の切り詰めを要する。 The following compositing operators add blending of source and destination colors beyond the base 12 Porter-Duff operations. The behavior of these operators necessitates clamping of the output values after compositing.
合成元は合成先に加えられ、合成先を置換する。 この演算子は2つの画像間におけるディゾルブアニメーションに有用である。 【dissolve - ディザ合成】 The source is added to the destination and replaces the destination. This operator is useful for animating a dissolve between two images.
f(Sc,Dc) = Sc + Dc
X = 1
Y = 1
Z = 1
Dca' = Sca × Da + Dca × Sa + Sca × (1 - Da) + Dca × (1 - Sa)
= Sca + Dca
Da' = Sa × Da + Da × Sa + Sa × (1 - Da) + Da × (1 - Sa)
= Sa + Da
合成元の色に合成先の色による積がとられ、合成先を置換する。 結果の色の明度は常に合成元または合成先以下になる。 どの色でも黒との積による結果は黒になる。 どの色でも白との積による結果は元の色と同じになる。 The source color is multiplied by the destination color and replaces the destination. The resultant color is always at least as dark as either the source or destination color. Multiplying any color with black results in black. Multiplying any color with white preserves the original color.
f(Sc,Dc) = Sc × Dc
X = 1
Y = 1
Z = 1
Dca' = Sca × Dca + Sca × (1 - Da) + Dca × (1 - Sa)
Da' = Sa × Da + Sa × (1 - Da) + Da × (1 - Sa)
= Sa + Da - Sa × Da
次の図式に multiply 色合成を示す: The following diagram shows multiply compositing:
合成元の色と合成先の色は補色がとられてから積がとられ、結果の色が合成先を置換する。 結果の色の明度は常に合成元または合成先の色以上になる。 どの色でも白とのスクリーンによる結果は白になる。 どの色でも黒とのスクリーンによる結果は元の色と同じになる。 The source and destination colors are complemented, multiplied and the resultant color replaces the destination. The resultant color is always at least as light as either the source or destination colour. Screening any color with white results in white. Screening any color with black preserves the original color.
f(Sc,Dc) = Sc + Dc - (Sc × Dc)
X = 1
Y = 1
Z = 1
Dca' = (Sca × Da + Dca × Sa - Sca × Dca) + Sca × (1 - Da) + Dca × (1 - Sa)
= Sca + Dca - Sca × Dca
Da' = Sa + Da - Sa × Da
次の図式に screen 色合成を示す: The following diagram shows screen compositing:
合成先の色により結果の色が積になるかスクリーンになるかどうかが決定される。 合成元の色がそのハイライトとシャドウを維持しつつ合成先を overlay する。 合成先の色はその明るさまたは暗さを反映させるように合成元の色と混ぜられる。 The destination color is used to determine if the resultant is either a multiplication or screening of the colors. Source colors overlay the destination whilst preserving its highlights and shadows. The destination color is mixed with the source color to reflect the destination lightness or darkness.
if 2 × Dc <= 1
f(Sc,Dc) = 2 × Sc × Dc
otherwise
f(Sc,Dc) = 1 - 2 × (1 - Dc) × (1 - Sc)
X = 1
Y = 1
Z = 1
if 2 × Dca <= Da
Dca' = 2 × Sca × Dca + Sca × (1 - Da) + Dca × (1 - Sa)
otherwise
Dca' = Sa × Da - 2 × (Da - Dca) × (Sa - Sca) + Sca × (1 - Da) + Dca × (1 - Sa)
= Sca × (1 + Da) + Dca × (1 + Sa) - 2 × Dca × Sca - Da × Sa
Da' = Sa + Da - Sa × Da
次の図式に overlay 色合成を示す: The following diagram shows overlay compositing:
結果の色は合成元または合成先の色より暗くなる。 合成元がより暗い場合、合成先を置換する。 そうでない場合、合成先が保持される。 The resultant color is the darker of source or destination colors. If the source is darker, it replaces the destination. Otherwise, the destination is preserved.
f(Sc,Dc) = min(Sc,Dc)
X = 1
Y = 1
Z = 1
Dca' = min(Sca × Da, Dca × Sa) + Sca × (1 - Da) + Dca × (1 - Sa)
Da' = Sa + Da - Sa × Da
or
if Sca × Da < Dca × Sa
src-over()
otherwise
dst-over()
次の図式に darken 色合成を示す: The following diagram shows darken compositing:
結果の色は合成元または合成先の色より明るくなる。 合成元がより明るくなる場合、合成先を置換する。 そうでない場合、合成先が保持される。 The resultant color is the lighter of source or destination colors. If the source is lighter, it replaces the destination. Otherwise, the destination is preserved.
f(Sc,Dc) = max(Sc,Dc)
X = 1
Y = 1
Z = 1
Dca' = max(Sca × Da, Dca × Sa) + Sca × (1 - Da) + Dca × (1 - Sa)
Da' = Sa + Da - Sa × Da
or
if Sca × Da > Dca × Sa
src-over()
otherwise
dst-over()
次の図式に lighten 色合成を示す: The following diagram shows lighten compositing:
合成先の色の輝度が合成元の色を反映させるように高くなる。 黒による塗りは元の色をそのまま残す。 【dodge - 覆い焼き】 The destination color is brightened to reflect the source color. Painting with black preserves the original color.
if Sc == 1
f(Sc,Dc) = 1
otherwise
f(Sc,Dc) = min(1, Dc/(1 - Sc))
X = 1
Y = 1
Z = 1
if Sca == Sa and Dca == 0
Dca' = Sca × (1 - Da) + Dca × (1 - Sa)
= Sca × (1 - Da)
otherwise if Sca == Sa
Dca' = Sa × Da + Sca × (1 - Da) + Dca × (1 - Sa)
otherwise if Sca < Sa
Dca' = Sa × Da × min(1, Dca/Da × Sa/(Sa - Sca)) + Sca × (1 - Da) + Dca × (1 - Sa)
Da' = Sa + Da - Sa × Da
次の図式に color-dodge 色合成を示す: The following diagram shows color-dodge compositing:
合成先の色は合成元の色を反映させるように暗くされる。 白による塗りは元の色をそのまま残す。 【burn - 焼き込み】 The destination color is darkened to reflect the source color. Painting with white preserves the original color.
if Sc == 0
f(Sc,Dc) = 0
otherwise
f(Sc,Dc) = 1 - min(1, (1 - Dc)/Sc)
X = 1
Y = 1
Z = 1
if Sca == 0 and Dca == Da
Dca' = Sa × Da + Sca × (1 - Da) + Dca × (1 - Sa)
= Sa × Da + Dca × (1 - Sa)
otherwise if Sca == 0
Dca' = Sca × (1 - Da) + Dca × (1 - Sa)
= Dca × (1 - Sa)
otherwise if Sca > 0
Dca' = Sa × Da - Sa × Da × min(1, (1 - Dca/Da) × Sa/Sca) + Sca × (1 - Da) + Dca × (1 - Sa)
= Sa × Da × (1 - min(1, (1 - Dca/Da) × Sa/Sca)) + Sca × (1 - Da) + Dca × (1 - Sa)
Da' = Sa + Da - Sa × Da
次の図式に color-burn 色合成を示す: The following diagram shows color-burn compositing:
合成元の色が結果の色が積になるかスクリーンになるかどうかを定める。
合成元の色が 0.5 より明るい場合、合成先はスクリーンがとられたかの様に明るくされる。
合成元の色が 0.5 より暗い場合、合成先は積がとられたかの様に暗くされる。
明るく/暗くされる度合いは合成元の色と 0.5 の差分に比例する。
0.5 に等しい場合、合成先は変化しない。
白/黒による塗りの結果はそれぞれ白/黒になる。
The source color is used to determine if the resultant is either a multiplication or screening of the colors.
If the source color is lighter than 0.5, the destination is lightened as if it were screened.
If the source color is darker than 0.5, the destination is darkened, as if it were multiplied.
The degree of lightening or darkening is proportional to the difference between the source color and 0.5.
If it is equal to 0.5 the destination is unchanged.
Painting with pure black or white produces black or white.
if 2 × Sc <= 1
f(Sc,Dc) = 2 × Sc × Dc
otherwise
f(Sc,Dc) = 1 - 2 × (1 - Dc) × (1 - Sc)
X = 1
Y = 1
Z = 1
if 2 × Sca <= Sa
Dca' = 2 × Sca × Dca + Sca × (1 - Da) + Dca × (1 - Sa)
otherwise
Dca' = Sa × Da - 2 × (Da - Dca) × (Sa - Sca) + Sca × (1 - Da) + Dca × (1 - Sa)
= Sca × (1 + Da) + Dca × (1 + Sa) - Sa × Da - 2 × Sca × Dca
Da' = Sa + Da - Sa × Da
次の図式に hard-light 色合成を示す: The following diagram shows hard-light compositing:
合成元の色により結果の色は明るくされるか暗くされる。 合成元の色が 0.5 より明るい場合、合成先は明るくされる。 合成元の色が 0.5 より暗い場合、合成先は焼き込まれたかの様に( burned in )暗くされる。 明るく/暗くされる度合いは合成元の色と 0.5 の差分に比例する。 0.5 に等しい場合、合成先は変化しない。 白/黒による塗りの結果は明るくされた領域と暗くされた領域を明瞭に示すが、白/黒にはならない。 The source colour is used to determine if the resultant color is darkened or lightened. If the source color is lighter than 0.5, the destination is lightened. If the source color is darker than 0.5, the destination is darkened, as if it were burned in. The degree of darkening or lightening is proportional to the difference between the source color and 0.5. If it is equal to 0.5, the destination is unchanged. Painting with pure black or white produces a distinctly darker or lighter area, but does not result in pure black or white.
if 2 × Sc <= 1
f(Sc,Dc) = Dc - (1 - 2 × Sc) × Dc × (1 - Dc)
otherwise if 2 × Sc > 1 and 4 × Dc <= 1
f(Sc,Dc) = Dc + (2 × Sc - 1) × (4 × Dc × (4 × Dc + 1) × (Dc - 1) + 7 × Dc)
otherwise if 2 × Sc > 1 and 4 × Dc > 1
f(Sc,Dc) = Dc + (2 × Sc - 1) × ((Dc)^0.5 - Dc)
X = 1
Y = 1
Z = 1
if 2 × Sca <= Sa
Dca' = Dca × (Sa + (2 × Sca - Sa) × (1 - m)) + Sca × (1 - Da) + Dca × (1 - Sa)
otherwise if 2 × Sca > Sa and 4 × Dca <= Da
Dca' = Dca × Sa + Da × (2 × Sca - Sa) × (4 × m × (4 × m + 1) × (m - 1) + 7 × m) + Sca × (1 - Da) + Dca × (1 - Sa)
= Da × (2 × Sca - Sa) × (16 × m^3 - 12 × m^2 - 3 × m) + Sca - Sca × Da + Dca
otherwise if 2 × Sca > Sa and 4 × Dca > Da
Dca' = Dca × Sa + Da × (2 × Sca - Sa) × (m^0.5 - m) + Sca × (1 - Da) + Dca × (1 - Sa)
= Da × (2 × Sca - Sa) × (m^0.5 - m) + Sca - Sca × Da + Dca
Da' = Sa + Da - Sa × Da
Where:
m = Dca/Da
次の図式に soft-light 色合成を示す: The following diagram shows soft-light compositing:
結果の色は合成元と合成先の色の差分の絶対値になる。 白が用いられた場合、合成先の色は反転される。 黒が用いられた場合、合成先の色がそのまま残る。 The resultant color is the absolute difference between the source and destination colors. The destination color is inverted when white is used. The destination color is preserved when black is used.
f(Sc,Dc) = abs(Dc - Sc)
X = 1
Y = 1
Z = 1
Dca' = abs(Dca × Sa - Sca × Da) + Sca × (1 - Da) + Dca × (1 - Sa)
= Sca + Dca - 2 × min(Sca × Da, Dca × Sa)
Da' = Sa + Da - Sa × Da
次の図式に difference 色合成を示す: The following diagram shows difference compositing:
結果の色は difference 演算のそれと似たものになる。 しかしながら、 exclusion による結果の色のコントラストは difference による結果の色のコントラストよりも小さめになる。 白が用いられた場合、合成先の色は反転される。 黒が用いられた場合、合成先の色はそのまま残る。 The resultant color is similar to that of the difference operation. However, the exclusion resultant color appears as a lower contrast than that of the difference resultant color. The destination color is inverted when white is used. The destination color is preserved when black is used.
f(Sc,Dc) = Sc + Dc - 2 × Sc × Dc
X = 1
Y = 1
Z = 1
Dca' = (Sca × Da + Dca × Sa - 2 × Sca × Dca) + Sca × (1 - Da) + Dca × (1 - Sa)
Da' = Sa + Da - Sa × Da
これらの等式は検討中の近似式である。 最終的な等式はここに示されたものと異なるものになる可能性がある。 These equations are approximations which are under review. Final equations may differ from those presented here.
次の図式に exclusion 色合成を示す: The following diagram shows exclusion compositing:
上に挙げられた演算子の多くでは、画像の合成元が完全に透明な領域においても合成先が変化する。 合成元が触れない画素は透明と見なされるので、色合成演算によっては変化し得ることになる。 For many of the operators listed above, the destination is modified in regions of the image where the source is completely transparent. Pixels that the source does not touch are considered transparent, and as such may be modified, depending on the compositing operation.
この仕様の著作者は W3C SVG Working Group の参加者である。 The authors of this specification are the participants of the W3C SVG Working Group.
次に挙げる変更が前回の公開からこの文書に加えられた: The following changes have been madeto this document since the previous publication: