Operations¶
-
hv_hs_image_t *hv_hs_image_add(hv_hs_image_t const *a, hv_hs_image_t const *b)¶
Adds two images together.
- Parameters:
a – First image.
b – Second image.
- Returns:
Image containing the sum.
-
hv_hs_image_t *hv_hs_image_as_dtype(hv_hs_image_t const *image, hv_dtype_t dtype)¶
Converts the image to a different data type.
- Parameters:
image – Reference to the image.
dtype – Target data type.
- Returns:
Image with converted data type.
-
hv_hs_image_t *hv_hs_image_binning(hv_hs_image_t const *image, size_t bin_size, hv_axis_t axis)¶
Performs binning along the specified axis.
- Parameters:
image – Reference to the image.
bin_size – Size of each bin.
axis – Axis along which to bin.
- Returns:
Image after binning.
-
hv_hs_image_t *hv_hs_image_clip(hv_hs_image_t const *image, float min, float max)¶
Clips the image values to the specified range.
- Parameters:
image – Reference to the image.
min – Minimum value.
max – Maximum value.
- Returns:
Clipped image.
-
hv_hs_image_t *hv_hs_image_div(hv_hs_image_t const *a, hv_hs_image_t const *b)¶
Divides the first image by the second.
- Parameters:
a – First image.
b – Second image.
- Returns:
Image containing the quotient.
-
hv_hs_image_t *hv_hs_image_dot(hv_hs_image_t const *image, hv_array_t *operand, hv_axis_t axis)¶
Computes the dot product of the image with the given operand along the specified axis.
- Parameters:
image – Reference to the image.
operand – Operand array for the dot product.
axis – Axis along which to compute the dot product.
- Returns:
Image containing the dot product result.
-
int32_t hv_hs_image_ensure_dtype(hv_hs_image_t const *image, hv_dtype_t dtype, hv_hs_image_t **image_out)¶
Converts the image to a different data type if necessary.
- Parameters:
image – Reference to the image.
dtype – Target data type.
image_out – Output parameter for the resulting image.
- Return values:
0 – Ok
nonzero – Error
-
hv_hs_image_t *hv_hs_image_mean_axis(hv_hs_image_t const *image, hv_axis_t axis)¶
Computes the mean along the specified axis.
- Parameters:
image – Reference to the image.
axis – Axis along which to compute the mean.
- Returns:
Image containing the mean values.
-
hv_hs_image_t *hv_hs_image_mul(hv_hs_image_t const *a, hv_hs_image_t const *b)¶
Multiplies two images together.
- Parameters:
a – First image.
b – Second image.
- Returns:
Image containing the product.
-
hv_hs_image_t *hv_hs_image_nan_to_num(hv_hs_image_t const *image, double num)¶
Replaces NaN values in the image with the specified number.
- Parameters:
image – Reference to the image.
num – Value to replace NaNs with.
- Returns:
Image with NaNs replaced.
-
hv_hs_image_t *hv_hs_image_op(hv_hs_image_t const *image, ArcDynFn1_hv_array_ptr_hv_array_ptr_t op)¶
Applies a custom operation to each plane via callback and returns a new DynamicHSImage.
- Parameters:
image – Reference to the image.
op – Callback that accepts a plane (HVArray) and returns a transformed plane (HVArray).
- Returns:
Image resulting from applying the callback operation lazily.
-
hv_hs_image_t *hv_hs_image_rem(hv_hs_image_t const *_a, hv_hs_image_t const *_b)¶
Remainder operation between two images (not implemented).
- Parameters:
_a – First image.
_b – Second image.
- Returns:
Not implemented; will panic.
-
hv_hs_image_t *hv_hs_image_select(hv_hs_image_t const *image, hv_array_t *indices)¶
Selects elements from the image using the provided indices.
- Parameters:
image – Reference to the image.
indices – Boxed array of indices.
- Returns:
Image containing the selected elements.
-
int32_t hv_hs_image_select_mask(hv_hs_image_t const *image_in, hv_array_t *mask, hv_hs_image_t **image_out)¶
Selects elements from the image using a boolean mask.
- Parameters:
image_in – Reference to the image.
mask – Boxed array representing the mask.
image_out – Output parameter for the resulting image.
- Return values:
0 – Ok
nonzero – Error
-
hv_hs_image_t *hv_hs_image_slice(hv_hs_image_t const *image, hv_slice_desc_t desc)¶
Returns a sliced view of the image as a new DynamicHSImage.
- Parameters:
image – Reference to the image.
desc – Slice descriptor specifying the region.
- Returns:
Sliced image.
-
hv_hs_image_t *hv_hs_image_std_axis(hv_hs_image_t const *image, hv_axis_t axis)¶
Computes the standard deviation along the specified axis.
- Parameters:
image – Reference to the image.
axis – Axis along which to compute the standard deviation.
- Returns:
Image containing the standard deviation values.
-
hv_hs_image_t *hv_hs_image_sub(hv_hs_image_t const *a, hv_hs_image_t const *b)¶
Subtracts the second image from the first.
- Parameters:
a – First image.
b – Second image.
- Returns:
Image containing the difference.
-
hv_hs_image_t *hv_hs_image_sum_axis(hv_hs_image_t const *image, hv_axis_t axis)¶
Computes the sum along the specified axis.
- Parameters:
image – Reference to the image.
axis – Axis along which to compute the sum.
- Returns:
Image containing the sum values.
-
hv_hs_image_t *hv_hs_image_to_interleave(hv_hs_image_t const *image, hv_interleave_t interleave, size_t block_size)¶
Converts the image to the specified interleave format.
- Parameters:
image – Reference to the image.
interleave – Target interleave format.
block_size – Block size for conversion.
- Returns:
Image with new interleave format.
-
hv_hs_image_t *hv_hs_image_var_axis(hv_hs_image_t const *image, hv_axis_t axis)¶
Computes the variance along the specified axis.
- Parameters:
image – Reference to the image.
axis – Axis along which to compute the variance.
- Returns:
Image containing the variance values.
-
hv_hs_image_t *hv_hs_image_with_header(hv_hs_image_t const *image, hv_hsi_header_t *header)¶
Returns a new image with the specified header.
- Parameters:
image – Reference to the image.
header – Boxed header to apply.
- Returns:
Image with updated header.
-
struct ArcDynFn1_hv_array_ptr_hv_array_ptr¶
Arc<dyn Send + Sync + Fn(A1) -> Ret>Public Members
-
void *env_ptr¶
<No documentation available>
-
hv_array_t *(*call)(void*, hv_array_t*)¶
<No documentation available>
-
void (*release)(void*)¶
<No documentation available>
-
void (*retain)(void*)¶
<No documentation available>
-
void *env_ptr¶