Grid Crop Coordinate Map
Map source grid coordinates into a half-open crop and retain excluded-coordinate evidence instead of silently clipping.
Description
Map source grid coordinates into a half-open crop and retain excluded-coordinate evidence instead of silently clipping.
A crop changes coordinate origin and excludes positions outside the selected rectangle.
When to use this tool
Map source grid coordinates into a half-open crop and retain excluded-coordinate evidence instead of silently clipping.
- Prepare the supplied coordinates, cropTop, cropLeft, cropRows, cropColumns 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 coordinates, cropTop, cropLeft, cropRows, cropColumns. 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.mapping. Interpret false, null and empty lists using the distinctions below; they can be valid outputs.
Validate nonnegative integer source pairs, crop origin and positive crop dimensions. Subtract cropTop/cropLeft and test each result against zero-inclusive, size-exclusive bounds. Return inside with local row/column or null coordinates.1
| Input field | Meaning and representation | Accepted input |
|---|---|---|
| coordinates | coordinates. | Numeric rows; at most 128 rows and 128 values per row |
| cropTop | crop top. | Finite number |
| cropLeft | crop left. | Finite number |
| cropRows | crop rows. | Finite number |
| cropColumns | crop columns. | Finite number |
| Output field | Interpretation |
|---|---|
| result | Object containing the named outputs below. |
| result.mapping | The mapping list in the ordering and representation described above. |
{
"input": {
"coordinates": [
[
2,
3
],
[
0,
0
]
],
"cropTop": 1,
"cropLeft": 2,
"cropRows": 3,
"cropColumns": 3
},
"output": {
"result": {
"mapping": [
{
"inside": true,
"row": 1,
"column": 1
},
{
"inside": false,
"row": null,
"column": null
}
]
}
}
} Limitations and assumptions
- Output records remain aligned with input pairs. No grid data is cropped or out-of-range source coordinate clamped.
- 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 Padding Coordinate Map
Translate source grid coordinates after explicit top/left padding; no inferred original or padded dimensions.
- Grid Diagonal Coordinate List
List coordinates on the grid diagonal column−row=offset in ascending row order; no square-grid assumption.