JasPer 4.2.8 |

Loading...
Searching...
No Matches
One- and Two-Dimensional Sequences

One- and Two-Dimensional Sequences. More...

## Classes
struct | jas_matrix_t
| Matrix type. More...
struct | jas_seq2d_t
| Two-dimensional sequence type. More...
struct | jas_seq_t
| One-dimensional sequence type. More...

## Functions
static JAS_ATTRIBUTE_PURE jas_matind_t | jas_matrix_numrows (const jas_matrix_t *matrix)
| Get the number of rows in a matrix.
static JAS_ATTRIBUTE_PURE jas_matind_t | jas_matrix_numcols (const jas_matrix_t *matrix)
| Get the number of columns in a matrix.
static JAS_ATTRIBUTE_PURE jas_matind_t | jas_matrix_size (const jas_matrix_t *matrix)
| Get the number of elements in a matrix.
static JAS_ATTRIBUTE_PURE bool | jas_matrix_empty (const jas_matrix_t *matrix)
| Test if a matrix is empty (i.e., contains no elements).
static JAS_ATTRIBUTE_PURE jas_seqent_t | jas_matrix_get (const jas_matrix_t *matrix, jas_matind_t i, jas_matind_t j)
| Get a matrix element.
static void | jas_matrix_set (jas_matrix_t *matrix, jas_matind_t i, jas_matind_t j, jas_seqent_t v)
| Set a matrix element.
static JAS_ATTRIBUTE_PURE jas_seqent_t | jas_matrix_getv (const jas_matrix_t *matrix, jas_matind_t i)
| Get an element from a matrix that is known to be a row or column vector.
static void | jas_matrix_setv (jas_matrix_t *matrix, jas_matind_t i, jas_seqent_t v)
| Set an element in a matrix that is known to be a row or column vector.
static JAS_ATTRIBUTE_PURE jas_seqent_t * | jas_matrix_getref (const jas_matrix_t *matrix, jas_matind_t i, jas_matind_t j)
| Get the address of an element in a matrix.
static JAS_ATTRIBUTE_PURE jas_seqent_t * | jas_matrix_getvref (const jas_matrix_t *matrix, jas_matind_t i)
| Get a reference to a particular row of a 2-D sequence.
JAS_EXPORT jas_matrix_t * | jas_matrix_create (jas_matind_t numrows, jas_matind_t numcols)
| Create a matrix with the specified dimensions.
JAS_EXPORT void | jas_matrix_destroy (jas_matrix_t *matrix)
| Destroy a matrix.
JAS_EXPORT int | jas_matrix_resize (jas_matrix_t *matrix, jas_matind_t numrows, jas_matind_t numcols)
| Resize a matrix. The previous contents of the matrix are lost.
JAS_EXPORT int | jas_matrix_output (jas_matrix_t *matrix, FILE *out)
| Write a matrix to a C standard library stream.
JAS_EXPORT int | jas_matrix_bindsub (jas_matrix_t *mat0, jas_matrix_t *mat1, jas_matind_t r0, jas_matind_t c0, jas_matind_t r1, jas_matind_t c1)
| Create a matrix that references part of another matrix.
static int | jas_matrix_bindrow (jas_matrix_t *mat0, jas_matrix_t *mat1, jas_matind_t r)
| Create a matrix that is a reference to a row of another matrix.
static int | jas_matrix_bindcol (jas_matrix_t *mat0, jas_matrix_t *mat1, jas_matind_t c)
| Create a matrix that is a reference to a column of another matrix.
JAS_EXPORT void | jas_matrix_clip (jas_matrix_t *matrix, jas_seqent_t minval, jas_seqent_t maxval)
| Clip the values of matrix elements to the specified range.
JAS_EXPORT void | jas_matrix_asl (jas_matrix_t *matrix, unsigned n)
| Arithmetic shift left of all elements in a matrix.
JAS_EXPORT void | jas_matrix_asr (jas_matrix_t *matrix, unsigned n)
| Arithmetic shift right of all elements in a matrix.
JAS_EXPORT void | jas_matrix_divpow2 (jas_matrix_t *matrix, unsigned n)
| Almost-but-not-quite arithmetic shift right of all elements in a matrix.
JAS_EXPORT void | jas_matrix_setall (jas_matrix_t *matrix, jas_seqent_t val)
| Set all elements of a matrix to the specified value.
static JAS_ATTRIBUTE_PURE size_t | jas_matrix_rowstep (const jas_matrix_t *matrix)
| The spacing between rows of a matrix.
static JAS_ATTRIBUTE_PURE size_t | jas_matrix_step (const jas_matrix_t *matrix)
| The spacing between columns of a matrix.
JAS_EXPORT int | jas_matrix_cmp (jas_matrix_t *mat0, jas_matrix_t *mat1)
| Compare two matrices for equality.
JAS_EXPORT jas_matrix_t * | jas_matrix_copy (jas_matrix_t *x)
| Copy a matrix.
JAS_EXPORT jas_matrix_t * | jas_matrix_input (FILE *)
| Read a matrix from a C standard library stream.
JAS_EXPORT jas_seq2d_t * | jas_seq2d_copy (jas_seq2d_t *x)
| Copy a 2-D sequence.
JAS_EXPORT jas_matrix_t * | jas_seq2d_create (jas_matind_t xstart, jas_matind_t ystart, jas_matind_t xend, jas_matind_t yend)
| Create a 2-D sequence.
static void | jas_seq2d_destroy (jas_seq2d_t *s)
| Destroy a 2-D sequence.
static JAS_ATTRIBUTE_PURE jas_matind_t | jas_seq2d_xstart (const jas_seq2d_t *s)
| Get the starting x-coordinate of the sequence.
static JAS_ATTRIBUTE_PURE jas_matind_t | jas_seq2d_ystart (const jas_seq2d_t *s)
| Get the starting y-coordinate of the sequence.
static JAS_ATTRIBUTE_PURE jas_matind_t | jas_seq2d_xend (const jas_seq2d_t *s)
| Get the ending x-coordinate of the sequence.
static JAS_ATTRIBUTE_PURE jas_matind_t | jas_seq2d_yend (const jas_seq2d_t *s)
| Get the ending y-coordinate of the sequence.
static JAS_ATTRIBUTE_PURE jas_seqent_t * | jas_seq2d_getref (const jas_seq2d_t *s, jas_matind_t x, jas_matind_t y)
| Get a pointer (i.e., reference) to an element of a 2-D sequence.
static JAS_ATTRIBUTE_PURE jas_seqent_t | jas_seq2d_get (const jas_seq2d_t *s, jas_matind_t x, jas_matind_t y)
| Get an element of a 2-D sequence.
static JAS_ATTRIBUTE_PURE size_t | jas_seq2d_rowstep (const jas_seq2d_t *s)
| Get the stride between successive rows in the sequence.
static JAS_ATTRIBUTE_PURE unsigned | jas_seq2d_width (const jas_seq2d_t *s)
| Get the number of columns in the sequence.
static JAS_ATTRIBUTE_PURE unsigned | jas_seq2d_height (const jas_seq2d_t *s)
| Get the number of rows in the sequence.
static void | jas_seq2d_setshift (jas_seq2d_t *s, jas_matind_t x, jas_matind_t y)
| Set the shift (i.e., starting x- and y-coordinates) of the sequence.
static JAS_ATTRIBUTE_PURE jas_matind_t | jas_seq2d_size (const jas_seq2d_t *s)
| Get the number of elements in the sequence.
static JAS_ATTRIBUTE_PURE bool | jas_seq2d_empty (const jas_seq2d_t *s)
| Test if the sequence is empty (i.e., contains no elements).
JAS_EXPORT int | jas_seq2d_bindsub (jas_matrix_t *s, jas_matrix_t *s1, jas_matind_t xstart, jas_matind_t ystart, jas_matind_t xend, jas_matind_t yend)
| Initialize a sequence to reference a subsequence of another sequence.
static jas_seq_t * | jas_seq_create (jas_matind_t start, jas_matind_t end)
| Create a 1-D sequence.
static void | jas_seq_destroy (jas_seq_t *seq)
| Destroy a 1-D sequence.
static void | jas_seq_set (jas_seq_t *seq, jas_matind_t i, jas_seqent_t v)
| Set an element of a sequence.
static JAS_ATTRIBUTE_PURE jas_seqent_t * | jas_seq_getref (const jas_seq_t *seq, jas_matind_t i)
| Get a pointer (i.e., reference) to an element of a sequence.
static JAS_ATTRIBUTE_PURE jas_seqent_t | jas_seq_get (const jas_seq_t *seq, jas_matind_t i)
| Get an element of a sequence.
static JAS_ATTRIBUTE_PURE jas_matind_t | jas_seq_start (const jas_seq_t *seq)
| Get the starting index of a sequence.
static JAS_ATTRIBUTE_PURE jas_matind_t | jas_seq_end (const jas_seq_t *seq)
| Get the ending index of a sequence.

