22 #ifndef MUSE_PIXGRID_H
23 #define MUSE_PIXGRID_H
28 #include "muse_pixtable.h"
88 static inline cpl_size
90 cpl_size aZ, cpl_boolean aAllowOutside)
93 (aX < 0 || aX >= aPixels->size_x || aY < 0 || aY >= aPixels->size_y ||
94 aZ < 0 || aZ >= aPixels->size_z)) {
100 if (aX >= aPixels->size_x) {
101 aX = aPixels->size_x - 1;
106 if (aY >= aPixels->size_y) {
107 aY = aPixels->size_y - 1;
112 if (aZ >= aPixels->size_z) {
113 aZ = aPixels->size_z - 1;
115 return aX + aPixels->size_x * (aY + aPixels->size_y * aZ);
128 static inline cpl_size
134 cpl_size p = aPixels->pix[aIndex];
136 : (p > 0) ? 1 : aPixels->ext[-p-1].npix;
149 static inline const cpl_size *
155 cpl_size p = aPixels->pix[aIndex];
156 return (p == 0) ? NULL
157 : (p > 0) ? aPixels->pix + aIndex : aPixels->ext[-p-1].pix;
muse_pixgrid * muse_pixgrid_2d_create(cpl_table *, double, double, double, double, float *)
Convert selected rows of a pixel table into 2D pixgrid, linking the grid points to entries (=rows) in...
muse_pixgrid * muse_pixgrid_create(muse_pixtable *, cpl_propertylist *, cpl_size, cpl_size, cpl_size)
Convert selected rows of a pixel table into pixel grid, linking the grid points to entries (=rows) in...
Structure definition of MUSE pixel table.
static const cpl_size * muse_pixgrid_get_rows(muse_pixgrid *aPixels, cpl_size aIndex)
Return a pointer to the rows stored in one pixel.
void muse_pixgrid_delete(muse_pixgrid *)
Delete a pixgrid and remove its memory.
static cpl_size muse_pixgrid_get_index(muse_pixgrid *aPixels, cpl_size aX, cpl_size aY, cpl_size aZ, cpl_boolean aAllowOutside)
Get the grid index determined from all three coordinates.
static cpl_size muse_pixgrid_get_count(muse_pixgrid *aPixels, cpl_size aIndex)
Return the number of rows stored in one pixel.