57enum { P26_MAX_NDIM = 3 };
103 p26_index *pixel_count,
size_t *byte_count);
p26_index p26_ds(const p26_image *img)
Depth size: number of pixels along z (Pink's depth); 1 for a 2D image.
p26_status p26_image_alloc(int ndim, const p26_index *shape, p26_dtype dtype, p26_image **out)
Allocates an image whose pixels are all zero.
p26_status p26_image_wrap(int ndim, const p26_index *shape, p26_dtype dtype, void *data, p26_image **out)
Creates an image descriptor over pixels owned by the caller (no copy).
size_t p26_dtype_size(p26_dtype dtype)
Size in bytes of one pixel of the given type.
p26_status p26_image_validate(const p26_image *img)
Checks that a caller-supplied image descriptor can be used safely.
p26_index p26_rs(const p26_image *img)
Row size: number of pixels along x (Pink's rowsize).
p26_index p26_cs(const p26_image *img)
Column size: number of pixels along y (Pink's colsize).
p26_status p26_checked_count(int ndim, const p26_index *shape, p26_dtype dtype, p26_index *pixel_count, size_t *byte_count)
Validates an image geometry and computes its pixel and byte counts.
p26_dtype
Pixel type.
Definition image.h:60
@ P26_U8
uint8_t (VFF_TYP_1_BYTE)
Definition image.h:61
@ P26_F64
double (VFF_TYP_DOUBLE)
Definition image.h:64
@ P26_F32
float (VFF_TYP_FLOAT)
Definition image.h:63
@ P26_I32
int32_t (VFF_TYP_4_BYTE)
Definition image.h:62
void p26_image_free(p26_image *img)
Releases an image descriptor, and its pixels if it owns them.
Status codes and error messages.
p26_status
Result of a pink26 function.
Definition status.h:75
int64_t p26_index
Pixel index or size in pixels (64-bit, so large 3D images fit).
Definition status.h:72
A 2D or 3D image.
Definition image.h:68
p26_index shape[P26_MAX_NDIM]
2D: (cs, rs, 1); 3D: (ds, cs, rs).
Definition image.h:70
p26_dtype dtype
Pixel type.
Definition image.h:71
int owns_data
1 if p26_image_free() releases data.
Definition image.h:73
int ndim
2 or 3.
Definition image.h:69
void * data
Pixels, C-contiguous, x fastest.
Definition image.h:72
double voxel[P26_MAX_NDIM]
Voxel size along x, y, z; 1.0 by default.
Definition image.h:74