(format: VideoPixelFormat | null, rect: DOMRectInit)
| 717 | }; |
| 718 | |
| 719 | const VerifyRectOffsetAlignment = (format: VideoPixelFormat | null, rect: DOMRectInit): boolean => { |
| 720 | // 1. If format is null, return true. |
| 721 | if (format === null) return true; |
| 722 | |
| 723 | const info = getPixelFormatInfo(format); |
| 724 | if (!info) return false; |
| 725 | |
| 726 | // 2. Let planeIndex be 0. |
| 727 | // 3. Let numPlanes be the number of planes as defined by format. |
| 728 | // 4. While planeIndex is less than numPlanes: |
| 729 | for (let planeIndex = 0; planeIndex < info.planes.length; planeIndex++) { |
| 730 | const plane = info.planes[planeIndex]; |
| 731 | const sampleWidth = plane.sampleWidth; |
| 732 | const sampleHeight = plane.sampleHeight; |
| 733 | |
| 734 | // If rect.x is not a multiple of sampleWidth, return false. |
| 735 | if ((rect.x || 0) % sampleWidth !== 0) return false; |
| 736 | // If rect.y is not a multiple of sampleHeight, return false. |
| 737 | if ((rect.y || 0) % sampleHeight !== 0) return false; |
| 738 | } |
| 739 | |
| 740 | return true; |
| 741 | }; |
| 742 | |
| 743 | const ComputeLayoutAndAllocationSize = ( |
| 744 | parsedRect: DOMRectInit, |
no test coverage detected