![]() |
Oyranos Colour Management System API |
control pixel access order More...
#include <oyranos_alpha.h>
Data Fields | |
| oyOBJECT_e | type |
| oyStruct_Copy_f | copy |
| oyStruct_Release_f | release |
| double | start_xy [2] |
| double | 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 |
| oyArray2d_s * | array |
| oyRectangle_s * | output_image_roi |
| oyImage_s * | output_image |
| oyFilterGraph_s * | graph |
| oyOptions_s * | request_queue |
control pixel access order
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.
oyPixelAccess_s is like a job ticket. Goal is to maintain all intermediate and processing dependend memory references in this structure.
[The index variable specifies the iterator position in the array_xy index array.]
[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 module 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):
Relation of positional parameters:
start_xy output_image_roi
| /
+-----|---------------/--------------+
original | | / |
image ---+ | / |
| ---+------------/----------+ |
| | / +---------- output_image
| | +------+--------+ | |
| | | | | |
| | | | | |
| | +---------------+ | |
| | | |
| +-----------------------+ |
| |
+------------------------------------+
processing data. The position is in start_xy relative to the previous mediator in the graph.
| int32_t* oyPixelAccess_s::array_xy |
| oyStruct_Copy_f oyPixelAccess_s::copy |
copy function
the graph to process
the image which issued the request
Referenced by oyFilterPlug_s::oyFilterPlug_ResolveImage().
rectangle of interesst; The rectangle is to be seen in relation to the output_image (of the last filter).
| size_t oyPixelAccess_s::pixels_n |
| oyStruct_Release_f oyPixelAccess_s::release |
release function
| oyOptions_s* oyPixelAccess_s::request_queue |
messaging; requests to resolve
Referenced by oyFilterPlug_s::oyFilterPlug_ResolveImage().
| double oyPixelAccess_s::start_xy[2] |
the start point of output_image
| double oyPixelAccess_s::start_xy_old[2] |
| oyOBJECT_e oyPixelAccess_s::type |
internal struct type oyOBJECT_PIXEL_ACCESS_S
| oyStruct_s* oyPixelAccess_s::user_data |
user data, e.g. for error messages
| int32_t oyPixelAccess_s::workspace_id |
a ID to assign distinct resources to