#516 closed defect (fixed)
psImage struct
| Reported by: | Owned by: | Paul Price | |
|---|---|---|---|
| Priority: | high | Milestone: | |
| Component: | PSLib SDRS | Version: | unspecified |
| Severity: | normal | Keywords: | |
| Cc: | robert.desonia@… |
Description
psLib image struct uses a psPtr rawDataBuffer that is not in the SDRS but is needed.
it is required so that subimages can reference count the raw data buffer.
Change History (3)
comment:1 by , 21 years ago
| Status: | new → assigned |
|---|
comment:2 by , 21 years ago
| Cc: | added |
|---|
You have a point, but I think it would be really sufficient to just rename it to 'p_rawDataBuffer', i.e.,
mark it private by our naming convention. Agree?
comment:3 by , 21 years ago
| Resolution: | → fixed |
|---|---|
| Status: | assigned → closed |
The idea of introducing a new type is so that it can be hidden from the user,
but I'm not fussy. Here's what I've got:
typedef struct psImage {
psMathType type; /< image data type and dimension
const int numCols; /< Number of columns in image
const int numRows; /< Number of rows in image.
const int col0; /< Column position relative to parent.
const int row0; /< Row position relative to parent.
union {
psS8 S8; /< Pointers to char data
psS16 S16; /< Pointers to short-integer data
psS32 S32; /< Pointers to integer data
psS64 S64; /< Pointers to long-integer data
psU8 U8; /< Pointers to unsigned-char data
psU16 U16; /< Pointers to unsigned-short-integer data
psU32 U32; /< Pointers to unsigned-integer data
psU64 U64; /< Pointers to unsigned-long-integer data
psF32 F32; /< Pointers to floating-point data
psF64 F64; /< Pointers to double-precision data
psC32 C32; /< Pointers to complex floating-point data
psC64 C64; /< Pointers to complex floating-point data
psPtr V; /< Pointers to untyped data
} data;
const struct psImage *parent; /< parent, if a subimage
psPtr p_rawDataBuffer; /< Raw data; private
psArray *children; /< children of this region
void *lock; /< Lock for thread safety
} psImage;

Since the user shouldn't be mucking with the rawDataBuffer, shouldn't we bury it?
typedef psPtr p_psImageRaw;
typedef struct psImage {
....
} psImage;