Get Pixel Value from Grid
get_pixel.RdRetrieves the value at a given position, handling boundary conditions.
Examples
grid <- initialize_grid(10)
#> INFO [2026-02-03 16:36:05] Initializing grid of size 10x10
get_pixel(grid, c(5, 5)) # 1 (center is black)
#> [1] 1
get_pixel(grid, c(0, 5)) # NA (out of bounds with terminate)
#> [1] NA
get_pixel(grid, c(0, 5), boundary = "wrap") # Value from wrapped position
#> [1] 0