![]() |
Oyranos Color Management System API - Version 0.9.6 |
A filter chain or graph to manipulate a image. More...
#include <oyConversion_s.h>
Public Member Functions | |
OYAPI oyConversion_s *OYEXPORT | oyConversion_New (oyObject_s object) |
allocate a new Conversion object More... | |
oyConversion_Copy | |
Copy or Reference a Conversion object. More... | |
OYAPI int OYEXPORT | oyConversion_Release (oyConversion_s **conversion) |
release and possibly deallocate a oyConversion_s object More... | |
int | oyConversion_Correct (oyConversion_s *conversion, const char *registration, uint32_t flags, oyOptions_s *options) |
Check for correctly adhering to policies. More... | |
oyConversion_s * | oyConversion_CreateBasicPixels (oyImage_s *input, oyImage_s *output, oyOptions_s *options, oyObject_s object) |
Allocate initialise a basic oyConversion_s object. More... | |
oyConversion_s * | oyConversion_CreateBasicPixelsFromBuffers (oyProfile_s *p_in, oyPointer buf_in, oyPixel_t buf_type_in, oyProfile_s *p_out, oyPointer buf_out, oyPixel_t buf_type_out, oyOptions_s *options, int count) |
One dimensional color conversion context. More... | |
oyConversion_s * | oyConversion_CreateFromImage (oyImage_s *image_in, oyOptions_s *module_options, oyProfile_s *output_profile, oyDATATYPE_e buf_type_out, uint32_t flags, oyObject_s obj) |
generate a Oyranos graph from a image file name More... | |
oyFilterGraph_s * | oyConversion_GetGraph (oyConversion_s *conversion) |
Get the filter graph from a conversion context. More... | |
oyImage_s * | oyConversion_GetImage (oyConversion_s *conversion, uint32_t flags) |
Get a image copy at the desired position. More... | |
oyFilterNode_s * | oyConversion_GetNode (oyConversion_s *conversion, uint32_t flags) |
Get the filter node copy. More... | |
int | oyConversion_GetOnePixel (oyConversion_s *conversion, double x, double y, oyPixelAccess_s *pixel_access) |
Compute one pixel at the given position. More... | |
int | oyConversion_RunPixels (oyConversion_s *conversion, oyPixelAccess_s *pixel_access) |
Iterate over a conversion graph. More... | |
int | oyConversion_Set (oyConversion_s *conversion, oyFilterNode_s *input, oyFilterNode_s *output) |
Set input and output of a conversion graph. More... | |
char * | oyConversion_ToText (oyConversion_s *conversion, const char *head_line, int reserved, oyAlloc_f allocateFunc) |
Text description of a conversion graph. More... | |
![]() | |
const char * | oyStruct_GetTextFromModule (oyStruct_s *obj, oyNAME_e name_type, uint32_t flags) |
get object infos from a module More... | |
const char * | oyStruct_GetText (oyStruct_s *obj, oyNAME_e name_type, uint32_t flags) |
Get a text dump. More... | |
oyStruct_RegisterStaticMessageFunc | |
register a function for verbosity More... | |
oyStruct_GetInfo | |
get a additional string from a object More... | |
const char * | oyStructTypeToText (oyOBJECT_e type) |
Objects type to small string. More... | |
Data Fields | |
const oyOBJECT_e | type_ |
Type of object. More... | |
oyStruct_Copy_f | copy |
Copy function. More... | |
oyStruct_Release_f | release |
Release function. More... | |
oyObject_s | oy_ |
Oyranos internal object. More... | |
![]() | |
const oyOBJECT_e | type_ |
Type of object. More... | |
oyStruct_Copy_f | copy |
Copy function. More... | |
oyStruct_Release_f | release |
Release function. More... | |
oyObject_s | oy_ |
Oyranos internal object. More... | |
A filter chain or graph to manipulate a image.
Order of filters matters. The processing direction is a bit like raytracing as nodes request their parent.
The graph is allowed to be a directed graph without cycles.
oyConversion_s shall provide access to the graph and help in processing and managing nodes.
Creating Graphs:
Most simple is to use the oyConversion_CreateBasicPixels() function to create a profile to profile and possible image buffer to image buffer linear graph.
The other possibility is to create a non linear graph. The input member can be accessed for this directly.
While it would be possible to have several open ends in a graph, there are two endpoints considered as special. The input member prepresents the top most required node to be provided in a oyConversion_s graph. The input node is accessible for user manipulation. The other one is the out_ member. It is the closing node in the graph. It will be set by Oyranos during closing the graph.
Using Graphs:
To obtain the data the oyConversion_RunPixels() and oyConversion_GetOnePixel() functions are available.
oyConversion_Copy |
Copy or Reference a Conversion object.
The function is for copying and for referencing. The reference is the most often used way, which saves resourcs and time.
[in] | conversion | Conversion struct object |
object | NULL - means reference, the optional object triggers a real copy |
int oyConversion_Correct | ( | oyConversion_s * | conversion, |
const char * | registration, | ||
uint32_t | flags, | ||
oyOptions_s * | options | ||
) |
Check for correctly adhering to policies.
Function oyConversion_Correct
Without any options the module selected with the Registration policy filter shall perform graph analysis and correct the graph.
TODO: display and selection of policy modules
conversion | the to be checked configuration | |
registration | the to be used policy module | |
[in] | flags | for inbuild defaults | oyOPTIONSOURCE_FILTER; for options marked as advanced | oyOPTIONATTRIBUTE_ADVANCED | OY_SELECT_FILTER | OY_SELECT_COMMON |
options | options to the policy module |
References oyCMMapiFilters_s::oyCMMapiFilters_Count(), oyCMMapiFilters_s::oyCMMapiFilters_Get(), oyCMMapiFilters_s::oyCMMapiFilters_Release(), oyFILTER_REG_APPLICATION, oyFILTER_REG_MODE_STRIP_IMPLEMENTATION_ATTR, oyFilterRegistrationMatch(), oyFilterRegistrationToText(), oyOBJECT_CMM_API9_S, and oyOBJECT_CONVERSION_S.
Referenced by oyConversion_CreateFromImage().
oyConversion_s * oyConversion_CreateBasicPixels | ( | oyImage_s * | input, |
oyImage_s * | output, | ||
oyOptions_s * | options, | ||
oyObject_s | object | ||
) |
Allocate initialise a basic oyConversion_s object.
Function oyConversion_CreateBasicPixels
Provided options will be passed to oyFilterNode_NewWith(). There for no options defaults will be selected.
[in] | input | the input image data |
[in] | output | the output image data |
[in] | options | options to be passed to oyFilterCore_s Each option should be carefully named to be correctly selected by the intented filter (root, icc and output). The available options are particial defined by plugable policy modules, e.g. "oicc", and a filters own options. OY_DEFAULT_CMM_CONTEXT and OY_DEFAULT_CMM_RENDERER can contain string to explicitely select the icc module. |
object | the optional object |
References OY_CMM_STD, OY_TYPE_STD, oyConversion_New(), oyConversion_Release(), oyConversion_Set(), oyFilterNode_s::oyFilterNode_Connect(), oyFilterNode_s::oyFilterNode_FromOptions(), oyFilterNode_s::oyFilterNode_NewWith(), and oyFilterNode_s::oyFilterNode_SetData().
Referenced by oyConversion_CreateBasicPixelsFromBuffers().
oyConversion_s * oyConversion_CreateBasicPixelsFromBuffers | ( | oyProfile_s * | p_in, |
oyPointer | buf_in, | ||
oyPixel_t | buf_type_in, | ||
oyProfile_s * | p_out, | ||
oyPointer | buf_out, | ||
oyPixel_t | buf_type_out, | ||
oyOptions_s * | options, | ||
int | count | ||
) |
One dimensional color conversion context.
Function oyConversion_CreateBasicPixelsFromBuffers
The options are passed to oyConversion_CreateBasicPixels(); The function does the lookups for the profiles and the modules contexts in the Oyranos cache on the fly.
[in] | p_in | the input profile |
[in] | buf_in | the input channels |
[in] | buf_type_in | the input pixel type; channel count can be omitted |
[in] | p_out | the output profile |
[in] | buf_out | the output channels |
[in] | buf_type_out | the output pixel type; channel count can be omitted |
[in] | options | see the same option in oyConversion_CreateBasicPixels() |
[in] | count | the pixel count to convert in buf_in and buf_out |
References oyChannels_m, oyConversion_CreateBasicPixels(), oyImage_s::oyImage_Create(), oyImage_s::oyImage_Release(), oyProfile_s::oyProfile_GetChannelsCount(), and oyToChannels_m.
oyConversion_s * oyConversion_CreateFromImage | ( | oyImage_s * | image_in, |
oyOptions_s * | module_options, | ||
oyProfile_s * | output_profile, | ||
oyDATATYPE_e | buf_type_out, | ||
uint32_t | flags, | ||
oyObject_s | obj | ||
) |
generate a Oyranos graph from a image file name
Function oyConversion_CreateFromImage
[in] | image_in | input |
[in] | module_options | options for icc node |
[in] | output_profile | profile to convert colors to; |
[in] | buf_type_out | the desired data type for output |
[in] | flags | for inbuild defaults | oyOPTIONSOURCE_FILTER; for options marked as advanced | oyOPTIONATTRIBUTE_ADVANCED | OY_SELECT_FILTER | OY_SELECT_COMMON |
[in] | obj | Oyranos object (optional) |
References OY_CMM_STD, OY_TYPE_STD, oyChannels_m, oyConversion_Correct(), oyConversion_New(), oyConversion_Set(), oyDataType_m, oyFilterNode_s::oyFilterNode_Connect(), oyFilterNode_s::oyFilterNode_FromOptions(), oyFilterNode_s::oyFilterNode_NewWith(), oyFilterNode_s::oyFilterNode_SetData(), oyImage_s::oyImage_Create(), oyImage_s::oyImage_GetHeight(), oyImage_s::oyImage_GetPixelLayout(), oyImage_s::oyImage_GetProfile(), oyImage_s::oyImage_GetWidth(), oyLAYOUT, oyOptions_s::oyOptions_Release(), oyProfile_s::oyProfile_GetChannelsCount(), and oyToChannels_m.
oyFilterGraph_s * oyConversion_GetGraph | ( | oyConversion_s * | conversion | ) |
Get the filter graph from a conversion context.
Function oyConversion_GetGraph
[in,out] | conversion | conversion object |
References oyFilterGraph_s::oyFilterGraph_FromNode().
oyImage_s * oyConversion_GetImage | ( | oyConversion_s * | conversion, |
uint32_t | flags | ||
) |
Get a image copy at the desired position.
Function oyConversion_GetImage
[in,out] | conversion | conversion object |
[in] | flags | OY_INPUT or OY_OUTPUT |
References oyFilterNode_s::oyFilterNode_GetPlug(), oyFilterNode_s::oyFilterNode_GetSocket(), oyFilterPlug_s::oyFilterPlug_Release(), oyFilterSocket_s::oyFilterSocket_Release(), oyImage_s::oyImage_Copy(), oyOBJECT_CONVERSION_S, oyPIXEL_ACCESS_IMAGE, oyPixelAccess_s::oyPixelAccess_Create(), and oyPixelAccess_s::oyPixelAccess_Release().
Referenced by oyConversion_RunPixels(), and oyImage_s::oyImage_FromFile().
oyFilterNode_s * oyConversion_GetNode | ( | oyConversion_s * | conversion, |
uint32_t | flags | ||
) |
Get the filter node copy.
Function oyConversion_GetNode
[in,out] | conversion | conversion object |
[in] | flags | OY_INPUT or OY_OUTPUT |
References oyFilterNode_s::oyFilterNode_Copy(), and oyOBJECT_CONVERSION_S.
Referenced by oyConversion_RunPixels().
int oyConversion_GetOnePixel | ( | oyConversion_s * | conversion, |
double | x, | ||
double | y, | ||
oyPixelAccess_s * | pixel_access | ||
) |
Compute one pixel at the given position.
Function oyConversion_GetOnePixel
[in,out] | conversion | conversion object |
[in] | x | position x |
[in] | y | position y |
[in,out] | pixel_access | pixel iterator configuration |
References oyFilterNode_s::oyFilterNode_GetPlug(), and oyFilterPlug_s::oyFilterPlug_Release().
OYAPI oyConversion_s *OYEXPORT oyConversion_New | ( | oyObject_s | object | ) |
allocate a new Conversion object
Function oyConversion_New
References oyOBJECT_OBJECT_S.
Referenced by oyConversion_CreateBasicPixels(), oyConversion_CreateFromImage(), oyImage_s::oyImage_FromFile(), and oyImage_s::oyImage_ToFile().
OYAPI int OYEXPORT oyConversion_Release | ( | oyConversion_s ** | conversion | ) |
release and possibly deallocate a oyConversion_s object
Function oyConversion_Release
[in,out] | conversion | Conversion struct object |
References oyOBJECT_CONVERSION_S.
Referenced by oyConversion_CreateBasicPixels(), oyImage_s::oyImage_FromFile(), and oyImage_s::oyImage_ToFile().
int oyConversion_RunPixels | ( | oyConversion_s * | conversion, |
oyPixelAccess_s * | pixel_access | ||
) |
Iterate over a conversion graph.
Function oyConversion_RunPixels
[in,out] | conversion | conversion object |
[in,out] | pixel_access | optional pixel iterator configuration |
References oy_debug, oyArray2d_s::oyArray2d_Release(), oyConversion_GetImage(), oyConversion_GetNode(), oyFilterGraph_s::oyFilterGraph_PrepareContexts(), oyFilterGraph_s::oyFilterGraph_SetFromNode(), oyFilterNode_s::oyFilterNode_GetPlug(), oyFilterPlug_s::oyFilterPlug_Release(), oyFilterPlug_s::oyFilterPlug_ResolveImage(), oyImage_s::oyImage_FillArray(), oyImage_s::oyImage_ReadArray(), oyImage_s::oyImage_Release(), oyImage_s::oyImage_RoiToSamples(), oyImage_s::oyImage_SamplesToPixels(), oyOBJECT_CONVERSION_S, oyObject_GetId(), oyOBJECT_RECTANGLE_S, oyOptions_s::oyOptions_FindString(), oyPIXEL_ACCESS_IMAGE, oyPixelAccess_s::oyPixelAccess_Create(), oyPixelAccess_s::oyPixelAccess_Release(), oyPixelAccess_s::oyPixelAccess_SetArrayFocus(), oyPixelAccess_s::oyPixelAccess_Show(), oyRectangle_s::oyRectangle_Release(), oyRectangle_s::oyRectangle_SetByRectangle(), and oyRectangle_s::oyRectangle_Show().
Referenced by oyImage_s::oyImage_ToFile().
int oyConversion_Set | ( | oyConversion_s * | conversion, |
oyFilterNode_s * | input, | ||
oyFilterNode_s * | output | ||
) |
Set input and output of a conversion graph.
Function oyConversion_Set
[in,out] | conversion | conversion object |
[in] | input | input node |
[in] | output | output node |
References oyOBJECT_CONVERSION_S.
Referenced by oyConversion_CreateBasicPixels(), oyConversion_CreateFromImage(), oyImage_s::oyImage_FromFile(), and oyImage_s::oyImage_ToFile().
char * oyConversion_ToText | ( | oyConversion_s * | conversion, |
const char * | head_line, | ||
int | reserved, | ||
oyAlloc_f | allocateFunc | ||
) |
Text description of a conversion graph.
Function oyConversion_ToText
[in] | conversion | conversion object |
[in] | head_line | text for inclusion |
[in] | reserved | future format selector (dot, xml ...) |
[in] | allocateFunc | allocation function |
References oyFilterGraph_s::oyFilterGraph_New(), oyFilterGraph_s::oyFilterGraph_Release(), oyFilterGraph_s::oyFilterGraph_SetFromNode(), oyFilterGraph_s::oyFilterGraph_ToText(), and oyOBJECT_CONVERSION_S.
oyStruct_Copy_f oyConversion_s::copy |
Copy function.
oyObject_s oyConversion_s::oy_ |
Oyranos internal object.
Features name and hash. Do not change during object life time.
oyStruct_Release_f oyConversion_s::release |
Release function.
const oyOBJECT_e oyConversion_s::type_ |
Type of object.
The struct type tells Oyranos how to interprete hidden fields.