## Detailed Description

One- and Two-Dimensional Sequences.

## Function Documentation

## ◆ jas_matrix_asl()

JAS_EXPORT void jas_matrix_asl | ( | jas_matrix_t * | matrix,
|  | unsigned | n )

Arithmetic shift left of all elements in a matrix.

## ◆ jas_matrix_asr()

JAS_EXPORT void jas_matrix_asr | ( | jas_matrix_t * | matrix,
|  | unsigned | n )

Arithmetic shift right of all elements in a matrix.

## ◆ jas_matrix_bindcol()

int jas_matrix_bindcol | ( | jas_matrix_t * | mat0,
|  | jas_matrix_t * | mat1,
|  | jas_matind_t | c )
| inline static

Create a matrix that is a reference to a column of another matrix.

## ◆ jas_matrix_bindrow()

int jas_matrix_bindrow | ( | jas_matrix_t * | mat0,
|  | jas_matrix_t * | mat1,
|  | jas_matind_t | r )
| inline static

Create a matrix that is a reference to a row of another matrix.

## ◆ jas_matrix_bindsub()

JAS_EXPORT int jas_matrix_bindsub | ( | jas_matrix_t * | mat0,
|  | jas_matrix_t * | mat1,
|  | jas_matind_t | r0,
|  | jas_matind_t | c0,
|  | jas_matind_t | r1,
|  | jas_matind_t | c1 )

