A struct to control pixel access. It is a kind of flexible pixel iterator. The order or pattern of access is defined by the array_xy and start_[x,y] variables. More...
#include <oyranos_alpha.h>
Data Fields | |
oyOBJECT_e | type |
oyStruct_Copy_f | copy |
oyStruct_Release_f | release |
oyObject_s | oy_ |
int32_t | start_xy [2] |
int32_t | start_xy_old [2] |
int32_t * | array_xy |
int | array_n |
int | index |
size_t | pixels_n |
int32_t | workspace_id |
oyStruct_s * | user_data |
Related Functions | |
(Note that these are not member functions.) | |
oyPixelAccess_s * | oyPixelAccess_Create (int32_t start_x, int32_t start_y, oyFilterSocket_s *sock, oyPIXEL_ACCESS_TYPE_e type, oyObject_s object) |
allocate iand initialise a basic oyPixelAccess_s object | |
oyPixelAccess_s * | oyPixelAccess_Copy (oyPixelAccess_s *obj, oyObject_s object) |
copy or reference a oyPixelAccess_s object | |
int | oyPixelAccess_Release (oyPixelAccess_s **obj) |
release and zero a oyPixelAccess_s object | |
int | oyPixelAccess_CalculateNextStartPixel (oyPixelAccess_s *obj, oyFilterPlug_s *requestor_plug) |
predict the next start position |
A struct to control pixel access. It is a kind of flexible pixel iterator. The order or pattern of access is defined by the array_xy and start_[x,y] variables.
The index variable specifies the iterator position in the array_xy index array.
oyPixelAccess_s is like a job ticket. Goal is to maintain all intermediate and processing dependend memory references here in this structure.
pixels_n says how many pixels are to be processed for the cache. pixels_n is used to calculate the buffers located with getBuffer and freeBuffer. The amount of pixel specified in pixels_n must be processed by each filter, because other filters are relying on a properly filled cache. This variable also determins the size of the next iteration.
The relation of pixels_n to array_xy and start_[x,y] is that a minimum of pixels_n must be processed by starting with start_[x,y] and processing pixels_n through array_xy. array_xy specifies the offset pixel distance to a next pixel in x and y directions. In case pixels_n is larger than array_n the array_xy has to be continued at array_xy[0,1] after reaching its end (array_n).
Example:
Thus a line iterator behaviour can be specified by simply setting array_xy = {1,0}, for a advancement in x direction of one, array_n = 1, as we need just this type of advancement and pixels_n = image_width, for saying how often the pattern descibed in array_xy has to be applied.
Handling of pixel access is to be supported by a filter in a function of type oyCMMFilter_GetNext_f() in oyCMMapi4_s::oyCMMConnector_GetNext().
Access to the buffers by concurrenting threads is handled by passing different oyPixelAccess_s objects per thread.
From the backend point of view it is a requirement to obtain the intermediate buffers from somewhere. These are the ones to read from and to write computed results into.
Pixel in- and output buffers separation:
Access to input and output buffers:
Thread synchronisation:
Area dimensions:
Possible strategies are (old text):
Referenced by oyPixelAccess_CalculateNextStartPixel(), and oyPixelAccess_Create().
int32_t* oyPixelAccess_s::array_xy |
Referenced by oyPixelAccess_CalculateNextStartPixel(), oyPixelAccess_Create(), and oyPixelAccess_Release().
oyStruct_Copy_f oyPixelAccess_s::copy |
copy function
to be advanced by the last caller
base object
Referenced by oyPixelAccess_Copy(), oyPixelAccess_Create(), and oyPixelAccess_Release().
size_t oyPixelAccess_s::pixels_n |
pixels to process/cache at once; should be set to 0 or 1
Referenced by oyPixelAccess_CalculateNextStartPixel(), and oyPixelAccess_Create().
oyStruct_Release_f oyPixelAccess_s::release |
release function
int32_t oyPixelAccess_s::start_xy[2] |
the start point
Referenced by oyPixelAccess_CalculateNextStartPixel(), and oyPixelAccess_Create().
int32_t oyPixelAccess_s::start_xy_old[2] |
internal struct type oyOBJECT_PIXEL_ACCESS_S
Referenced by oyPixelAccess_Release().
user data, e.g. for error messages
int32_t oyPixelAccess_s::workspace_id |
a ID to assign distinct resources to