Skip to content

Commit ba47d27

Browse files
[css-images-4] Make cross-fade() accept 1+ arguments. w3c/csswg-drafts@3c8eb27
1 parent 239740b commit ba47d27

1 file changed

Lines changed: 123 additions & 124 deletions

File tree

css-images4-ja.html

Lines changed: 123 additions & 124 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,17 +2294,17 @@ <h4 title="Bidi-sensitive Images">2.5.4. 双向性に応じる画像</h4>
22942294
</section>
22952295
</section>
22962296
<section id="cross-fade-function">
2297-
<h3 title="Combining images: the cross-fade() notation">2.6. 画像を組合せる: `cross-fade^f 記法</h3>
2297+
<h3 title="Combining images: the cross-fade() notation">2.6. 画像の結合-法: `cross-fade^f 記法</h3>
22982298

22992299
<p>
23002300
~CSSにより 2 個の画像~間の遷移を与えるためには、[
23012301
開始-, 終止-
2302-
画像を組合せた中間的な画像を明示的に指す仕方を要する
2302+
画像を結合した中間的な画像を明示的に指す仕方を要する
23032303
`cross-fade$f 関数が、
23042304
これを達成する。
23052305
それは、
2306-
組合される 2 個の画像, および
2307-
組合nの遷移の進行度合いを指示する
2306+
結合される 2 個【実際には 1 個以上】の画像, および
2307+
結合nにおける遷移の進行度合いを指示する
23082308
23092309
When transitioning between images, CSS requires a way to explicitly refer to the intermediate image that is a combination of the start and end images. This is accomplished with the cross-fade() function, which indicates the two images to be combined and how far along in the transition the combination is.
23102310
</p>
@@ -2313,7 +2313,7 @@ <h3 title="Combining images: the cross-fade() notation">2.6. 画像を組合せ
23132313
作者は、
23142314
`cross-fade$f 関数を,多くの単純な画像~操作にも利用できる
23152315
— 画像を単色で淡く染めたり、
2316-
`放射型~gradient$と組合せて,~page内の特定0の区画を強調するなど。
2316+
`放射型~gradient$と結合して,~page内の特定0の区画を強調するなど。
23172317
23182318
Note: Authors can also use the cross-fade() function for many simple image manipulations, such as tinting an image with a solid color or highlighting a particular area of the page by combining an image with a radial gradient.
23192319
</p>
@@ -2334,7 +2334,7 @@ <h3 title="Combining images: the cross-fade() notation">2.6. 画像を組合せ
23342334

23352335
<p>
23362336
この関数は、
2337-
1 個~以上の画像を組合せて生成される画像を表現する
2337+
1 個~以上の画像を結合して生成される画像を表現する
23382338
23392339
The function represents an image generated by combining one or more images.
23402340
</p>
@@ -2356,7 +2356,6 @@ <h3 title="Combining images: the cross-fade() notation">2.6. 画像を組合せ
23562356
]を減算してから `0%^v 以上に切り上げた結果が,算出d値の時点で[
23572357
省略された百分率を伴うすべての画像
23582358
]に等分にあてがわれる。
2359-
【`実際の~algo@#cross-fade-painting$/下の注記と食い違う?】
23602359
23612360
If any percentages are omitted, all the specified percentages are summed together and subtracted from 100%, the result is floored at 0%, then divided equally between all images with omitted percentages at computed-value time.
23622361
</p>
@@ -2413,109 +2412,136 @@ <h4 title="cross-fade() Sizing">2.6.1. `cross-fade^f の~sizing</h4>
24132412
The dimensions of the image represented by a cross-fade() are a weighted average of dimensions of the &lt;image&gt; arguments to the function; the &lt;color&gt; arguments have no effect. They are calculated as follows:
24142413
</p>
24152414

2416-
<p class="trans-note">
2417-
以下に現れる百分率は,
2418-
`cf-image$t を成す `percentage^t としか解釈しようがないが、
2419-
それは,混色-用の重みであり、
2420-
寸法の計算に利用されるのは不可解。
2421-
</p>
2422-
24232415
<div class="algo">
24242416
<p>
2425-
`cross-fade$f の
2426-
<dfn id="natural-dimensions-of-a-cross-fade">`生来な寸法$を決定する</dfn>
2427-
~algoは:
2417+
`生来な寸法を決定する@
2418+
~algoは、
2419+
所与の
2420+
( `cross-fade$f 関数 %関数 )
2421+
に対し,[
2422+
ある`生来な寸法$/
2423+
ε ( “生来な寸法は無い” )
2424+
]を返す:
24282425
24292426
To determine the natural dimensions of a cross-fade():
24302427
</p>
24312428
<ol>
24322429
<li>
2433-
%画像~list ~LET 新たな`~list$
2430+
<p>
2431+
( %引数~群, %leftover ) ~LET 混合-百分率たちを正規化する†( %関数 に渡された引数たちが成す~list )
2432+
</p>
2433+
<p class="trans-note">【†
2434+
参照-先が不明な未定義な~algo。
2435+
引数にて百分率が省略された場合でも、
2436+
%引数~群 を成す各~引数には
2437+
— `§ 画像の結合-法@#cross-fade-function$ に述べられたとおり —
2438+
百分率があてがわれると見受けられるが。
2439+
</p>
2440+
2441+
Normalize mix percentages from the function’s arguments, and let args and leftover be the result.
2442+
</li>
2443+
<li>
2444+
~IF[
2445+
%leftover ~EQ 100%
2446+
2447+
2448+
~RET ε
2449+
2450+
If leftover is 100%, return no natural dimensions.
2451+
</li>
2452+
<li>
2453+
%百分率~総和 ~LET 0
2454+
2455+
</li>
2456+
<li>
2457+
%~size群 ~LET 新たな`~list$
24342458
24352459
Let images be an empty list.
24362460
</li>
24372461
<li>
24382462
<p>
2439-
`cross-fade$f 関数の
2440-
~EACH( `image$t 値を伴う引数 %引数 )
2463+
%引数~群 を成す
2464+
~EACH( %引数 )
24412465
に対し:
2442-
2443-
For each argument of the cross-fade() function with an &lt;image&gt; value:
24442466
</p>
24452467
<ol>
24462468
<li>
2447-
%~item ~LET
2448-
( `横幅^i, `縦幅^i, `百分率^i )
2449-
からなる`~tuple$
2450-
2451-
Let item be a tuple consisting of a width, a height, and a percentage.
2469+
~IF[
2470+
%引数 は `image$t を伴わない
2471+
2472+
2473+
~CONTINUE
24522474
</li>
24532475
<li>
2454-
%~item の ( `横幅^i, `縦幅^i ) ~SET
2455-
%引数 `image$t に対し, `cross-fade$f が現れる文脈に適切に`~obj~size折衝$ ~algoを走らせた結果
2456-
の`具象-~obj~size$の ( 横幅, 縦幅 )
2457-
2458-
Run the object size negotiation algorithm for the &lt;image&gt;, as appropriate for the context in which the cross-fade() appears, and set item’s width and height to the width and height of the resulting concrete object size.
2476+
~IF
2477+
%引数 を成す `image$t の`生来な寸法$は無い
2478+
2479+
2480+
~CONTINUE
24592481
</li>
24602482
<li>
2461-
%~item の`百分率^i ~SET %引数 の百分率
2462-
2463-
Set item’s percentage to the argument’s percentage.
2483+
%~size ~LET %引数 に対し %関数 が現れる文脈に適切に`~obj~size折衝$を走らせた結果の`具象-~obj~size$
2484+
</li>
2485+
<li>
2486+
%百分率 ~LET %引数 を成す百分率
24642487
</li>
24652488
<li>
2466-
【 %画像~list に %~item を`付加する$ 】
2489+
%百分率~総和 ~INCBY %百分率
2490+
</li>
2491+
<li>
2492+
%~size群 に`~tuple$( %~size, %百分率 ) を`付加する$
24672493
</li>
24682494
</ol>
2469-
</li>
2495+
2496+
For each &lt;cf-image&gt; argument of the function’s arguments:
2497+
• If argument is not an &lt;image&gt;, or is an &lt;image&gt; with no natural dimensions, continue.
2498+
• Let item be a tuple consisting of a width, a height, and a percentage.
2499+
• Run the object size negotiation algorithm for the &lt;image&gt;, as appropriate for the context in which the cross-fade() appears,\
2500+
and set item’s width and height to the width and height of the resulting concrete object size.
2501+
• Set item’s percentage to the argument’s percentage.
2502+
</li>
24702503
<li>
24712504
~IF[
2472-
%画像~list は`空$である
2505+
%~size群 は`空$である
24732506
24742507
24752508
~RET ε
2476-
(`生来な寸法$は無い)
24772509
24782510
If images is empty, return no natural dimensions.
24792511
</li>
24802512
<li>
2481-
%百分率の総和 ~LET %画像~list 内のすべての`~item$の`百分率^iの総和
2513+
%横幅 ~LET 0
24822514
2483-
Let percentage sum be the sum of all the percentages of the items in images.
2484-
</li>
2515+
</li>
24852516
<li>
2486-
%画像~list を成す
2487-
~EACH( %~item )
2488-
に対し
2489-
2490-
%~item の百分率 ~SET %~item の`百分率^i ~DIV %百分率の総和
2517+
%縦幅 ~LET 0
24912518
2492-
For each item in images, divide item’s percentage by percentage sum, and set item’s percentage to the result.
2493-
</li>
2519+
</li>
24942520
<li>
2495-
~Assert:
2496-
%画像~list 内の`百分率^iの総和 ~EQ `100%^v
2497-
2498-
Assert: The percentages in images now sum to 100%.
2521+
<p>
2522+
%~size群 を成す
2523+
~EACH( %~item )
2524+
に対し:
2525+
</p>
2526+
<ol>
2527+
<li>
2528+
%重み ~LET %~item[ 1 ] ~DIV %百分率~総和
24992529
</li>
2500-
<li>
2501-
( %最終-横幅, %最終-縦幅 ) ~LET ( `0px^v, `0px^v )
2502-
2503-
Let final width and final height be 0px.
2530+
<li>
2531+
%横幅 ~INCBY %~item[ 0 ] を成す横幅 ~MUL %重み
25042532
</li>
2505-
<li>
2506-
%画像~list を成す
2507-
~EACH( %~item )
2508-
に対し
2509-
⇒#
2510-
%最終-横幅 ~INCBY %~item の`横幅^i ~MUL %~item の`百分率^i;
2511-
%最終-縦幅 ~INCBY %~item の`縦幅^i ~MUL %~item の`百分率^i
2512-
2513-
For each item in images, multiply item’s width by item’s percentage and add the result to final width, and multiply item’s height by item’s percentage and add the result to final height.
2533+
<li>
2534+
%縦幅 ~INCBY %~item[ 0 ] を成す縦幅 ~MUL %重み
25142535
</li>
2536+
</ol>
2537+
2538+
</li>
25152539
<li>
2516-
~RET `生来な寸法$( `生来な横幅$ %最終-横幅, `生来な縦幅$ %最終-縦幅 )
2540+
~RET ( `生来な横幅$ %横幅, `生来な縦幅$ %縦幅 )
2541+
2542+
Return a natural width and natural height that are weighted averages of the width and height of each item in images, according to their corresponding percentages.
25172543
2518-
Return a natural width of final width and a natural height of final height.
2544+
Note: The percentages might sum to a value less than 100%, so a naive weighted-averaging process might need to normalize them first.
25192545
</li>
25202546
</ol>
25212547
</div>
@@ -2533,107 +2559,80 @@ <h4 title="cross-fade() Painting">2.6.2. `cross-fade^f の塗ng</h4>
25332559

25342560
<div class="algo">
25352561
<p>
2536-
`cross-fade^f の
2562+
`cross-fade^f 関数 %関数
25372563
`外観を決定する@
25382564
~algoは:
25392565
25402566
To determine the appearance of a cross-fade():
25412567
</p>
25422568
<ol>
25432569
<li>
2544-
%画像~list ~LET 新たな`~list$
2570+
( %引数~群, %leftover ) ~LET 混合-百分率たちを正規化する【参照-先が不明な未定義な~algo】( %関数 に渡された引数たちが成す~list )
2571+
2572+
Normalize mix percentages from the function’s arguments, and let args and leftover be the result.
2573+
</li>
2574+
<li>
2575+
%画像~群 ~LET 新たな`~list$
25452576
25462577
Let images be an empty list.
25472578
</li>
25482579
<li>
25492580
<p>
2550-
%~size ~LET
2551-
`生来な寸法を決定する$手続きを利用して `cross-fade$f 関数の`具象-~obj~size$を見出した結果
2581+
%~size ~LET `生来な寸法を決定する$( %関数 )
25522582
</p>
2583+
25532584
<p class="trans-note">
2554-
`cross-fade^f 関数のどの引数も `image$t を伴わない場合、
2555-
手続きは ε を返すことになる。
2556-
その場合にどうなるかは、
2557-
ここには述べられていない
2585+
%~size ~EQ ε になる( %引数~群 を成す どの引数も `image$t を伴わない)場合にどうなるか,指定されていない
25582586
(`既定の~obj~size$と見做される?)。
25592587
</p>
25602588
25612589
Let size be a tuple of width and height, initialized to the result of finding the concrete object size of the cross-fade() function (using the natural dimensions of a cross-fade()).
25622590
</li>
25632591
<li>
25642592
<p>
2565-
`cross-fade$f 関数の
2593+
%引数~群 を成す
25662594
~EACH( %引数 )
25672595
に対し:
2568-
2569-
For each argument of the cross-fade() function:
25702596
</p>
25712597
<ol>
25722598
<li>
2573-
%~item ~LET
2574-
( `画像^i, `百分率^i )
2575-
からなる`~tuple$
2576-
2577-
Let item be a tuple consisting of an image and a percentage.
2599+
%画像 ~LET ε
25782600
</li>
25792601
<li>
25802602
~IF[
25812603
%引数 は `image$t 値を伴う
25822604
25832605
2584-
%~item の`画像^i ~SET その `image^t 画像を %~size に拡縮し直した結果
2585-
2586-
If argument has an &lt;image&gt;, rescale it to size’s width and height and set item’s image to the result.\
2606+
%画像 ~SET その `image^t 画像を %~size に拡縮し直した結果
25872607
</li>
25882608
<li>
25892609
~ELSE
25902610
( %引数 は `color$t 値を伴う)
25912611
2592-
%~item の`画像^i ~SET
2593-
寸法 %~size の,その `color^t の単色~画像
2594-
2595-
Otherwise, argument has a &lt;color&gt;; set item’s image to a solid-color image of the &lt;color&gt;, with size’s dimensions.
2612+
%画像 ~SET 寸法 %~size の,その `color^t の単色~画像
25962613
</li>
25972614
<li>
2598-
%~item の`百分率^i ~SET %引数 の百分率
2599-
【無い場合は?】
2600-
2601-
Set item’s percentage to the argument’s percentage.
2615+
%百分率 ~LET %引数 の百分率
26022616
</li>
26032617
<li>
2604-
%画像~list%~item を`付加する$
2618+
%画像~`~tuple$( %画像, %百分率 ) を`付加する$
26052619
</li>
26062620
</ol>
2607-
</li>
2608-
<li>
2609-
%百分率の総和 ~LET %画像~list を成すすべての`~item$の`百分率^iの総和
26102621
2611-
Let percentage sum be the sum of all the percentages of the items in images.
2622+
For each argument of the cross-fade() function:
2623+
• Let item be a tuple consisting of an image and a percentage.
2624+
• If argument has an &lt;image&gt;, rescale it to size’s width and height and set item’s image to the result. Otherwise, argument has a &lt;color&gt;; set item’s image to a solid-color image of the &lt;color&gt;, with size’s dimensions.
2625+
• Set item’s percentage to the argument’s percentage.
26122626
</li>
26132627
<li>
26142628
~IF[
2615-
%百分率の総和 ~LT 100%
2616-
2617-
2618-
%画像~list に次のようにされた`~tuple$を付加する
2619-
⇒#
2620-
`画像^i ~SET 寸法 %~size の`透明な黒$にされた単色~画像,
2621-
`百分率^i ~SET 100% ~MINUS %百分率の総和
2622-
2623-
If percentage sum is less than 100%, append a tuple to images consisting of a solid-color transparent-black image with size’s dimensions, and a percentage equal to 100% minus percentage sum.
2624-
</li>
2625-
<li>
2626-
~ELIF[
2627-
%百分率の総和 ~GT 100%
2629+
%leftover ~GT 0%
26282630
26292631
2630-
%画像~list を成す
2631-
~EACH( %~item )
2632-
に対し
2633-
2634-
%~item の`百分率^i ~SET %~item の百分率 ~DIV %百分率の総和
2632+
%画像~群 に
2633+
`~tuple$( 寸法 %~size の`透明な黒$にされた単色~画像, %leftover ) を`付加する$
26352634
2636-
Otherwise, if percentage sum is greater than 100%, then for each item in images, divide item’s percentage by percentage sum, and set item’s percentage to the result.
2635+
If leftover is greater than 0%, append a tuple to images consisting of a solid-color transparent-black image with size’s dimensions, and a percentage equal to leftover.
26372636
</li>
26382637
<li>
26392638
<div>
@@ -2645,11 +2644,11 @@ <h4 title="cross-fade() Painting">2.6.2. `cross-fade^f の塗ng</h4>
26452644
寸法 %~size
26462645
</li>
26472646
<li>
2648-
各 画素は
2649-
%画像~list 内の各 %~item の`画像^iの,対応する画素
2650-
]たちに対し,
2651-
%~item の百分率を重みに用いて線型~加重d平均をとった結果
2652-
(色~channel, ~alpha~channelとも平均をとる
2647+
各 画素は
2648+
%画像~群 を成す~itemたちの[
2649+
%~item[ 0 ] を成す対応する画素
2650+
]たちに対し %~item[ 1 ] を重みに用いて線型~加重d平均をとった結果
2651+
(色~channel, ~alpha~channelどちらも平均をとる
26532652
</li>
26542653
</ul>
26552654

0 commit comments

Comments
 (0)