|
4091 | 4091 | subsample for |plane|.
|
4092 | 4092 | 4. Let |sampleHeight| be the vertical [=sub-sampling factor=] of each
|
4093 | 4093 | subsample for |plane|.
|
4094 |
| - 5. Let |sampleWidthBytes| be the product of multiplying |sampleWidth| by |
4095 |
| - |sampleBytes|. |
4096 |
| - 6. Let |computedLayout| be a new [=computed plane layout=]. |
4097 |
| - 7. Set |computedLayout|'s [=computed plane layout/sourceTop=] to the |
| 4094 | + 5. Let |computedLayout| be a new [=computed plane layout=]. |
| 4095 | + 6. Set |computedLayout|'s [=computed plane layout/sourceTop=] to the |
4098 | 4096 | result of the division of truncated |parsedRect|.{{DOMRectInit/y}}
|
4099 | 4097 | by |sampleHeight|, rounded up to the nearest integer.
|
4100 |
| - 8. Set |computedLayout|'s [=computed plane layout/sourceHeight=] to the |
| 4098 | + 7. Set |computedLayout|'s [=computed plane layout/sourceHeight=] to the |
4101 | 4099 | result of the division of truncated
|
4102 | 4100 | |parsedRect|.{{DOMRectInit/height}} by |sampleHeight|, rounded up
|
4103 | 4101 | to the nearest integer.
|
4104 |
| - 9. Set |computedLayout|'s [=computed plane layout/sourceLeftBytes=] to |
| 4102 | + 8. Set |computedLayout|'s [=computed plane layout/sourceLeftBytes=] to |
4105 | 4103 | the result of the integer division of
|
4106 | 4104 | truncated |parsedRect|.{{DOMRectInit/x}} by |sampleWidth|,
|
4107 | 4105 | multiplied by |sampleBytes|.
|
4108 |
| - 10. Set |computedLayout|'s [=computed plane layout/sourceWidthBytes=] to |
| 4106 | + 9. Set |computedLayout|'s [=computed plane layout/sourceWidthBytes=] to |
4109 | 4107 | the result of the integer division of
|
4110 | 4108 | truncated |parsedRect|.{{DOMRectInit/width}} by |sampleHeight|,
|
4111 | 4109 | multiplied by |sampleBytes|.
|
4112 |
| - 11. If |layout| is not `undefined`: |
| 4110 | + 10. If |layout| is not `undefined`: |
4113 | 4111 | 1. Let |planeLayout| be the {{PlaneLayout}} in |layout| at position
|
4114 | 4112 | |planeIndex|.
|
4115 | 4113 | 2. If |planeLayout|.{{PlaneLayout/stride}} is less than
|
|
4119 | 4117 | [=computed plane layout/destinationOffset=].
|
4120 | 4118 | 4. Assign |planeLayout|.{{PlaneLayout/stride}} to |computedLayout|'s
|
4121 | 4119 | [=computed plane layout/destinationStride=].
|
4122 |
| - 12. Otherwise: |
| 4120 | + 11. Otherwise: |
4123 | 4121 |
|
4124 | 4122 | NOTE: If an explicit layout was not provided, the following steps
|
4125 | 4123 | default to tight packing.
|
|
4129 | 4127 | 2. Assign |computedLayout|'s
|
4130 | 4128 | [=computed plane layout/sourceWidthBytes=] to
|
4131 | 4129 | |computedLayout|'s [=computed plane layout/destinationStride=].
|
4132 |
| - 13. Let |planeSize| be the product of multiplying |computedLayout|'s |
| 4130 | + 12. Let |planeSize| be the product of multiplying |computedLayout|'s |
4133 | 4131 | [=computed plane layout/destinationStride=] and
|
4134 | 4132 | [=computed plane layout/sourceHeight=].
|
4135 |
| - 14. Let |planeEnd| be the sum of |planeSize| and |computedLayout|'s |
| 4133 | + 13. Let |planeEnd| be the sum of |planeSize| and |computedLayout|'s |
4136 | 4134 | [=computed plane layout/destinationOffset=].
|
4137 |
| - 15. If |planeSize| or |planeEnd| is greater than maximum range of |
| 4135 | + 14. If |planeSize| or |planeEnd| is greater than maximum range of |
4138 | 4136 | {{unsigned long}}, return a {{TypeError}}.
|
4139 |
| - 16. Append |planeEnd| to |endOffsets|. |
4140 |
| - 17. Assign the maximum of |minAllocationSize| and |planeEnd| to |
| 4137 | + 15. Append |planeEnd| to |endOffsets|. |
| 4138 | + 16. Assign the maximum of |minAllocationSize| and |planeEnd| to |
4141 | 4139 | |minAllocationSize|.
|
4142 | 4140 |
|
4143 | 4141 | NOTE: The above step uses a maximum to allow for the
|
4144 | 4142 | possibility that user specified plane offsets reorder
|
4145 | 4143 | planes.
|
4146 | 4144 |
|
4147 |
| - 18. Let |earlierPlaneIndex| be `0`. |
4148 |
| - 19. While |earlierPlaneIndex| is less than |planeIndex|. |
| 4145 | + 17. Let |earlierPlaneIndex| be `0`. |
| 4146 | + 18. While |earlierPlaneIndex| is less than |planeIndex|. |
4149 | 4147 | 1. Let |earlierLayout| be `computedLayouts[earlierPlaneIndex]`.
|
4150 | 4148 | 2. If `endOffsets[planeIndex]` is less than or equal to
|
4151 | 4149 | |earlierLayout|'s [=computed plane layout/destinationOffset=] or
|
|
4158 | 4156 |
|
4159 | 4157 | 3. Otherwise, return a {{TypeError}}.
|
4160 | 4158 | 4. Increment |earlierPlaneIndex| by `1`.
|
4161 |
| - 20. Append |computedLayout| to |computedLayouts|. |
4162 |
| - 21. Increment |planeIndex| by `1`. |
| 4159 | + 19. Append |computedLayout| to |computedLayouts|. |
| 4160 | + 20. Increment |planeIndex| by `1`. |
4163 | 4161 | 8. Let |combinedLayout| be a new [=combined buffer layout=], initialized as
|
4164 | 4162 | follows:
|
4165 | 4163 | 1. Assign |computedLayouts| to
|
|
0 commit comments