Create a matrix that references part of another matrix.

## ◆ jas_matrix_clip()

JAS_EXPORT void jas_matrix_clip | ( | jas_matrix_t * | matrix,
|  | jas_seqent_t | minval,
|  | jas_seqent_t | maxval )

Clip the values of matrix elements to the specified range.

## ◆ jas_matrix_cmp()

JAS_EXPORT int jas_matrix_cmp | ( | jas_matrix_t * | mat0,
|  | jas_matrix_t * | mat1 )

Compare two matrices for equality.

## ◆ jas_matrix_copy()

JAS_EXPORT jas_matrix_t * jas_matrix_copy | ( | jas_matrix_t * | x | ) |

Copy a matrix.

## ◆ jas_matrix_create()

JAS_EXPORT jas_matrix_t * jas_matrix_create | ( | jas_matind_t | numrows,
|  | jas_matind_t | numcols )

Create a matrix with the specified dimensions.

## ◆ jas_matrix_destroy()

JAS_EXPORT void jas_matrix_destroy | ( | jas_matrix_t * | matrix | ) |

Destroy a matrix.

## ◆ jas_matrix_divpow2()

JAS_EXPORT void jas_matrix_divpow2 | ( | jas_matrix_t * | matrix,
|  | unsigned | n )

Almost-but-not-quite arithmetic shift right of all elements in a matrix.

## ◆ jas_matrix_empty()

JAS_ATTRIBUTE_PURE bool jas_matrix_empty | ( | const jas_matrix_t * | matrix | ) |
| inline static

Test if a matrix is empty (i.e., contains no elements).

## ◆ jas_matrix_get()

JAS_ATTRIBUTE_PURE jas_seqent_t jas_matrix_get | ( | const jas_matrix_t * | matrix,
|  | jas_matind_t | i,
|  | jas_matind_t | j )
| inline static

Get a matrix element.

## ◆ jas_matrix_getref()

JAS_ATTRIBUTE_PURE jas_seqent_t * jas_matrix_getref | ( | const jas_matrix_t * | matrix,
|  | jas_matind_t | i,
|  | jas_matind_t | j )
| inline static

Get the address of an element in a matrix.

## ◆ jas_matrix_getv()

JAS_ATTRIBUTE_PURE jas_seqent_t jas_matrix_getv | ( | const jas_matrix_t * | matrix,
|  | jas_matind_t | i )
| inline static

