IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Opened 22 years ago

Closed 22 years ago

Last modified 22 years ago

#25 closed defect (fixed)

psImage format/ union naming

Reported by: robert.desonia@… 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 robert.desonia@…, 22 years ago

Updated psImage struct given the ps* typedefs.

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 {

psU8 u8; /< unsigned 8-bit integer data.
psU16
u16; /< unsigned 16-bit integer data.
psU32 u32; /< unsigned 32-bit integer data.
psU32
u64; /< unsigned 64-bit integer data.
psS8 s8; /< signed 8-bit integer data.
psS16
s16; /< signed 16-bit integer data.
psS32 s32; /< signed 32-bit integer data.
psS32
s64; /< signed 64-bit integer data.
psF32 f32; /< single-precision float data.
psF64
f64; /< double-precision float data.
psC32 c32; /< single-precision complex data.
psC32
c64; /< double-precision complex data.
void v; /< void pointers to data

} data; /< Union for data types.
const struct psImage *parent;
/< Parent, if a subimage.
int nChildren; /< Number of subimages.
struct psImage children;
/< Children of this region.

}
psImage;

comment:2 by eugene, 22 years ago

Status: newassigned

these union names look much better -- I will update the SDRS, etc

comment:3 by eugene, 22 years ago

Resolution: fixed
Status: assignedclosed

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;

Note: See TracTickets for help on using tickets.