OpenJPEG  2.3.1
Typedefs | Functions
sparse_array.h File Reference

Sparse array management. More...

#include "opj_includes.h"

Go to the source code of this file.

Typedefs

typedef struct opj_sparse_array_int32 opj_sparse_array_int32_t
 Opaque type for sparse arrays that contain int32 values. More...
 

Functions

opj_sparse_array_int32_topj_sparse_array_int32_create (OPJ_UINT32 width, OPJ_UINT32 height, OPJ_UINT32 block_width, OPJ_UINT32 block_height)
 Creates a new sparse array. More...
 
void opj_sparse_array_int32_free (opj_sparse_array_int32_t *sa)
 Frees a sparse array. More...
 
OPJ_BOOL opj_sparse_array_is_region_valid (const opj_sparse_array_int32_t *sa, OPJ_UINT32 x0, OPJ_UINT32 y0, OPJ_UINT32 x1, OPJ_UINT32 y1)
 Returns whether region bounds are valid (non empty and within array bounds) More...
 
OPJ_BOOL opj_sparse_array_int32_read (const opj_sparse_array_int32_t *sa, OPJ_UINT32 x0, OPJ_UINT32 y0, OPJ_UINT32 x1, OPJ_UINT32 y1, OPJ_INT32 *dest, OPJ_UINT32 dest_col_stride, OPJ_UINT32 dest_line_stride, OPJ_BOOL forgiving)
 Read the content of a rectangular region of the sparse array into a user buffer. More...
 
OPJ_BOOL opj_sparse_array_int32_write (opj_sparse_array_int32_t *sa, OPJ_UINT32 x0, OPJ_UINT32 y0, OPJ_UINT32 x1, OPJ_UINT32 y1, const OPJ_INT32 *src, OPJ_UINT32 src_col_stride, OPJ_UINT32 src_line_stride, OPJ_BOOL forgiving)
 Write the content of a rectangular region into the sparse array from a user buffer. More...
 

Detailed Description

Sparse array management.

The functions in this file manage sparse arrays. Sparse arrays are arrays with potential big dimensions, but with very few samples actually set. Such sparse arrays require allocating a low amount of memory, by just allocating memory for blocks of the array that are set. The minimum memory allocation unit is a a block. There is a trade-off to pick up an appropriate dimension for blocks. If it is too big, and pixels set are far from each other, too much memory will be used. If blocks are too small, the book-keeping costs of blocks will raise.