There is no guarantee that a client implementing IGrid<T> does actually use an 2D array T[,] for the implementation. So without changing something, you cannot expect to make your extension library work "out of the box" on IGrid<T>. IMHO you have the following options:
change (or extend) the interface of your
Transformationclass to useIGrid<T>as input instead ofT[,]extend
IGrid<T>to provide access to underlyingT[,], with the drawback of loosing immutability (which forces any client to use aT[,]internally)write a conversion method from
IGrid<T>toT[,](note that this will imply making additional copies of the data).
Note that for big arrays, immutability maybe not the optimal design for your transformation operations, without immutability they could be implemented in-place, which is sometimes the better alternative, since it is less memory consuming. Note further that if you want your transformation methods work on something like an Heightmap class, they cannot deliver a new Heightmap object directly, you will have to do some type conversion either. An in-place transformation would not have that problem, it could operate on the internal T[,] of the Heightmap object directly.