Grid Tile Linear Address
Compute row-major tile index with edge tiles retained and explicit grid/tile dimensions; no padded cell address is inferred.
Description
Compute row-major tile index with edge tiles retained and explicit grid/tile dimensions; no padded cell address is inferred.
A tiled grid can address its tiles in row-major order, including partial tiles along the outer edges.
When to use this tool
Compute row-major tile index with edge tiles retained and explicit grid/tile dimensions; no padded cell address is inferred.
- Prepare the supplied row, column, rows, columns, tileRows, tileColumns fields for this operation.
- Compare the complete example with the representation used by your own input before carrying the result into another step.
How to use the tool and how it works
- Enter row, column, rows, columns, tileRows, tileColumns. Use the exact text syntax, units and index conventions explained below.
- Run the tool. If input validation fails, correct the supplied fields before interpreting any result.
- Read result.tileIndex, result.tileColumnCount. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Validate an in-bounds row/column and positive tile dimensions. tileColumnCount=ceil(columns/tileColumns); tileIndex=floor(row/tileRows)*tileColumnCount+floor(column/tileColumns), requiring a safe integer result.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| row | row. | Integer from 0 to rows - 1 inclusive |
| column | column. | Integer from 0 to columns - 1 inclusive |
| rows | rows. | Integer from 1 to 1e9 inclusive |
| columns | columns. | Integer from 1 to 1e9 inclusive |
| tileRows | tile rows. | Integer from 1 to 1e9 inclusive |
| tileColumns | tile columns. | Integer from 1 to 1e9 inclusive |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.tileIndex | The tile index value under the stated formula or text convention. |
| result.tileColumnCount | The tile column count value under the stated formula or text convention. |
{
"input": {
"row": 5,
"column": 7,
"rows": 6,
"columns": 8,
"tileRows": 2,
"tileColumns": 3
},
"output": {
"result": {
"tileIndex": 8,
"tileColumnCount": 3
}
}
} Limitations and assumptions
- This is a tile index rather than a byte offset or within-tile coordinate. No physical memory layout or image file is inspected.
- Coordinate pairs use [row,column] where stated. Masks are nonempty rectangular zero/one matrices of at most 128 rows, 128 columns and 16,384 cells; outside-mask values are unset for the neighborhood operations.
- Every declared top-level field is required and unexpected fields are rejected. Numeric inputs must be finite; ordinary text fields are bounded to 8,192 UTF-16 code units, with tighter operation-specific limits where stated.
- String lists have at most 128 entries of at most 128 code units; matrices have at most 128 rows and columns. Larger numeric lists and parsed JSON have separate bounded budgets. Nonfinite results and excessively large serialized outputs are rejected.
- Indexes are zero-based and spans have an exclusive end unless explicitly stated otherwise. A valid false, null or empty-list result is distinct from malformed input.
Alternative or Complementary methods
Keep row/column coordinates distinct from x/y pairs and byte offsets. Select the neighborhood metric, outside-mask rule and storage-order convention explicitly; these operations do not infer an image format.
References
Similar or alternative tools
- Grid Tile Address
Decode zero-based grid coordinates into rectangular tile coordinates and local offsets; no bounds or storage order is inferred.
- Grid Border Ring Indexes
List row-major cell indexes in an exact inward border ring; out-of-grid layers produce no cells.