Oyranos Color Management System API
Public Member Functions | Data Fields
oyArray2d_s Struct Reference

2d data array More...

#include <oyArray2d_s.h>

Inheritance diagram for oyArray2d_s:
Inheritance graph
Collaboration diagram for oyArray2d_s:
Collaboration graph

Public Member Functions

OYAPI oyArray2d_s *OYEXPORT oyArray2d_New (oyObject_s object)
 allocate a new Array2d object More...
 
OYAPI oyArray2d_s *OYEXPORT oyArray2d_Copy (oyArray2d_s *array2d, oyObject_s object)
 copy or reference a Array2d object More...
 
OYAPI int OYEXPORT oyArray2d_Release (oyArray2d_s **array2d)
 release and possibly deallocate a oyArray2d_s object More...
 
OYAPI oyArray2d_s *OYEXPORT oyArray2d_Create (oyPointer data, int width, int height, oyDATATYPE_e data_type, oyObject_s object)
 Allocate and initialise a oyArray2d_s object. More...
 
OYAPI oyPointer OYEXPORT oyArray2d_GetData (oyArray2d_s *obj)
 Get the data blob. More...
 
OYAPI int OYEXPORT oyArray2d_SetData (oyArray2d_s *obj, oyPointer data)
 Set the data blob and (re-)initialise the object. More...
 
OYAPI int OYEXPORT oyArray2d_SetRows (oyArray2d_s *obj, oyPointer *rows, int do_copy)
 Set the data and (re-)initialise the object. More...
 
int oyArray2d_SetFocus (oyArray2d_s *array, oyRectangle_s *rectangle)
 Move a arrays active area to a given rectangle. More...
 
OYAPI int OYEXPORT oyArray2d_Reset (oyArray2d_s *array, int width, int height, oyDATATYPE_e data_type)
 Reinitialise Array. More...
 
OYAPI double OYEXPORT oyArray2d_GetDataGeo1 (oyArray2d_s *array, int x_y_w_h)
 Get Geometry of the data rectangle. More...
 
OYAPI int OYEXPORT oyArray2d_GetWidth (oyArray2d_s *array)
 Get data Width. More...
 
OYAPI int OYEXPORT oyArray2d_GetHeight (oyArray2d_s *array)
 Get data Height. More...
 
OYAPI oyDATATYPE_e OYEXPORT oyArray2d_GetType (oyArray2d_s *array)
 Get data Type. More...
 
void oyArray2d_Release__Members (oyArray2d_s_ *array2d)
 Custom Array2d destructor. More...
 
int oyArray2d_Init__Members (oyArray2d_s_ *array2d)
 Custom Array2d constructor. More...
 
int oyArray2d_Copy__Members (oyArray2d_s_ *dst, oyArray2d_s_ *src)
 Custom Array2d copy constructor. More...
 
int oyArray2d_Init_ (oyArray2d_s_ *s, int width, int height, oyDATATYPE_e data_type)
 Initialise Array. More...
 
oyArray2d_s_ * oyArray2d_Create_ (int width, int height, oyDATATYPE_e data_type, oyObject_s object)
 Allocate and initialise a oyArray2d_s object widthout pixel. More...
 
int oyArray2d_ReleaseArray_ (oyArray2d_s *obj)
 Release Array2d::array member. More...
 
int oyArray2d_ToPPM_ (oyArray2d_s_ *array, const char *file_name)
 Dump array to a netppm file. More...
 
int oyImage_WritePPM (oyImage_s *image, const char *file_name, const char *free_text)
 implement oyCMMFilter_GetNext_f() More...
 
- Public Member Functions inherited from oyStruct_s
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...
 

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...
 
- Data Fields inherited from oyStruct_s
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...
 

Detailed Description

2d data array

oyArray2d_s is a in memory data view. The array2d holds pointers to lines in the original memory blob. The arrays contained in array2d represent the samples. There is no information in which order the samples appear. No pixel layout or meaning is provided. Given the coordinates x and y, a samples memory adress can be accessed by &array2d[y][x] . This adress must be converted to the data type provided in oyArray2d_s::t.

The oyArray2d_s::data pointer should be observed in order to be signaled about its invalidation.

dot_inline_dotgraph_1.png
Version
Oyranos: 0.1.8
Since
2008/08/23 (Oyranos: 0.1.8)
Date
2008/08/23

Member Function Documentation

OYAPI oyArray2d_s *OYEXPORT oyArray2d_Copy ( oyArray2d_s array2d,
oyObject_s  object 
)

copy or reference a Array2d object

Function oyArray2d_Copy

The function is for copying and for referencing. The reference is the most often used way, which saves resourcs and time.

Parameters
[in]array2dArray2d struct object
objectNULL - means reference, the optional object triggers a real copy

References oyOBJECT_ARRAY2D_S.

