11.4 透明度组¶
Transparency Groups
11.4.1 概述¶
General
一个 透明度组 是透明度堆栈中一系列连续的对象,它们应当被收集在一起并合成,以在每个点产生单一的颜色、形状和不透明度。然后,该结果应被视为单个对象,以进行后续的合成操作。组可以嵌套在其他组内,从而形成树状结构的组层次。
注意
这有助于创建独立的艺术作品,每个作品由多个对象组成,然后将它们组合在一起,并在组合过程中可能应用额外的透明度效果。
组内包含的对象应被视为一个独立的透明度堆栈,称为 组堆栈。堆栈中的对象应与初始背景(稍后讨论)进行合成,从而为整个组生成合成的颜色、形状和不透明度。其结果是一个对象,该对象的形状是其组成对象的形状的并集,而其颜色和不透明度则是合成操作的结果。然后,该对象应按照常规方式与组的背景进行合成。
除了计算出的颜色、形状和不透明度,整个组还可能具有以下几个额外属性:
- 影响单个对象合成计算的所有输入变量,在将组与其背景合成时也可以应用。这些变量包括遮罩和常量形状、遮罩和常量不透明度,以及混合模式。
- 该组可以是 隔离的 或 非隔离的,这决定了其堆栈合成时所依据的初始背景。
- 该组可以是 挖空的 或 非挖空的,这决定了其堆栈中的对象是彼此合成,还是仅与组的背景进行合成。
- 一个隔离组可以指定其自身的混合颜色空间,而不依赖于组背景的颜色空间。
- 组的结果可以用作形状或不透明度值的来源,以创建 软遮罩(参见“软遮罩”),而不是直接合成到当前页面上。
A transparency group is a sequence of consecutive objects in a transparency stack that shall be collected together and composited to produce a single colour, shape, and opacity at each point. The result shall then be treated as if it were a single object for subsequent compositing operations. Groups may be nested within other groups to form a tree-structured group hierarchy.
NOTE
This facilitates creating independent pieces of artwork, each composed of multiple objects, and then combining them, possibly with additional transparency effects applied during the combination.
The objects contained within a group shall be treated as a separate transparency stack called the group stack. The objects in the stack shall be composited against an initial backdrop (discussed later), producing a composite colour, shape, and opacity for the group as a whole. The result is an object whose shape is the union of the shapes of its constituent objects and whose colour and opacity are the result of the compositing operations. This object shall then be composited with the group’s backdrop in the usual way.
In addition to its computed colour, shape, and opacity, the group as a whole may have several further attributes:
- All of the input variables that affect the compositing computation for individual objects may also be applied when compositing the group with its backdrop. These variables include mask and constant shape, mask and constant opacity, and blend mode.
- The group may be isolated or non-isolated, which shall determine the initial backdrop against which its stack is composited.
- The group may be knockout or non-knockout, which shall determine whether the objects within its stack are composited with one another or only with the group’s backdrop.
- An isolated group may specify its own blending colour space, independent of that of the group’s backdrop.
- Instead of being composited onto the current page, a group’s results may be used as a source of shape or opacity values for creating a soft mask (see “Soft Masks”).
11.4.2 组合成计算的符号¶
Notation for Group Compositing Computations
本小节介绍了一些用于处理组合成的符号表示。后续小节将描述 非隔离、非挖空 组的组合公式,以及隔离组和挖空组的特殊属性。
由于现在需要同时处理多个对象,因此引入一些符号来区分它们是很有用的。为此,先前介绍的变量将被修改,以包含一个二级下标,用于表示对象在透明度堆栈中的位置。
\(C_{s_i}\) 代表堆栈中第 i 个对象的源颜色。下标 0 代表初始背景;下标 1 到 n 依次表示堆栈中从最底层到最顶层的 n 个对象。此外,变量 \(C_b\)、\(f_β\)、\(q_β\)、\(α_β\)、\(C_r\)、\(f_ρ\)、\(q_ρ\) 和 \(α_ρ\) 的下标 b 和 r 被省略;其他变量仍保留其助记下标。
这些约定使得合成公式可以被重新表述为堆栈元素之间的递推关系。例如,对象 i 的颜色合成计算结果表示为 \(C_i\)(原先记作 \(C_r\))。该计算的输入之一是其直接的背景颜色,即对象 i − 1 的颜色合成计算结果,记作 \(C_{i − 1}\)(原先记作 \(C_b\))。
对于一个简单的 n 元素堆栈(不包括任何组),修正后的公式如下,其中 i = 1, … , n:
\(\begin{align} &f_{s_i} = f_{j_i} \times f_{m_i} \times f_{k_i} \\ &q_{s_i} = q_{j_i} \times q_{m_i} \times q_{k_i} \\\\ &\alpha _{s_i} = f_{s_i} \times q_{s_i} \\ &\alpha _i = \text{Union}(\alpha _{i-1}, \alpha _{s_i})\\\\ &f_i = \text{Union}(f_{i-1}, f_{s_i}) \\ &q_i = \frac{\alpha _i}{\alpha _i} \\\\ &C_i = \left ( 1- \frac{\alpha _{s_i}}{\alpha _i} \right) \times C_{i-1} + \frac{\alpha _{s_i}}{\alpha _i} \times [(1-\alpha _{i-1}) \times C_{s_i} + \alpha _{i-1} \times B_i(C_{i-1}, C_{s_i})] \end{align}\)
其中变量的含义如表140所示。
NOTE
将这些公式与11.3.8“基本合成计算摘要”中所示的公式进行比较。
变量 | 意义 |
---|---|
\(f_{s_i}\) | 对象 i 的源形状 |
\(f_{j_i}\) | 对象 i 的对象形状 |
\(f_{m_i}\) | 对象 i 的蒙版形状 |
\(f_{k_i}\) | 对象 i 的常量形状 |
\(f_i\) | 合成对象 i 后的结果形状 |
\(q_{s_i}\) | 对象 i 的源不透明度 |
\(q_{j_i}\) | 对象 i 的对象不透明度 |
\(q_{m_i}\) | 对象 i 的蒙版不透明度 |
\(q_{k_i}\) | 对象 i 的常量不透明度 |
\(q_i\) | 合成对象 i 后的结果不透明度 |
\(\alpha_{s_i}\) | 对象 i 的源 alpha |
\(\alpha_i\) | 合成对象 i 后的结果 alpha |
\(C_{s_i}\) | 对象 i 的源颜色 |
\(C_i\) | 合成对象 i 后的结果颜色 |
\(B_i(C_{i-1}, C_{s_i})\) | 对象 i 的混合函数 |
This sub-clause introduces some notation for dealing with group compositing. Subsequent sub-clauses describe the group compositing formulas for a non-isolated, non-knockout group and the special properties of isolated and knockout groups.
Since we are now dealing with multiple objects at a time, it is useful to have some notation for distinguishing among them. Accordingly, the variables introduced earlier are altered to include a second-level subscript denoting an object’s position in the transparency stack.
\(C_{s_i}\) stands for the source colour of the ith object in the stack. The subscript 0 represents the initial backdrop; subscripts 1 to n denote the bottommost to topmost objects in an n-element stack. In addition, the subscripts b and r are dropped from the variables \(C_b\) , \(f_β\) , \(q_β\) , \(α_β\) , \(C_r\), \(f_ρ\) , \(q_ρ\) , and \(α_ρ\) ; other variables retain their mnemonic subscripts.
These conventions permit the compositing formulas to be restated as recurrence relations among the elements of a stack. For instance, the result of the colour compositing computation for object i is denoted by \(C_i\) (formerly \(C_r\) ). This computation takes as one of its inputs the immediate backdrop colour, which is the result of the colour compositing computation for object i − 1; this is denoted by \(C_{i − 1}\) (formerly \(C_b\) ).
The revised formulas for a simple n-element stack (not including any groups) shall be, for i = 1, … , n:
\(\begin{align} &f_{s_i} = f_{j_i} \times f_{m_i} \times f_{k_i} \\ &q_{s_i} = q_{j_i} \times q_{m_i} \times q_{k_i} \\\\ &\alpha _{s_i} = f_{s_i} \times q_{s_i} \\ &\alpha _i = \text{Union}(\alpha _{i-1}, \alpha _{s_i})\\\\ &f_i = \text{Union}(f_{i-1}, f_{s_i}) \\ &q_i = \frac{\alpha _i}{\alpha _i} \\\\ &C_i = \left ( 1- \frac{\alpha _{s_i}}{\alpha _i} \right) \times C_{i-1} + \frac{\alpha _{s_i}}{\alpha _i} \times [(1-\alpha _{i-1}) \times C_{s_i} + \alpha _{i-1} \times B_i(C_{i-1}, C_{s_i})] \end{align}\)
where the variables have the meanings shown in Table 140.
NOTE
Compare these formulas with those shown in 11.3.8, "Summary of Basic Compositing Computations."
Variable | Meaning |
---|---|
\(f_{s_i}\) | Source shape for object i |
\(f_{j_i}\) | Object shape for object i |
\(f_{m_i}\) | Mask shape for object i |
\(f_{k_i}\) | Constant shape for object i |
\(f_i\) | Result shape after compositing object i |
\(q_{s_i}\) | Source opacity for object i |
\(q_{j_i}\) | Object opacity for object i |
\(q_{m_i}\) | Mask opacity for object i |
\(q_{k_i}\) | Constant opacity for object i |
\(q_i\) | Result opacity after compositing object i |
\(\alpha_{s_i}\) | Source alpha for object i |
\(\alpha_i\) | Result alpha after compositing object i |
\(C_{s_i}\) | Source colour for object i |
\(C_i\) | Result colour after compositing object i |
\(B_i(C_{i-1}, C_{s_i})\) | Blend function for object i |
11.4.3 群体结构和命名法¶
Group Structure and Nomenclature
如前所述,组的元素应被视为单独的透明度堆栈,称为组堆栈。这些对象应与选定的初始背景合成,然后将生成的颜色、形状和不透明度视为属于单个对象。生成的对象又以通常的方式与组的背景合成。
NOTE
此计算需要将堆栈解释为树。对于从堆栈中的位置 i 开始的 n 元素 组,它将接下来的 n 个对象视为 n 元素 子堆栈,其元素被赋予 1 到 n 的独立编号。然后从父(包含)堆栈中的对象编号中删除这些对象,并用编号为 i 的组对象替换,然后是要在组顶部绘制的其余对象,从 i + 1 开始重新编号。此操作以递归方式应用于任何嵌套子组。
术语“元素”(表示为 \(E_i\) )是指某个组的成员;它可以是单个对象,也可以是包含的子组。
从嵌套组中特定元素的角度来看,有三种不同的背景值得关注:
- 组背景是合成组中所有元素(但不包括第一个元素)的结果。(如果父组是淘汰组,则此定义会改变;请参阅 11.4.6,“淘汰组”)
- 初始背景是选择用于合成组的第一个元素的背景。这要么与组背景相同(对于非隔离组),要么是完全透明的背景(对于隔离组)。
- 直接背景是合成组中所有元素(但不包括当前元素)的结果。
当组中的所有元素都已合成后,结果应被视为该组是一个单一对象,然后应将其与组背景合成。无论为合成组元素而选择的初始背景是组背景还是透明背景,都应进行此操作。符合要求的读取器应确保背景对整体结果的贡献仅应用一次。
As stated earlier, the elements of a group shall be treated as a separate transparency stack, referred to as the group stack. These objects shall be composited against a selected initial backdrop and the resulting colour, shape, and opacity shall then be treated as if they belonged to a single object. The resulting object is in turn composited with the group’s backdrop in the usual way.
NOTE
This computation entails interpreting the stack as a tree. For an n-element group that begins at position i in the stack, it treats the next n objects as an n-element substack, whose elements are given an independent numbering of 1 to n. These objects are then removed from the object numbering in the parent (containing) stack and replaced by the group object, numbered i, followed by the remaining objects to be painted on top of the group, renumbered starting at i + 1. This operation applies recursively to any nested subgroups.
The term element (denoted \(E_i\) ) refers to a member of some group; it can be either an individual object or a contained subgroup.
From the perspective of a particular element in a nested group, there are three different backdrops of interest:
- The group backdrop is the result of compositing all elements up to but not including the first element in the group. (This definition is altered if the parent group is a knockout group; see 11.4.6, "Knockout Groups")
- The initial backdrop is a backdrop that is selected for compositing the group’s first element. This is either the same as the group backdrop (for a non-isolated group) or a fully transparent backdrop (for an isolated group).
- The immediate backdrop is the result of compositing all elements in the group up to but not including the current element.
When all elements in a group have been composited, the result shall be treated as if the group were a single object, which shall then be composited with the group backdrop. This operation shall occur whether the initial backdrop chosen for compositing the elements of the group was the group backdrop or a transparent backdrop. A conforming reader shall ensure that the backdrop’s contribution to the overall result is applied only once.
11.4.4 群组合成计算¶
Group Compositing Computations
组的颜色和不透明度应由 组合成函数 定义:
\(<C,f,\alpha> = \text{Composite}(C_0, \alpha_0, G)\)
其中,各变量的含义如 表 141 所示。
变量 | 含义 |
---|---|
\(G\) | 透明度组:一个复合对象,由组内的所有元素 \(E_1, … , E_n\) 组成,即 n 个组成对象的颜色、形状、不透明度和混合模式 |
\(C_0\) | 组背景的颜色 |
\(C\) | 计算出的组颜色,当该组作为一个对象处理时,该颜色应作为源颜色 |
\(f\) | 计算出的组形状,当该组作为一个对象处理时,该形状应作为对象形状 |
\(\alpha_0\) | 组背景的 alpha 值 |
\(\alpha\) | 计算出的组 alpha 值,当该组作为一个对象处理时,该 alpha 值应作为对象的 alpha |
注意 1
不透明度并未被明确作为该函数的参数或结果。几乎所有计算都使用形状与不透明度(alpha)的乘积,而非单独使用不透明度;因此,通常直接使用形状和 alpha 比单独使用形状和不透明度更方便。当需要计算不透明度时,可以通过 alpha 除以相应的形状得到。
应用组合成函数的结果应被视为单个对象,然后按照本小节定义的公式,与组的背景进行合成。在这些公式中,组合成函数计算出的颜色、形状和 alpha(\(C, f, \alpha\))应分别用作源颜色 \(C_s\)、对象形状 \(f_j\) 和对象 alpha 值 \(α_j\)。
非隔离、非挖空组的组合成公式定义如下:
-
初始化:
\(f_{g_0} = \alpha_{g_0} = 0.0\)
-
对于组中的每个元素 \(E_i \in G\)(\(i = 1, \dots, n\)):
\(<C_{s_i}, f_{j_i}, \alpha_{j_i}> = \begin{cases} \text{合成}(C_{i-1}, \alpha _{i-1}, E_i) & \text{ 如果 } E_i \text{ 是一个组} \\ \text{的固有颜色、形状和 }(\text{形状} \times \text{不透明度}) \text{ of } E_i & \text{ 否则 } \end{cases}\)
\(\begin{align} & f_{s_i} = f_{j_i} \times f_{m_i} \times f_{k_i} \\ & \alpha _{s_i} = \alpha _{j_i} \times (f_{m_i} \times q_{m_i}) \times (f_{k_i} \times q_{k_i})\\\\ & f_{g_i} = \text{Union}(f_{g_{i-1}}, f_{s_i}) \\ & \alpha _{g_i} = \text{Union}(\alpha _{g_{i-1}}, \alpha _{s_i})\\ & \alpha _i = \text{Union}(\alpha _0, \alpha _{g_i}) \\\\ & C_i = \left ( 1 - \frac{\alpha _{s_i}}{\alpha _i} \right ) \times C_{i-1} + \frac{\alpha _{s_i}}{\alpha _i} \times ((1- \alpha _{i-1}) \times C_{s_i} + \alpha _{i-1} \times B_i(C_{i-1}, C_{s_i})) \end{align}\)
-
结果:
\(\begin{align} & C = C_n + (C_n - C_0) \times \left( \frac{\alpha _0}{\alpha _{g_n}} - \alpha _0 \right) \\ & f = f_{g_n} \\ & \alpha = \alpha _{g_n} \end{align}\)
其中各变量的含义如表 142 所示(另外还包括表 141 中的内容)。
对于作为基本对象的元素 \(E_i\),颜色、形状和不透明度值 \(C_{s_i}\)、\(f_{j_i}\) 和 \(α_{j_i}\) 是该对象的固有属性。对于作为组的元素,组合成函数应递归应用于子组,并且应将得到的 \(C\)、\(f\) 和 \(α\) 值用于其在父组计算中的 \(C_{s_i}\)、\(f_{j_i}\) 和 \(α_{j_i}\) 。
变量 | 含义 |
---|---|
\(E_i\) | 组中的元素 i:表示元素颜色、形状、不透明度和混合模式的复合变量 |
\(f_{s_i}\) | 元素 \(E_i\) 的源形状 |
\(f_{j_i}\) | 元素 \(E_i\) 的对象形状 |
\(f_{m_i}\) | 元素 \(E_i\) 的蒙版形状 |
\(f_{k_i}\) | 元素 \(E_i\) 的常量形状 |
\(f_{g_i}\) | 组形状:组元素 \(E_1\) 至 \(E_i\) 的累积源形状,不包括初始背景 |
\(q_{m_i}\) | 元素 \(E_i\) 的蒙版不透明度 |
\(q_{k_i}\) | 元素的常量不透明度\(E_i\) |
\(\alpha_{s_i}\) | 元素 \(E_i\) 的源不透明度 |
\(\alpha_{j_i}\) | 元素 \(E_i\) 的对象 alpha:其对象形状和对象不透明度的乘积 |
\(\alpha_{g_i}\) | 组 alpha:组元素 \(E_1\) 至 \(E_i\) 的累积源 alpha,不包括初始背景 |
\(\alpha_i\) | 合成元素 \(E_i\) 后的累积 alpha,包括初始背景 |
\(C_{s_i}\) | 元素 \(E_i\) 的源颜色 |
\(C_i\) | 合成元素 \(E_i\) 后的累积颜色,包括初始背景 |
\(B_i(C_{i-1}, C_{s_i})\) | 元素 \(E_i\) 的混合函数 |
NOTE 2
组的元素被合成到包含组初始背景的背景上。这样做是为了实现混合模式的正确效果,其中大部分效果都取决于背景和混合的源颜色。此功能是区分非隔离组和隔离组的关键,将在下一小节中讨论。
NOTE 3
应特别注意末尾计算组合成函数的最终结果 C、f 和 α 的公式。本质上,这些公式从计算结果中去除了组背景的贡献。这确保当组随后与该背景合成时(可能具有额外的形状或不透明度输入或不同的混合模式),背景的贡献仅包含一次。
对于颜色,背景去除是通过显式计算完成的,其效果本质上与使用 Normal 混合模式合成相反。该公式是以下公式的简化,更直观地呈现了此操作:
\(\begin{align} & \varphi _b = \frac{(1 - \alpha_{g_n}) \times \alpha _0}{\text{Union}(\alpha _0, \alpha_{g_n}) } \\\\ & C = \frac{C_n - \varphi_b \times C_0}{1-\varphi _b} \end{align}\)
其中 \(φ_b\) 是背景分数,即背景颜色对整体颜色的相对贡献。
NOTE 4
对于形状和 alpha,背景移除是通过维护两组变量来保存累积值来实现的。无需计算包括背景贡献的相应完整形状 \(f_i\) 。
组形状和 alpha,\(f_{g_i}\) 和 \(\alpha _{g_i}\) 应仅累积组元素的形状和 alpha,不包括组背景。它们的最终值将成为组合成函数返回的组结果。完整的 alpha,αi 也包括背景贡献;其值用于颜色合成计算。
NOTE 5
经过这些修正后,如果满足以下条件,将对象合成为一个组的效果与单独合成(不分组)的效果相同:
该组是非隔离的,并且具有与其父组相同的淘汰属性(请参阅 11.4.5,“隔离组”和“淘汰组”)。
将组的结果与组背景合成时,使用正常混合模式,形状和不透明度输入始终为 1.0。
The colour and opacity of a group shall be defined by the group compositing function:
\(<C,f,\alpha> = \text{Composite}(C_0, \alpha_0, G)\)
where the variables have the meanings shown in Table 141.
Variable | Meaning |
---|---|
\(G\) | The transparency group: a compound object consisting of all elements \(E_1, … , E_n\) of the group—the n constituent objects’ colours, shapes, opacities, and blend modes |
\(C_0\) | Colour of the group’s backdrop |
\(C\) | Computed colour of the group, which shall be used as the source colour when the group is treated as an object |
\(f\) | Computed shape of the group, which shall be used as the object shape when the group is treated as an object |
\(\alpha_0\) | Alpha of the group’s backdrop |
\(\alpha\) | Computed alpha of the group, which shall be used as the object alpha when the group is treated as an object |
NOTE 1
The opacity is not given explicitly as an argument or result of this function. Almost all of the computations use the product of shape and opacity (alpha) rather than opacity alone; therefore, it is usually convenient to work directly with shape and alpha rather than shape and opacity. When needed, the opacity can be computed by dividing the alpha by the associated shape.
The result of applying the group compositing function shall then be treated as if it were a single object, which in turn is composited with the group’s backdrop according to the formulas defined in this sub-clause. In those formulas, the colour, shape, and alpha (C, f, and α) calculated by the group compositing function shall be used, respectively, as the source colour \(C_s\) , the object shape \(f_j\) , and the object alpha \(α_j\) .
The group compositing formulas for a non-isolated, non-knockout group are defined as follows:
-
Initialization:
\(f_{g_0} = \alpha_{g_0} = 0.0\)
-
For each group element \(E_i \in G(i=1, \dots , n)\):
\(<C_{s_i}, f_{j_i}, \alpha_{j_i}> = \begin{cases} \text{Composite}(C_{i-1}, \alpha _{i-1}, E_i) & \text{ if } E_i \text{ is a group} \\ \text{intrinsic color, shape, and }(\text{shape} \times \text{opacity}) \text{ of } E_i & \text{ otherwise } \end{cases}\)
\(\begin{align} & f_{s_i} = f_{j_i} \times f_{m_i} \times f_{k_i} \\ & \alpha _{s_i} = \alpha _{j_i} \times (f_{m_i} \times q_{m_i}) \times (f_{k_i} \times q_{k_i})\\\\ & f_{g_i} = \text{Union}(f_{g_{i-1}}, f_{s_i}) \\ & \alpha _{g_i} = \text{Union}(\alpha _{g_{i-1}}, \alpha _{s_i})\\ & \alpha _i = \text{Union}(\alpha _0, \alpha _{g_i}) \\\\ & C_i = \left ( 1 - \frac{\alpha _{s_i}}{\alpha _i} \right ) \times C_{i-1} + \frac{\alpha _{s_i}}{\alpha _i} \times ((1- \alpha _{i-1}) \times C_{s_i} + \alpha _{i-1} \times B_i(C_{i-1}, C_{s_i})) \end{align}\)
-
Result:
\(\begin{align} & C = C_n + (C_n - C_0) \times \left( \frac{\alpha _0}{\alpha _{g_n}} - \alpha _0 \right) \\ & f = f_{g_n} \\ & \alpha = \alpha _{g_n} \end{align}\)
where the variables have the meanings shown in Table 142 (in addition to those in Table 141).
For an element \(E_i\) that is an elementary object, the colour, shape, and alpha values \(C_{s_i}\) , \(f_{j_i}\) , and \(α_{j_i}\) are intrinsic attributes of the object. For an element that is a group, the group compositing function shall be applied recursively to the subgroup and the resulting C, f, and α values shall be used for its \(C_{s_i}\) , \(f_{j_i}\) , and \(α_{j_i}\) in the calculations for the parent group.
Variable | Meaning |
---|---|
\(E_i\) | Element i of the group: a compound variable representing the element’s colour, shape, opacity, and blend mode |
\(f_{s_i}\) | Source shape for element \(E_i\) |
\(f_{j_i}\) | Object shape for element \(E_i\) |
\(f_{m_i}\) | Mask shape for element \(E_i\) |
\(f_{k_i}\) | Constant shape for element \(E_i\) |
\(f_{g_i}\) | Group shape: the accumulated source shapes of group elements \(E_1\) to \(E_i\) , excluding the initial backdrop |
\(q_{m_i}\) | Mask opacity for element \(E_i\) |
\(q_{k_i}\) | Constant opacity for element \(E_i\) |
\(\alpha_{s_i}\) | Source opacity for element \(E_i\) |
\(\alpha_{j_i}\) | Object alpha for element \(E_i\) : the product of its object shape and object opacity |
\(\alpha_{g_i}\) | Group alpha: the accumulated source alphas of group elements \(E_1\) to \(E_i\), excluding the initial backdrop |
\(\alpha_i\) | Accumulated alpha after compositing element \(E_i\), including the initial backdrop |
\(C_{s_i}\) | Source colour for element \(E_i\) |
\(C_i\) | Accumulated colour after compositing element \(E_i\), including the initial backdrop |
\(B_i(C_{i-1}, C_{s_i})\) | Blend function for element \(E_i\) |
NOTE 2
The elements of a group are composited onto a backdrop that includes the group’s initial backdrop. This is done to achieve the correct effects of the blend modes, most of which are dependent on both the backdrop and source colours being blended. This feature is what distinguishes non-isolated groups from isolated groups, discussed in the next sub-clause.
NOTE 3
Special attention should be directed to the formulas at the end that compute the final results C, f, and α, of the group compositing function. Essentially, these formulas remove the contribution of the group backdrop from the computed results. This ensures that when the group is subsequently composited with that backdrop (possibly with additional shape or opacity inputs or a different blend mode), the backdrop’s contribution is included only once.
For colour, the backdrop removal is accomplished by an explicit calculation, whose effect is essentially the reverse of compositing with the Normal blend mode. The formula is a simplification of the following formulas, which present this operation more intuitively:
\(\begin{align} & \varphi _b = \frac{(1 - \alpha_{g_n}) \times \alpha _0}{\text{Union}(\alpha _0, \alpha_{g_n}) } \\\\ & C = \frac{C_n - \varphi_b \times C_0}{1-\varphi _b} \end{align}\)
where \(φ_b\) is the backdrop fraction, the relative contribution of the backdrop colour to the overall colour.
NOTE 4
For shape and alpha, backdrop removal is accomplished by maintaining two sets of variables to hold the accumulated values. There is never any need to compute the corresponding complete shape, \(f_i\) , that includes the backdrop contribution.
The group shape and alpha, \(f_{g_i}\) and \(\alpha _{g_i}\) , shall accumulate only the shape and alpha of the group elements, excluding the group backdrop. Their final values shall become the group results returned by the group compositing function. The complete alpha, αi , includes the backdrop contribution as well; its value is used in the colour compositing computations.
NOTE 5
As a result of these corrections, the effect of compositing objects as a group is the same as that of compositing them separately (without grouping) if the following conditions hold:
The group is non-isolated and has the same knockout attribute as its parent group (see 11.4.5, "Isolated Groups," and “Knockout Groups”).
When compositing the group’s results with the group backdrop, the Normal blend mode is used, and the shape and opacity inputs are always 1.0.
11.4.5 孤立团体¶
Isolated Groups
隔离组 是指其元素应合成为完全透明的初始背景,而不是组的背景。因此,组的最终源颜色、对象形状和对象不透明度应独立于组的背景。与组背景的唯一交互发生在将组计算出的颜色、形状和不透明度与其合成时。
特别是,组内对象的混合模式所产生的特殊效果仅考虑这些对象的固有颜色和不透明度;它们不应受组背景的影响。
示例
在组中对某个对象应用 正片叠底 混合模式会对组堆栈中较低位置的其他对象产生变暗效果,但不会影响组的背景。
附录 L 中的图 L.17 展示了由四个重叠的浅灰色(C = M = Y = 0.0;K = 0.15)圆形组成的组的效果。这些圆形在组内以 正片叠底 混合模式绘制,不透明度为 1.0;组本身则以 正常 混合模式绘制到其背景上。在顶部行中,组是隔离的,因此不与彩虹背景交互。在底部行中,组是非隔离的,并与背景合成。该图还展示了隔离组和非隔离组之间的区别(见 “隔离组”)。
注 1
从概念上讲,隔离组的效果可以通过一个简单对象来表示,该对象直接在每个点指定颜色、形状和不透明度。这种对隔离组的扁平化有时在应用程序中导入和导出完全合成的图稿时很有用。此外,指定显式混合颜色空间的组应为隔离组。
对于隔离组,组合成公式应通过在初始化时添加一条语句来修改:
\(α_0 = 0.0\) 如果组是隔离的
也就是说,组元素合成的初始背景应是透明的,而不是从组的背景继承而来。
注 2
这种替换也使 \(C_0\) 未定义,但正常的合成公式会处理这个问题。此外,C 的结果计算自动简化为 \(C = C_n\) ,因为无需考虑背景的贡献 。
An isolated group is one whose elements shall be composited onto a fully transparent initial backdrop rather than onto the group’s backdrop. The resulting source colour, object shape, and object alpha for the group shall be therefore independent of the group backdrop. The only interaction with the group backdrop shall occur when the group’s computed colour, shape, and alpha are composited with it.
In particular, the special effects produced by the blend modes of objects within the group take into account only the intrinsic colours and opacities of those objects; they shall not be influenced by the group’s backdrop.
EXAMPLE
Applying the Multiply blend mode to an object in the group produces a darkening effect on other objects lower in the group’s stack but not on the group’s backdrop.
Figure L.17 in Annex L illustrates this effect for a group consisting of four overlapping circles in a light gray colour(C = M = Y = 0.0; K = 0.15). The circles are painted within the group with opacity 1.0 in the Multiply blend mode; the group itself is painted against its backdrop in Normal blend mode. In the top row, the group is isolated and thus does not interact with the rainbow backdrop. In the bottom row, the group is non-isolated and composites with the backdrop. The figure also illustrates the difference between knockout and non-knockout groups (see “Knockout Groups”).
NOTE 1
Conceptually, the effect of an isolated group could be represented by a simple object that directly specifies a colour, shape, and opacity at each point. This flattening of an isolated group is sometimes useful for importing and exporting fully composited artwork in applications. Furthermore, a group that specifies an explicit blending colour space shall be an isolated group.
For an isolated group, the group compositing formulas shall be altered by adding one statement to the initialization:
\(α_0 = 0.0\) if the group is isolated
That is, the initial backdrop on which the elements of the group are composited shall be transparent rather than inherited from the group’s backdrop.
NOTE 2
This substitution also makes \(C_0\) undefined, but the normal compositing formulas take care of that. Also, the result computation for C automatically simplifies to \(C = C_n\) , since there is no backdrop contribution to be factored out.
11.4.6 Knockout 组¶
Knockout Groups
在挖空组中,每个单独的元素应与组的初始背景合成,而不是与该组中前面的元素堆叠合成。当对象具有二元形状(内部为 1.0,外部为 0.0)时,在同一组内,每个对象将覆盖(挖空)其重叠的任何前面元素的效果。在任何给定点,仅最上层包围该点的对象会对整个组的最终颜色和不透明度产生贡献。
示例
关于 11.4.5“隔离组”的[附件 L]中的图 L.17 阐述了挖空组与非挖空组之间的区别。在左列中,四个重叠的圆形被定义为挖空组,因此在该组内它们之间不会相互合成。在右列中,这些圆形形成一个非挖空组,因此它们之间会相互合成。在每一列中,上下两个图形分别表示隔离组和非隔离组。
注 1
这种模型类似于不透明成像模型,不同之处在于“最上层对象优先”规则同时适用于颜色和不透明度。挖空组在从一组重叠对象合成一幅图稿时很有用,在任何重叠部分,最上层的对象会完全遮挡下面的对象。同时,最上层的对象会以通常的方式与组的初始背景交互,适当应用其不透明度和混合模式。
挖空的概念被推广以适应分数形状值。在这种情况下,直接背景只会部分被挖空,并且仅用对象与初始背景合成的结果的一部分来替换。
重新表述的组合成公式通过引入一个新变量 b 来处理挖空组,b 是一个下标,用于指定在合成计算中使用哪个前面的结果作为背景:在挖空组中为 0,在非挖空组中为 i - 1。当 \(b = i - 1\) 时,公式简化为 11.4.4“组合成计算”中给出的公式。
一般情况下,计算将分两个阶段进行:
a) 将源对象与组的初始背景合成,忽略对象的形状,并在所有地方使用源形状值 1.0。这将产生未归一化的临时不透明度和颜色结果,\(α_t\) 和 \(C_t\) 。
注 2
对于颜色,此计算本质上与 11.3.6“Alpha 的解释”中给出的未简化颜色合成公式相同,但使用源形状为 1.0。
\(\begin{align} & \alpha _t = \text{并集}(\alpha_{g_b}, q_{s_i}) \\ & C_t = (1 - q_{s_i}) \times \alpha _b \times C_b + q_{s_i} \times ((1-\alpha _b) \times C_{s_i} + \alpha _b \times B_i(C_b, S_{s_i})) \end{align}\)
b) 使用源形状作为加权因子,将此结果与对象的直接背景计算加权平均值。然后按结果不透明度对结果颜色进行归一化:
\(\begin{align} & \alpha _{g_i} = (1 - f_{s_i}) \times \alpha _{g_{i-1}} + {f_{s_i}} \times \alpha_t \\ & \alpha_i = \text{并集}(\alpha_0, \alpha_{g_i}) \\ & C_i = \frac{(1 - f_{s_i}) \times \alpha_{i-1} \times C_{i-1} + f_{s_i} \times C_t}{\alpha _i} \end{align}\)
这种平均计算应同时针对颜色和不透明度进行。
注 3
前面的公式直接展示了这种平均。 11.4.8“组合成计算总结”中的公式略有修改,使用源形状和不透明度而不是源形状和不透明度,避免了显式计算源不透明度值的需要。
注 4
组合成计算中的 \(C_t\) 与前面的 \(C_t\) 略有不同:它由 \(f_{s_i}\) 预乘。
注 5
源形状的极值会产生直接的挖空效果。也就是说,形状值为 1.0(内部)会产生对象与初始背景合成的颜色和不透明度。形状值为 0.0(外部)会保留前一组的结果不变。
挖空功能的存在是保留单独形状值而不是仅使用结合形状和不透明度的单个不透明度的主要原因。在任何随后用作挖空组成员的组中,都应计算单独的形状值。
挖空组可以是隔离的或非隔离的;也就是说,隔离和挖空是独立的属性。非隔离挖空组将其最上层包围元素与组的背景合成。隔离挖空组将元素与透明背景合成。
注 6
当非隔离组嵌套在挖空组内时,内部组的初始背景与外部组的初始背景相同;它不是内部组的直接背景。这种行为虽然可能出乎意料,但当 b = 0 时,这是组合成公式的结果 。
In a knockout group, each individual element shall be composited with the group’s initial backdrop rather than with the stack of preceding elements in the group. When objects have binary shapes (1.0 for inside, 0.0 for outside), each object shall overwrite (knocks out) the effects of any earlier elements it overlaps within the same group. At any given point, only the topmost object enclosing the point shall contribute to the result colour and opacity of the group as a whole.
EXAMPLE
Figure L.17 in Annex L about 11.4.5, "Isolated Groups," illustrates the difference between knockout and non-knockout groups. In the left column, the four overlapping circles are defined as a knockout group and therefore do not composite with each other within the group. In the right column, the circles form a non-knockout group and thus do composite with each other. In each column, the upper and lower figures depict an isolated and a non-isolated group, respectively.
NOTE 1
This model is similar to the opaque imaging model, except that the “topmost object wins” rule applies to both the colour and the opacity. Knockout groups are useful in composing a piece of artwork from a collection of overlapping objects, where the topmost object in any overlap completely obscures those beneath. At the same time, the topmost object interacts with the group’s initial backdrop in the usual way, with its opacity and blend mode applied as appropriate.
The concept of knockout is generalized to accommodate fractional shape values. In that case, the immediate backdrop shall be only partially knocked out and shall be replaced by only a fraction of the result of compositing the object with the initial backdrop.
The restated group compositing formulas deal with knockout groups by introducing a new variable, b, which is a subscript that specifies which previous result to use as the backdrop in the compositing computations: 0 in a knockout group or i − 1 in a non-knockout group. When \(b = i − 1\), the formulas simplify to the ones given in 11.4.4, "Group Compositing Computations."
In the general case, the computation shall proceed in two stages:
a) Composite the source object with the group’s initial backdrop, disregarding the object’s shape and using a source shape value of 1.0 everywhere. This produces unnormalized temporary alpha and colour results, \(α_t\) and \(C_t\) .
NOTE 2
For colour, this computation is essentially the same as the unsimplified colour compositing formula given in 11.3.6, "Interpretation of Alpha," but using a source shape of 1.0.
\(\begin{align} & \alpha _t = \text{Union}(\alpha_{g_b}, q_{s_i}) \\ & C_t = (1 - q_{s_i}) \times \alpha _b \times C_b + q_{s_i} \times ((1-\alpha _b) \times C_{s_i} + \alpha _b \times B_i(C_b, S_{s_i})) \end{align}\)
b) Compute a weighted average of this result with the object’s immediate backdrop, using the source shape as the weighting factor. Then normalize the result colour by the result alpha:
\(\begin{align} & \alpha _{g_i} = (1 - f_{s_i}) \times \alpha _{g_{i-1}} + {f_{s_i}} \times \alpha_t \\ & \alpha_i = \text{Union}(\alpha_0, \alpha_{g_i}) \\ & C_i = \frac{(1 - f_{s_i}) \times \alpha_{i-1} \times C_{i-1} + f_{s_i} \times C_t}{\alpha _i} \end{align}\)
This averaging computation shall be performed for both colour and alpha.
NOTE 3
The preceding formulas show this averaging directly. The formulas in 11.4.8, "Summary of Group Compositing Computations," are slightly altered to use source shape and alpha rather than source shape and opacity, avoiding the need to compute a source opacity value explicitly.
NOTE 4
\(C_t\) in Group Compositing Computations is slightly different from the preceding \(C_t\): it is premultiplied by \(f_{s_i}\).
NOTE 5
The extreme values of the source shape produce the straightforward knockout effect. That is, a shape value of 1.0 (inside) yields the colour and opacity that result from compositing the object with the initial backdrop. A shape value of 0.0 (outside) leaves the previous group results unchanged.
The existence of the knockout feature is the main reason for maintaining a separate shape value rather than only a single alpha that combines shape and opacity. The separate shape value shall be computed in any group that is subsequently used as an element of a knockout group.
A knockout group may be isolated or non-isolated; that is, isolated and knockout are independent attributes. A non-isolated knockout group composites its topmost enclosing element with the group’s backdrop. An isolated knockout group composites the element with a transparent backdrop.
NOTE 6
When a non-isolated group is nested within a knockout group, the initial backdrop of the inner group is the same as that of the outer group; it is not the immediate backdrop of the inner group. This behaviour, although perhaps unexpected, is a consequence of the group compositing formulas when b = 0.
11.4.7 Page组¶
Page Group
页面上直接绘制的所有元素——包括顶级组和不属于任何组的顶级对象——都应视为包含在一个透明度组 P 中,该组随后将与依赖上下文的背景合成。这个组称为页面组。
页面组应以两种截然不同的方式之一进行处理:
- 通常情况下,页面将直接输出到介质上,例如纸张或显示屏。页面组应被视为一个隔离组,其结果随后将与适合该介质的背景颜色合成。背景通常为白色,但会根据介质的实际属性有所不同。不过,一些符合标准的阅读器可能会选择提供不同的背景,例如棋盘格或网格,以帮助直观地查看图稿中的透明效果。
- PDF 文件的“页面”可被视为用作其他文档某页面元素的图形对象。
示例
例如,当将包含由绘图程序制作的图稿的 PDF 文件放置到由排版程序生成的页面布局中时,就会出现这种情况。在这种情况下,PDF“页面”不会与介质颜色合成;相反,它被视为一个普通的透明度组,可以是隔离的或非隔离的,并以正常方式与其背景合成。
本小节的其余部分仅涉及页面组的第一种用途,即直接输出到介质上。
页面在给定点的颜色 C 应由通用组合成公式的简化形式定义:
\(\begin{align} \left \langle C_g,f_g,\alpha _g \right \rangle &= \text{合成}(U, 0, P) \\ C &= (1 - \alpha _g) \times W + \alpha _g \times C_g \end{align}\)
其中各变量的含义见表 143。第一个公式计算给定透明背景的组的颜色和不透明度——实际上是将 P 视为一个隔离组。第二个公式将结果与依赖上下文的背景合成(使用相当于正常混合模式的方式)。
变量 | 含义 |
---|---|
\(P\) | 页面组,由页面顶级堆栈中的所有元素 \(E_1, … , E_n\) 组成 |
\(C_g\) | 页面组的计算颜色 |
\(f_g\) | 页面组的计算形状 |
\(\alpha _g\) | 页面组的计算不透明度 |
\(C\) | 页面的计算颜色 |
\(W\) | 页面的初始颜色(通常为白色,但可能根据介质的属性或应用程序的需求而有所不同) |
\(U\) | 未定义的颜色(由于合成的 \(α_0\) 参数为 0,因此不使用) |
如果未另行指定,页面组的颜色空间应从输出设备的本机颜色空间继承——即设备颜色空间,如DeviceRGB或DeviceCMYK。应指定明确的颜色空间,特别是基于 CIE 的空间,以确保页面组内合成计算的结果更具可预测性。在这种情况下,所有页面级合成都应在指定的颜色空间中进行,然后将整个结果转换为输出设备的本机颜色空间,再与依赖上下文的背景合成。
注
当页面实际上并未被渲染,而是转换为不透明成像模型(如 PostScript)中的平面表示形式时,也会出现这种情况 。
All of the elements painted directly onto a page—both top-level groups and top-level objects that are not part of any group—shall be treated as if they were contained in a transparency group P, which in turn is composited with a context-dependent backdrop. This group is called the page group.
The page group shall be treated in one of two distinctly different ways:
- Ordinarily, the page shall be imposed directly on an output medium, such as paper or a display screen. The page group shall be treated as an isolated group, whose results shall then be composited with a backdrop colour appropriate for the medium. The backdrop is nominally white, although varying according to the actual properties of the medium. However, some conforming readers may choose to provide a different backdrop, such as a checker board or grid to aid in visualizing the effects of transparency in the artwork.
- A “page” of a PDF file may be treated as a graphics object to be used as an element of a page of some other document.
EXAMPLE
This case arises, for example, when placing a PDF file containing a piece of artwork produced by a drawing program into a page layout produced by a layout program. In this situation, the PDF “page” is not composited with the media colour; instead, it is treated as an ordinary transparency group, which can be either isolated or non-isolated and is composited with its backdrop in the normal way.
The remainder of this sub-clause pertains only to the first use of the page group, where it is to be imposed directly on the medium.
The colour C of the page at a given point shall be defined by a simplification of the general group compositing formula:
\(\begin{align} \left \langle C_g,f_g,\alpha _g \right \rangle &= \text{Composite}(U, 0, P) \\ C &= (1 - \alpha _g) \times W + \alpha _g \times C_g \end{align}\)
where the variables have the meanings shown in Table 143. The first formula computes the colour and alpha for the group given a transparent backdrop—in effect, treating P as an isolated group. The second formula composites the results with the context-dependent backdrop (using the equivalent of the Normal blend mode).
Variable | Meaning |
---|---|
\(P\) | The page group, consisting of all elements \(E_1, … , E_n\) in the page’s top-level stack |
\(C_g\) | Computed colour of the page group |
\(f_g\) | Computed shape of the page group |
\(\alpha _g\) | Computed alpha of the page group |
\(C\) | Computed colour of the page |
\(W\) | Initial colour of the page (nominally white but may vary depending on the properties of the medium or the needs of the application) |
\(U\) | An undefined colour (which is not used, since the \(α_0\) argument of Composite is 0) |
If not otherwise specified, the page group’s colour space shall be inherited from the native colour space of the output device—that is, a device colour space, such as DeviceRGB or DeviceCMYK. An explicit colour space should be specified, particularly a CIE-based space, to ensure more predictable results of the compositing computations within the page group. In this case, all page-level compositing shall be done in the specified colour space, and the entire result shall then be converted to the native colour space of the output device before being composited with the context-dependent backdrop.
NOTE
This case also arises when the page is not actually being rendered but is converted to a flattened representation in an opaque imaging model, such as PostScript.
11.4.8 群组合成计算总结¶
Summary of Group Compositing Computations
本小节是对组合成公式的重新阐述,同时也考虑了隔离组和挖空组。有关变量的含义,请参见11.4.4“组合成计算”中的表141和表142。
\(\left \langle C,f,\alpha \right \rangle = \text{合成}(C_0, \alpha _0, G)\)
初始化:
\(\begin{align} & f_{g_0} = \alpha _{g_0} = 0 \\ & \alpha _0 = 0 \qquad \qquad \text{如果组是隔离的} \end{align}\)
对于组中的每个元素 \(E_i \in G\)(\(i = 1, … , n\)):
\(b = \begin{cases} 0 & \text{如果组是挖空组} \\ i - 1 & \text{否则} \end{cases}\)
\(\left \langle C_{s_i}, f_{j_i}, \alpha _{j_i} \right \rangle = \begin{cases} \text{合成}(C_b, \alpha _b, E_i) & \text{如果 } E_i \text{ 是一个组} \\ E_i \text{ 的固有颜色、形状和 } (\text{形状} \times \text{不透明度}) & \text{否则} \end{cases}\)
\(\begin{align} & f_{s_i} = f_{j_i} \times f_{m_i} \times f_{k_i} \\ & \alpha _{s_i} = \alpha _{j_i} \times (f_{m_i} \times q_{m_i}) \times (f_{k_i} \times q_{k_i}) \\\\ & f_{g_i} = \text{并集}(f_{g_{i-1}}, f_{s_i}) \\ & \alpha _{g_i} = (1 - f_{s_i}) \times \alpha _{g_{i-1}} + (f_{s_i} - \alpha _{s_i}) \times \alpha _{g_b} + \alpha _s \\ & \alpha _{i} = \text{并集}(\alpha _0, \alpha _{g_i}) \\\\ & C_t = (f_{s_i} - \alpha _{s_i}) \times \alpha _b \times C_b + \alpha _{s_i} \times ((1 - \alpha _b) \times C_{s_i} + \alpha _b \times B_i(C_b, C_{s_i})) \\\\ & C_i = \frac{(1 - f_{s_i} \times \alpha _{i-1} \times C_{i-1}) + C_t}{\alpha _i} \end{align}\)
结果:
\(\begin{align} & C = C_n + (C_n - C_0) \times \left ( \frac{\alpha _0}{\alpha _{g_n}} - \alpha _0 \right ) \\ & f = f_{g_n} \\ & \alpha = \alpha _{g_n} \end{align}\)
注
再次提醒,要记住这些公式是最通用形式。当某些形状和不透明度的来源不存在,或者不需要分别维护形状和不透明度时,这些公式可以显著简化。此外,在每种特定类型的组(隔离与否,挖空与否)中,这些公式的一些项会相互抵消或消失。高效的实现应使用简化后的派生公式 。
This sub-clause is a restatement of the group compositing formulas that also takes isolated groups and knockout groups into account. See Tables 141 and 142 in 11.4.4, "Group Compositing Computations," for the meanings of the variables.
\(\left \langle C,f,\alpha \right \rangle = \text{Composite}(C_0, \alpha _0, G)\)
Initialization:
\(\begin{align} & f_{g_0} = \alpha _{g_0} = 0 \\ & \alpha _0 = 0 \qquad \qquad \text{if the group is isolated} \end{align}\)
For each group element \(E_i \in G(i = 1, … , n)\):
\(b = \begin{cases} 0 & \text{ if the group is knockout } \\ i-1 & \text{ otherwise } \end{cases}\)
\(\left \langle C_{s_i}, f_{j_i}, \alpha _{j_i} \right \rangle = \begin{cases} \text{Composite}(C_b, \alpha _b, E_i) & \text{ if } E_i \text{ is a group } \\ \text{ intrinsic color, shape, and } (\text{shape} \times \text{opacity} ) \text{ of } E_i & \text{ otherwise } \end{cases}\)
\(\begin{align} & f_{s_i} = f_{j_i} \times f_{m_i} \times f_{k_i} \\ & \alpha _{s_i} = \alpha _{j_i} \times (f_{m_i} \times q_{m_i}) \times (f_{k_i} \times q_{k_i}) \\\\ & f_{g_i} = \text{Union}(f_{g_{i-1}}, f_{s_i}) \\ & \alpha _{g_i} = (1 - f_{s_i}) \times \alpha _{g_{i-1}} + (f_{s_i} - \alpha _{s_i}) \times \alpha _{g_b} + \alpha _s \\ & \alpha _{i} = \text{Union}(\alpha _0, \alpha _{g_i}) \\\\ & C_t = (f_{s_i} - \alpha _{s_i}) \times \alpha _b \times C_b + \alpha _{s_i} \times ((1 - \alpha _b) \times C_{s_i} + \alpha _b \times B_i(C_b, C_{s_i})) \\\\ & C_i = \frac{(1 -f_{s_i} \times \alpha _{i-1} \times C_{i-1} + C_t)}{\alpha _i} \end{align}\)
Result:
\(\begin{align} & C = C_n + (C_n - C_0) \times \left ( \frac{\alpha _0}{\alpha _{g_n}} - \alpha _0 \right ) \\ & f = f_{g_n} \\ & \alpha = \alpha _{g_n} \end{align}\)
NOTE
Once again, keep in mind that these formulas are in their most general form. They can be significantly simplified when some sources of shape and opacity are not present or when shape and opacity need not be maintained separately. Furthermore, in each specific type of group (isolated or not, knockout or not), some terms of these formulas cancel or drop out. An efficient implementation should use the simplified derived formulas.