#include "tensorstore/index_interval.h"
Result<IndexInterval>
tensorstore::ShiftIntervalTo(IndexInterval intervalIndex origin);

Shifts interval.inclusive_min() to origin.

The size is preserved, unless interval.inclusive_min() == kInfIndex.

Parameters:
IndexInterval interval

The existing interval to shift.

Index origin

The new inclusive_min value.

Returns:

The shifted interval.

Error absl::StatusCode::kInvalidArgument:

if interval.inclusive_min() == -kInfIndex. error absl::StatusCode::kOutOfRange if origin is outside [kMinFiniteIndex, kMaxFiniteIndex].

Error absl::StatusCode::kInvalidArgument:

if the resultant inclusive_max value would be outside the valid range.