Slicing

typedef struct hv_slice_range hv_slice_range_t

C-compatible representation of a range slice element.

Fields:

  • start:

  • end: The ending index of the range (exclusive). If negative, the range is open-ended.

  • step: The step size between elements in the range.

typedef struct hv_slice_elem hv_slice_elem_t

C-compatible representation of a slice element.

typedef struct hv_slice_desc hv_slice_desc_t

C-compatible representation of a slice descriptor for three axes.

Fields:

  • lines: Slice element for the lines axis.

  • samples: Slice element for the samples axis.

  • bands: Slice element for the bands axis.

hv_slice_elem_t hv_slice_elem_new_index(uint64_t index)

Creates a new HVSliceElem representing a single index.

Parameters:

index – The index to select.

Returns:

an hv_slice_elem_t with the given index and default range.

hv_slice_elem_t hv_slice_elem_new_range(uint64_t start, int64_t end, uint64_t step)

Creates a new HVSliceElem representing a range.

Parameters:
  • start – The starting index of the range (inclusive).

  • end – The ending index of the range (exclusive). If negative, the range is open-ended.

  • step – The step size between elements in the range.

Returns:

an hv_slice_elem_t with the specified range and an invalid index.

struct hv_slice_range
#include <hv-sdk.h>

C-compatible representation of a range slice element.

Fields:

  • start:

  • end: The ending index of the range (exclusive). If negative, the range is open-ended.

  • step: The step size between elements in the range.

Public Members

uint64_t start

The starting index of the range (inclusive).

int64_t end

<No documentation available>

uint64_t step

<No documentation available>

struct hv_slice_elem
#include <hv-sdk.h>

C-compatible representation of a slice element.

Public Members

int64_t index

If non-negative, represents a single index.

If negative, use range.

hv_slice_range_t range

Range information if index is negative.

struct hv_slice_desc
#include <hv-sdk.h>

C-compatible representation of a slice descriptor for three axes.

Fields:

  • lines: Slice element for the lines axis.

  • samples: Slice element for the samples axis.

  • bands: Slice element for the bands axis.

Public Members

hv_slice_elem_t lines

<No documentation available>

hv_slice_elem_t samples

<No documentation available>

hv_slice_elem_t bands

<No documentation available>