Get an element from a matrix that is known to be a row or column vector.

## ◆ jas_matrix_getvref()

JAS_ATTRIBUTE_PURE jas_seqent_t * jas_matrix_getvref | ( | const jas_matrix_t * | matrix,
|  | jas_matind_t | i )
| inline static

Get a reference to a particular row of a 2-D sequence.

## ◆ jas_matrix_input()

JAS_EXPORT jas_matrix_t * jas_matrix_input | ( | FILE * |  | ) |

Read a matrix from a C standard library stream.

## ◆ jas_matrix_numcols()

JAS_ATTRIBUTE_PURE jas_matind_t jas_matrix_numcols | ( | const jas_matrix_t * | matrix | ) |
| inline static

Get the number of columns in a matrix.

## ◆ jas_matrix_numrows()

JAS_ATTRIBUTE_PURE jas_matind_t jas_matrix_numrows | ( | const jas_matrix_t * | matrix | ) |
| inline static

Get the number of rows in a matrix.

## ◆ jas_matrix_output()

JAS_EXPORT int jas_matrix_output | ( | jas_matrix_t * | matrix,
|  | FILE * | out )

Write a matrix to a C standard library stream.

## ◆ jas_matrix_resize()

JAS_EXPORT int jas_matrix_resize | ( | jas_matrix_t * | matrix,
|  | jas_matind_t | numrows,
|  | jas_matind_t | numcols )

Resize a matrix. The previous contents of the matrix are lost.

## ◆ jas_matrix_rowstep()

JAS_ATTRIBUTE_PURE size_t jas_matrix_rowstep | ( | const jas_matrix_t * | matrix | ) |
| inline static

The spacing between rows of a matrix.

## ◆ jas_matrix_set()

void jas_matrix_set | ( | jas_matrix_t * | matrix,
|  | jas_matind_t | i,
|  | jas_matind_t | j,
|  | jas_seqent_t | v )
| inline static

Set a matrix element.

## ◆ jas_matrix_setall()

JAS_EXPORT void jas_matrix_setall | ( | jas_matrix_t * | matrix,
|  | jas_seqent_t | val )

Set all elements of a matrix to the specified value.

## ◆ jas_matrix_setv()

void jas_matrix_setv | ( | jas_matrix_t * | matrix,
|  | jas_matind_t | i,
|  | jas_seqent_t | v )
| inline static

Set an element in a matrix that is known to be a row or column vector.

## ◆ jas_matrix_size()

JAS_ATTRIBUTE_PURE jas_matind_t jas_matrix_size | ( | const jas_matrix_t * | matrix | ) |
| inline static

Get the number of elements in a matrix.

## ◆ jas_matrix_step()

JAS_ATTRIBUTE_PURE size_t jas_matrix_step | ( | const jas_matrix_t * | matrix | ) |
| inline static

The spacing between columns of a matrix.

## ◆ jas_seq2d_bindsub()

JAS_EXPORT int jas_seq2d_bindsub | ( | jas_matrix_t * | s,
|  | jas_matrix_t * | s1,
|  | jas_matind_t | xstart,
|  | jas_matind_t | ystart,
|  | jas_matind_t | xend,
|  | jas_matind_t | yend )

Initialize a sequence to reference a subsequence of another sequence.

## ◆ jas_seq2d_copy()

JAS_EXPORT jas_seq2d_t * jas_seq2d_copy | ( | jas_seq2d_t * | x | ) |

Copy a 2-D sequence.

## ◆ jas_seq2d_create()

JAS_EXPORT jas_matrix_t * jas_seq2d_create | ( | jas_matind_t | xstart,
|  | jas_matind_t | ystart,
|  | jas_matind_t | xend,
|  | jas_matind_t | yend )

Create a 2-D sequence.

## ◆ jas_seq2d_destroy()

void jas_seq2d_destroy | ( | jas_seq2d_t * | s | ) |
| inline static

Destroy a 2-D sequence.

## ◆ jas_seq2d_empty()

JAS_ATTRIBUTE_PURE bool jas_seq2d_empty | ( | const jas_seq2d_t * | s | ) |
| inline static

Test if the sequence is empty (i.e., contains no elements).

## ◆ jas_seq2d_get()

