* Gets the color of the pixel in the center of a cell. * @param ctx The test context. * @param col The 1-based column index to get the color for. * @param row The 1-based row index to get the color for.
(ctx: ITestContext, col: number, row: number, position: CellColorPosition = CellColorPosition.CENTER)
| 1400 | * @param row The 1-based row index to get the color for. |
| 1401 | */ |
| 1402 | async function getCellColor(ctx: ITestContext, col: number, row: number, position: CellColorPosition = CellColorPosition.CENTER): Promise<[red: number, green: number, blue: number, alpha: number]> { |
| 1403 | if (!frameDetails) { |
| 1404 | frameDetails = await getFrameDetails(ctx); |
| 1405 | } |
| 1406 | switch (position) { |
| 1407 | case CellColorPosition.CENTER: |
| 1408 | return getCellColorInner(frameDetails, col, row); |
| 1409 | case CellColorPosition.FIRST: |
| 1410 | return getCellColorFirstPoint(frameDetails, col, row); |
| 1411 | } |
| 1412 | } |
| 1413 | |
| 1414 | let frameDetails: { cols: number, rows: number, decoded: IImage32 } | undefined = undefined; |
| 1415 | async function getFrameDetails(ctx: ITestContext): Promise<{ cols: number, rows: number, decoded: IImage32 }> { |
no test coverage detected