Referenced by oyArray2d_Copy__Members(), oyPixelAccess_s::oyPixelAccess_Copy__Members(), oyPixelAccess_s::oyPixelAccess_GetArray(), and oyPixelAccess_s::oyPixelAccess_SetArray().

int oyArray2d_Copy__Members ( oyArray2d_s_ *  dst,
oyArray2d_s_ *  src 
)
OYAPI oyArray2d_s *OYEXPORT oyArray2d_Create ( oyPointer  data,
int  width,
int  height,
oyDATATYPE_e  data_type,
oyObject_s  object 
)

Allocate and initialise a oyArray2d_s object.

Function oyArray2d_Create

Version
Oyranos: 0.1.8
Since
2008/08/23 (Oyranos: 0.1.8)
Date
2008/08/23

References oyArray2d_Create_(), oyArray2d_Release(), oyArray2d_SetData(), oyDataTypeGetSize(), oyOBJECT_ARRAY2D_S, oyRectangle_s::oyRectangle_NewWith(), oyRectangle_s::oyRectangle_Release(), and oyYES.

Referenced by oyArray2d_Copy__Members(), oyImage_s::oyImage_Create(), and oyImage_s::oyImage_SetCritical().

oyArray2d_s_ * oyArray2d_Create_ ( int  width,
int  height,
oyDATATYPE_e  data_type,
oyObject_s  object 
)

Allocate and initialise a oyArray2d_s object widthout pixel.

Function oyArray2d_Create_

References oyArray2d_Init_(), and oyArray2d_New().

Referenced by oyArray2d_Create(), and oyImage_s::oyImage_FillArray().

OYAPI oyPointer OYEXPORT oyArray2d_GetData ( oyArray2d_s obj)

Get the data blob.

Function oyArray2d_GetData

Parameters
[in,out]objstruct object
Returns
the data, remains in the property of the object
Version
Oyranos: 0.5.0
Date
2012/09/25
Since
2012/09/25 (Oyranos: 0.5.0)

References oyOBJECT_ARRAY2D_S.

OYAPI double OYEXPORT oyArray2d_GetDataGeo1 ( oyArray2d_s array,
int  x_y_w_h 
)

Get Geometry of the data rectangle.

Function oyArray2d_GetDataGeo1

The function informs about reserves and possible offsets.

Parameters
[in,out]arraythe pixel array
Returns
the position or dimension
Version
Oyranos: 0.5.0
Date
2012/10/05
Since
2012/10/03 (Oyranos: 0.5.0)

References oyRectangle_s::oyRectangle_GetGeo1().

OYAPI int OYEXPORT oyArray2d_GetHeight ( oyArray2d_s array)

Get data Height.

Function oyArray2d_GetHeight

Parameters
[in,out]arraythe pixel array
Returns
the height
Version
Oyranos: 0.5.0
Date
2012/10/05
Since
2012/10/05 (Oyranos: 0.5.0)
OYAPI oyDATATYPE_e OYEXPORT oyArray2d_GetType ( oyArray2d_s array)

Get data Type.

Function oyArray2d_GetType

Parameters
[in,out]arraythe pixel array
Returns
the data type
Version
Oyranos: 0.9.0
Date
2012/10/11
Since
2012/10/11 (Oyranos: 0.9.0)
OYAPI int OYEXPORT oyArray2d_GetWidth ( oyArray2d_s array)

Get data Width.

Function oyArray2d_GetWidth

Parameters
[in,out]arraythe pixel array
Returns
the width
Version
Oyranos: 0.5.0
Date
2012/10/05
Since
2012/10/05 (Oyranos: 0.5.0)
int oyArray2d_Init_ ( oyArray2d_s_ *  s,
int  width,
int  height,
oyDATATYPE_e  data_type 
)

Initialise Array.

Function oyArray2d_Init_

Version
Oyranos: 0.9.0
Since
2012/10/20 (Oyranos: 0.9.0)
Date
2012/10/20

References oyNO, oyOBJECT_RECTANGLE_S, and oyRectangle_s::oyRectangle_SetGeo().

Referenced by oyArray2d_Create_(), and oyArray2d_Reset().

int oyArray2d_Init__Members ( oyArray2d_s_ *  array2d)

Custom Array2d constructor.

Function oyArray2d_Init__Members

Referenced by oyArray2d_Copy__Members().

OYAPI oyArray2d_s *OYEXPORT oyArray2d_New ( oyObject_s  object)

allocate a new Array2d object

Function oyArray2d_New

References oyOBJECT_OBJECT_S.

Referenced by oyArray2d_Create_().

OYAPI int OYEXPORT oyArray2d_Release ( oyArray2d_s **  array2d)

release and possibly deallocate a oyArray2d_s object

Function oyArray2d_Release

Parameters
[in,out]array2dArray2d struct object

References oyOBJECT_ARRAY2D_S.

Referenced by oyArray2d_Copy__Members(), oyArray2d_Create(), oyConversion_s::oyConversion_RunPixels(), oyImage_s::oyImage_FillArray(), oyPixelAccess_s::oyPixelAccess_Release__Members(), and oyPixelAccess_s::oyPixelAccess_SetArray().