JAS_ATTRIBUTE_PURE jas_seqent_t jas_seq2d_get | ( | const jas_seq2d_t * | s,
|  | jas_matind_t | x,
|  | jas_matind_t | y )
| inline static

Get an element of a 2-D sequence.

## ◆ jas_seq2d_getref()

JAS_ATTRIBUTE_PURE jas_seqent_t * jas_seq2d_getref | ( | const jas_seq2d_t * | s,
|  | jas_matind_t | x,
|  | jas_matind_t | y )
| inline static

Get a pointer (i.e., reference) to an element of a 2-D sequence.

## ◆ jas_seq2d_height()

JAS_ATTRIBUTE_PURE unsigned jas_seq2d_height | ( | const jas_seq2d_t * | s | ) |
| inline static

Get the number of rows in the sequence.

## ◆ jas_seq2d_rowstep()

JAS_ATTRIBUTE_PURE size_t jas_seq2d_rowstep | ( | const jas_seq2d_t * | s | ) |
| inline static

Get the stride between successive rows in the sequence.

## ◆ jas_seq2d_setshift()

void jas_seq2d_setshift | ( | jas_seq2d_t * | s,
|  | jas_matind_t | x,
|  | jas_matind_t | y )
| inline static

Set the shift (i.e., starting x- and y-coordinates) of the sequence.

## ◆ jas_seq2d_size()

JAS_ATTRIBUTE_PURE jas_matind_t jas_seq2d_size | ( | const jas_seq2d_t * | s | ) |
| inline static

Get the number of elements in the sequence.

## ◆ jas_seq2d_width()

JAS_ATTRIBUTE_PURE unsigned jas_seq2d_width | ( | const jas_seq2d_t * | s | ) |
| inline static

Get the number of columns in the sequence.

## ◆ jas_seq2d_xend()

JAS_ATTRIBUTE_PURE jas_matind_t jas_seq2d_xend | ( | const jas_seq2d_t * | s | ) |
| inline static

Get the ending x-coordinate of the sequence.

## ◆ jas_seq2d_xstart()

JAS_ATTRIBUTE_PURE jas_matind_t jas_seq2d_xstart | ( | const jas_seq2d_t * | s | ) |
| inline static

Get the starting x-coordinate of the sequence.

## ◆ jas_seq2d_yend()

JAS_ATTRIBUTE_PURE jas_matind_t jas_seq2d_yend | ( | const jas_seq2d_t * | s | ) |
| inline static

Get the ending y-coordinate of the sequence.

## ◆ jas_seq2d_ystart()

JAS_ATTRIBUTE_PURE jas_matind_t jas_seq2d_ystart | ( | const jas_seq2d_t * | s | ) |
| inline static

Get the starting y-coordinate of the sequence.

## ◆ jas_seq_create()

jas_seq_t * jas_seq_create | ( | jas_matind_t | start,
|  | jas_matind_t | end )
| inline static

Create a 1-D sequence.

## ◆ jas_seq_destroy()

void jas_seq_destroy | ( | jas_seq_t * | seq | ) |
| inline static

Destroy a 1-D sequence.

## ◆ jas_seq_end()

JAS_ATTRIBUTE_PURE jas_matind_t jas_seq_end | ( | const jas_seq_t * | seq | ) |
| inline static

Get the ending index of a sequence.

## ◆ jas_seq_get()

JAS_ATTRIBUTE_PURE jas_seqent_t jas_seq_get | ( | const jas_seq_t * | seq,
|  | jas_matind_t | i )
| inline static

Get an element of a sequence.

## ◆ jas_seq_getref()

JAS_ATTRIBUTE_PURE jas_seqent_t * jas_seq_getref | ( | const jas_seq_t * | seq,
|  | jas_matind_t | i )
| inline static

Get a pointer (i.e., reference) to an element of a sequence.

## ◆ jas_seq_set()

void jas_seq_set | ( | jas_seq_t * | seq,
|  | jas_matind_t | i,
|  | jas_seqent_t | v )
| inline static

Set an element of a sequence.

## ◆ jas_seq_start()

JAS_ATTRIBUTE_PURE jas_matind_t jas_seq_start | ( | const jas_seq_t * | seq | ) |
| inline static

Get the starting index of a sequence.