diff options
-rw-r--r-- | transfer.c | 4 | ||||
-rw-r--r-- | transfer.h | 6 |
2 files changed, 8 insertions, 2 deletions
@@ -425,8 +425,8 @@ int mg2di_gt_init(GridTransferContext *ctx) ctx->src.size[i] < 2 || ctx->dst.size[i] < 1) return -EINVAL; - src_start = ctx->src.start[i] * ctx->src.step[i]; - src_end = (ctx->src.start[i] + ctx->src.size[i] - 1) * ctx->src.step[i]; + src_start = ctx->src.start[i] * ctx->src.step[i] - ctx->extrapolate_distance; + src_end = (ctx->src.start[i] + ctx->src.size[i] - 1 + ctx->extrapolate_distance) * ctx->src.step[i]; dst_start = ctx->dst.start[i] * ctx->dst.step[i]; dst_end = (ctx->dst.start[i] + ctx->dst.size[i] - 1) * ctx->dst.step[i]; @@ -85,6 +85,12 @@ typedef struct GridTransferContext { * Destination grid geometry, must be filled by the caller. */ RegularGrid2D dst; + + /** + * Allow extrapolating this many points beyond the source rectangle. + * Defaults to 0: forbid extrapolation. + */ + int extrapolate_distance; } GridTransferContext; /** |