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