28 #ifndef GRAFEO_ARRAY_H
29 #define GRAFEO_ARRAY_H
31 #include <grafeo/type.h>
51 unsigned char* data_uint8;
52 uint16_t* data_uint16;
53 uint32_t* data_uint32;
54 uint64_t* data_uint64;
61 unsigned int* data_int;
111 Array*
array_new_4D(uint32_t size1, uint32_t size2, uint32_t size3, uint32_t size4);
140 Array* array_zeros(uint16_t dim, uint32_t* sizes, DataType type);
149 Array* array_ones(uint16_t dim, uint32_t* sizes, DataType type);
uint16_t dim
Definition: array.h:44
Array * array_new_3D_type(uint32_t size1, uint32_t size2, uint32_t size3, DataType type)
Create a 3D array (each elem: sizeof(elementsize) bytes)
size_t num_bytes
Definition: array.h:47
void array_fill(Array *array, double value)
uint16_t array_get_dim(Array *array)
Get number of dimensions of an array.
uint64_t num_elements
Definition: array.h:46
Array * array_new_with_dim(uint16_t dim)
Create a new array: structure and space for size, without allocating data and defining sizes...
Array * array_new_4D(uint32_t size1, uint32_t size2, uint32_t size3, uint32_t size4)
Create a 4D array.
Array * array_new_with_size_type(uint16_t dim, uint32_t *size, DataType type)
Create a new array with size and allocated data, without value.
Array * array_new_2D_type(uint32_t size1, uint32_t size2, DataType type)
Create a 2D array (each elem: sizeof(elementsize) bytes)
Array * array_new_1D(uint32_t size1)
Create a 1D array.
uint32_t * size
Definition: array.h:45
uint32_t * array_get_size(Array *array)
Get vector of sizes of each dimension of the array.
Array * array_new_2D(uint32_t size1, uint32_t size2)
Create a 2D array.
Array * array_new_4D_type(uint32_t size1, uint32_t size2, uint32_t size3, uint32_t size4, DataType type)
Create a 4D array (each elem: sizeof(elementsize) bytes)
DataType array_get_type(Array *array)
Get data type of the array.
Array * array_new_1D_type(uint32_t size1, DataType type)
Create a 1D array (each elem: sizeof(elementsize) bytes)
void array_free(Array *array)
Free array memory.
Array * array_new_3D(uint32_t size1, uint32_t size2, uint32_t size3)
Create a 3D array.
Array * array_new_with_size(uint16_t dim, uint32_t *size)
Create a new array with size (sizeof(char) bytes) and allocated data, without value.
Array * array_new()
Create a new array: just the structure, without allocating data and size.
void * array_get_data(Array *array)
Get data vector of array.
uint64_t array_get_num_elements(Array *array)
Get total number of elements of an array.
DataType type
Definition: array.h:48