#25 closed defect (fixed)
psImage format/ union naming
| Reported by: | Owned by: | eugene | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | PSLib SDRS | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: |
Description
As the union in psImage consists of pointers of pointers, it is misleading to
call it 'rows'. Also, using rows_TYPE for the members further makes things
awkward looking. I suggest something like the following definition for psImage
so that image data is accessed as img->data.f32[row][col] as opposed to
img->rows.rows_f32[row][col] :
typedef struct psImage
{
const psType type; /< Image data type and dimension.
const unsigned int numCols; /< Number of columns in image
const unsigned int numRows; /< Number of rows in image.
const int col0; /< Column position relative to parent.
const int row0; /< Row position relative to parent.
union {
uint8_t ui8; /< unsigned 8-bit integer data.
uint16_t ui16; /< unsigned 16-bit integer data.
uint32_t ui32; /< unsigned 32-bit integer data.
int8_t i8; /< signed 8-bit integer data.
int16_t i16; /< signed 16-bit integer data.
int32_t i32; /< signed 32-bit integer data.
float f32; /< single-precision float data.
double f64; /< double-precision float data.
complex float c32; /< single-precision complex data.
void v; /< void pointers to data
} data; /< Union for data types.
struct psImage *parent; /< Parent, if a subimage.
int nChildren; /< Number of subimages.
struct psImage *children; /< Children of this region.
}
psImage;
Change History (3)
comment:1 by , 22 years ago
comment:2 by , 22 years ago
| Status: | new → assigned |
|---|
these union names look much better -- I will update the SDRS, etc
comment:3 by , 22 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
we have converged on the following for all of the unified math data structures
(p_psScalar, psVector, psImage, psMetadata):
union {
psF32 F32;
psS32 S32;
(etc)
void V;
} data;

Updated psImage struct given the ps* typedefs.
typedef struct psImage
{
}
psImage;