#include "tensorstore/index_interval.h"
Result<IndexInterval>
tensorstore::GetAffineTransformDomain(IndexInterval interval,
                                      
Index offset,
                                      
Index divisor);

Computes the largest possible domain such that the affine-transformed range is contained within interval.

Specifically, subtracts offset from the lower and upper bounds of interval and then divides the bounds by divisor, rounding towards the interior of the interval.

A bound of -kInfIndex or kInfIndex is not affected by subtraction or division.

Dchecks:

divisor != 0

Parameters:
IndexInterval interval

The range of the affine transform.

Index offset

The offset of the affine transform.

Index divisor

The multiplier of the affine transform.

Returns:

The domain interval.

Error absl::StatusCode::kInvalidArgument:

if the domain would overflow.