#include "tensorstore/index_space/index_transform.h"
absl::Status tensorstore::PropagateInputDomainResizeToOutput(
    
IndexTransformView<> transform,
    
span<const Index> requested_input_inclusive_min,
    
span<const Index> requested_input_exclusive_max,
    
bool can_resize_tied_bounds,
    
span<Index> output_inclusive_min_constraint,
    
span<Index> output_exclusive_max_constraint,
    
span<Index> new_output_inclusive_min,
    
span<Index> new_output_exclusive_max,
    
boolis_noop);

Propagates a resize request on the input domain to the output space.

Parameters:
IndexTransformView<> transform

The index transform.

span<const Index> requested_input_inclusive_min

Requested new inclusive min bounds on the input domain. A bound of kImplicit indicates no change.

span<const Index> requested_input_exclusive_max

Requested new exclusive max bounds on the input domain. A bound of kImplicit indicates no change.

bool can_resize_tied_bounds

If true, fails if the resize would potentially affect any positions not within the output range of transform.

out
span<Index> output_inclusive_min_constraint

Set to constraints on the inclusive_min bounds of the output space that must be satisfied in order for the resize to not affect positions outside the output range of transform. Each value not equal to kImplicit must match the corresponding existing IndexInterval::inclusive_min bound. If can_resize_tied_bounds == true, all values are set equal kImplicit.

out
span<Index> output_exclusive_max_constraint

Set to constraints on the exclusive_max bounds of the output space that must be satisfied in order for the resize to not affect positions outside the output range of transform. Each value not equal to kImplicit must match the corresponding existing IndexInterval::exclusive_min bound. If can_resize_tied_bounds == true, all values are set equal kImplicit.

out
span<Index> new_output_inclusive_min

Set to the new IndexInterval::inclusive_min bounds for the output space. A bound of kImplicit indicates no change.

out
span<Index> new_output_inclusive_min

Set to the new IndexInterval::exclusive_max bounds for the output space. A bound of kImplicit indicates no change.

out
bool *is_noop

Must be non-null. Upon successful return, *is_noop is set to true if all bounds in new_output_inclusive_min and new_output_exclusive_max are kImplicit, and is set to false otherwise.

Returns:

absl::Status() on success.

Error absl::StatusCode::kFailedPrecondition:

if can_resize_tied_bounds == false and the resize would affect positions outside the range of transform.

Error absl::StatusCode::kInvalidArgument:

if the requested bound are invalid or incompatible with transform.

Error absl::StatusCode::kInvalidArgument:

if integer overflow occurs.