void oyArray2d_Release__Members ( oyArray2d_s_ *  array2d)

Custom Array2d destructor.

Function oyArray2d_Release__Members

References oyArray2d_ReleaseArray_().

Referenced by oyArray2d_Copy__Members().

int oyArray2d_ReleaseArray_ ( oyArray2d_s obj)

Release Array2d::array member.

Function oyArray2d_ReleaseArray_

Parameters
[in,out]objstruct object
Version
Oyranos: 0.9.1
Date
2012/11/02
Since
2010/09/07 (Oyranos: 0.1.11)

References oy_debug, oyDataTypeGetSize(), and oyRectangle_s::oyRectangle_Show().

Referenced by oyArray2d_Release__Members(), oyArray2d_Reset(), and oyArray2d_SetRows().

OYAPI int OYEXPORT oyArray2d_Reset ( oyArray2d_s array,
int  width,
int  height,
oyDATATYPE_e  data_type 
)

Reinitialise Array.

Function oyArray2d_Reset

Version
Oyranos: 0.9.0
Since
2012/10/20 (Oyranos: 0.9.0)
Date
2012/10/20

References oyArray2d_Init_(), oyArray2d_ReleaseArray_(), oyDataTypeGetSize(), and oyOBJECT_ARRAY2D_S.

Referenced by oyImage_s::oyImage_FillArray().

OYAPI int OYEXPORT oyArray2d_SetData ( oyArray2d_s obj,
oyPointer  data 
)

Set the data blob and (re-)initialise the object.

Function oyArray2d_SetData

Parameters
[in,out]objstruct object
[in]datathe data, remains in the property of the caller
Version
Oyranos: 0.1.8
Since
2008/08/23 (Oyranos: 0.1.8)
Date
2008/08/23

References oyDataTypeGetSize(), oyNO, and oyOBJECT_ARRAY2D_S.

Referenced by oyArray2d_Create().

int oyArray2d_SetFocus ( oyArray2d_s array,
oyRectangle_s rectangle 
)

Move a arrays active area to a given rectangle.

Function oyArray2d_SetFocus

Parameters
[in,out]arraythe pixel array
[in]rectanglethe new region in the array's wholes data
Returns
error
Version
Oyranos: 0.3.0
Since
2011/04/19 (Oyranos: 0.3.0)
Date
2011/04/19

References oyDataTypeGetSize().

Referenced by oyImage_s::oyImage_FillArray().

OYAPI int OYEXPORT oyArray2d_SetRows ( oyArray2d_s obj,
oyPointer *  rows,
int  do_copy 
)

Set the data and (re-)initialise the object.

Function oyArray2d_SetRows

Parameters
[in,out]objstruct object
[in]datathe data
[in]do_copy- 0 : take the memory as is
  • 1 : copy the memory monolithic
  • 2 : copy the memory chunky
Version
Oyranos: 0.1.11
Since
2010/09/07 (Oyranos: 0.1.11)
Date
2010/09/07

References oyArray2d_ReleaseArray_(), oyDataTypeGetSize(), and oyOBJECT_ARRAY2D_S.

int oyArray2d_ToPPM_ ( oyArray2d_s_ *  array,
const char *  file_name 
)

Dump array to a netppm file.

Function oyArray2d_ToPPM_

References oyDataTypeGetSize(), oyDOUBLE, oyFLOAT, oyHALF, oyOBJECT_ARRAY2D_S, oyObject_s::oyObject_GetId(), oyUINT16, oyUINT32, and oyUINT8.

int oyImage_WritePPM ( oyImage_s image,
const char *  file_name,
const char *  free_text 
)

implement oyCMMFilter_GetNext_f()

oyImage_WritePPM

Parameters
[in]imagethe image
[in]file_namea writeable file name, The file can contain "%d" to include the image ID.
[in]free_textA text to include as comment.
Version
Oyranos: 0.3.1
Since
2008/10/07 (Oyranos: 0.1.8)
Date
2011/05/12

References oyImage_s::oy_, oyDataTypeGetSize(), oyLAYOUT, oyNAME_DESCRIPTION, oyObject_s::oyObject_GetId(), oyOBJECT_IMAGE_S, oyProfile_s::oyProfile_GetChannelsCount(), oyProfile_s::oyProfile_GetText(), oyToChannels_m, oyToDataType_m, and oyVersionString().

Field Documentation

oyStruct_Copy_f oyArray2d_s::copy

Copy function.

oyObject_s oyArray2d_s::oy_

Oyranos internal object.

Features name and hash. Do not change during object life time.

oyStruct_Release_f oyArray2d_s::release

Release function.

Referenced by oyArray2d_Copy__Members().

const oyOBJECT_e oyArray2d_s::type_

Type of object.

The struct type tells Oyranos how to interprete hidden fields.