Main Page | Modules | Data Structures | Directories | File List | Data Fields | Globals | Related Pages

Convenience routines to access a single component
[Low level access to single components]


Detailed Description

Characteristic of these routines is that they perform a transformation between the user buffer and the data. In particular, the following is possible:

As a result, these functions are not fast; their focus is on ease-of-use.

Typical use is a vector component with e.g. 2 bits subpixel precision that is stored in a floating point application buffer.

These functions are built upon the p_write_frame/field_comp_16() functions. They perform dynamic memory allocation using malloc()/free().

Most of the parameters are standard, the special ones are:

Parameters:
field 0: frame, 1/2: field access.
abuf the pointer to the application buffer
atype type of the application buffer
offset zero value for signed data pfspd data is always unsigned, this specifies the pfspd value that maps to zero for signed appl buffers.
gain multiplication factor (may be negative)
When writing, an application value a is transformed into a pfspd value p:
  p = (unsigned short)((a * gain) + offset) 
When reading, the inverse transformation is:
  a = (p - offset) / (atype)gain    

When the component has type P_16_REAL_FILE, float and double values are converted to and from an internal 16-bit float format.


Functions

pT_status p_cce_read_comp (const char *filename, pT_header *header, int frame, int field, int comp, void *abuf, pT_buf_type atype, int offset, int gain, int width, int height, int stride)
pT_status p_cce_write_comp (const char *filename, pT_header *header, int frame, int field, int comp, const void *abuf, pT_buf_type atype, int offset, int gain, int width, int height, int stride)


Function Documentation

pT_status p_cce_read_comp const char *  filename,
pT_header header,
int  frame,
int  field,
int  comp,
void *  abuf,
pT_buf_type  atype,
int  offset,
int  gain,
int  width,
int  height,
int  stride
 

pT_status p_cce_write_comp const char *  filename,
pT_header header,
int  frame,
int  field,
int  comp,
const void *  abuf,
pT_buf_type  atype,
int  offset,
int  gain,
int  width,
int  height,
int  stride
 


Generated on Thu Nov 19 16:28:20 2009 for cpfspd by  doxygen 1.3.9.1