| Oyranos Colour Management System API

- Main Page
- Related Pages
- Modules
- Data Structures
- Files

- Data Structures
- Data Structure Index
- Class Hierarchy
- Data Fields

Public Member Functions | Data Fields
oyImage_s Struct Reference
Image Container API

A reference struct to gather information for image transformation. More...

`#include <oyImage_s.h>`

Inheritance diagram for oyImage_s:
Collaboration diagram for oyImage_s:

## Public Member Functions
OYAPI oyImage_s *OYEXPORT | oyImage_New (oyObject_s object)
| allocate a new Image object More...
OYAPI oyImage_s *OYEXPORT | oyImage_Copy (oyImage_s *image, oyObject_s object)
| copy or reference a Image object More...
OYAPI int OYEXPORT | oyImage_Release (oyImage_s **image)
| release and possibly deallocate a oyImage_s object More...
oyImage_s * | oyImage_Create (int width, int height, oyPointer channels, oyPixel_t pixel_layout, oyProfile_s *profile, oyObject_s object)
| collect infos about a image More...
oyImage_s * | oyImage_CreateForDisplay (int width, int height, oyPointer channels, oyPixel_t pixel_layout, const char *display_name, int display_pos_x, int display_pos_y, int display_width, int display_height, oyObject_s object)
| collect infos about a image for showing one a display More...
int | oyImage_SetCritical (oyImage_s *image, oyPixel_t pixel_layout, oyProfile_s *profile, oyOptions_s *tags, int width, int height)
| Set a image. More...
int | oyImage_FillArray (oyImage_s *image, oyRectangle_s *rectangle, int allocate_method, oyArray2d_s **array, oyRectangle_s *array_rectangle, oyObject_s obj)
| creata a array from a image and fill with data More...
int | oyImage_ReadArray (oyImage_s *image, oyRectangle_s *image_rectangle, oyArray2d_s *array, oyRectangle_s *array_rectangle)
| read a array into a image More...
int | oyImage_SetData (oyImage_s *image, oyStruct_s **pixel_data, oyImage_GetPoint_f getPoint, oyImage_GetLine_f getLine, oyImage_GetTile_f getTile, oyImage_SetPoint_f setPoint, oyImage_SetLine_f setLine, oyImage_SetTile_f setTile)
| set a custom image data module More...
int | oyImage_GetWidth (oyImage_s *image)
| Get the width in pixel. More...
int | oyImage_GetHeight (oyImage_s *image)
| Get the width in pixel. More...
int | oyImage_GetPixelLayout (oyImage_s *image, oyLAYOUT_e type)
| Get the pixel layout. More...
oyCHANNELTYPE_e | oyImage_GetChannelType (oyImage_s *image, int pos)
| Get a channel type. More...
int | oyImage_GetSubPositioning (oyImage_s *image)
| Get sub positioning. More...
oyProfile_s * | oyImage_GetProfile (oyImage_s *image)
| Get the image profile. More...
oyOptions_s * | oyImage_GetTags (oyImage_s *image)
| Get object tags. More...
oyStruct_s * | oyImage_GetPixelData (oyImage_s *image)
| Get the pixel data. More...
oyImage_GetPoint_f | oyImage_GetPointF (oyImage_s *image)
| Get the point function. More...
oyImage_GetLine_f | oyImage_GetLineF (oyImage_s *image)
| Get the Line function. More...
oyStruct_s * | oyImage_GetUserData (oyImage_s *image)
| Get the user data. More...
int | oyImage_PixelsToSamples (oyImage_s *image, oyRectangle_s *image_rectangle, oyRectangle_s *pixel_rectangle)
| Set sample rectangle from image rectangle. More...
Public Member Functions inherited from oyStruct_s
const char * | oyStruct_GetText (oyStruct_s *obj, oyNAME_e name_type, uint32_t flags)
| get a text dump More...

## Data Fields
oyStruct_Copy_f | copy
oyStruct_Release_f | release
Data Fields inherited from oyStruct_s
oyStruct_Copy_f | copy
oyStruct_Release_f | release

## Detailed Description

A reference struct to gather information for image transformation.

as we dont target a complete imaging solution, only raster is supported

Resolution is in pixel per centimeter.

Requirements:

- to provide a view on the image data we look at per line arrays
- it should be possible to echange the to be processed data without altering the context
- oyImage_s should hold image dimensions,
- display rectangle information and
- a reference to the data for conversion

To set a image data module use oyImage_DataSet().

Should oyImage_s become internal and we provide a user interface?

Version
  Oyranos: 0.1.8

Since
  2007/11/00 (Oyranos: 0.1.8)

Date
  2008/08/23

## Member Function Documentation

OYAPI oyImage_s *OYEXPORT oyImage_Copy | ( | oyImage_s * | image,
|  | oyObject_s | object
| ) |  |

copy or reference a Image object

Function oyImage_Copy

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

Parameters

  [in] | image | Image struct object
  | object | NULL - means reference, the optional object triggers a real copy

References oyOBJECT_IMAGE_S.

Referenced by oyConversion_s::oyConversion_GetImage(), oyFilterPlug_s::oyFilterPlug_ResolveImage(), oyImage_Create(), oyPixelAccess_s::oyPixelAccess_Create(), oyPixelAccess_s::oyPixelAccess_GetOutputImage(), and oyPixelAccess_s::oyPixelAccess_SetOutputImage().

oyImage_s * oyImage_Create | ( | int | width,
|  | int | height,
|  | oyPointer | channels,
|  | oyPixel_t | pixel_layout,
|  | oyProfile_s * | profile,
|  | oyObject_s | object
| ) |  |

collect infos about a image

Create a image description and access object. The passed channels pointer remains in the responsibility of the user. The image is a in memory blob.

Parameters

  [in] | width | image width
  [in] | height | image height
  [in] | channels | pointer to the data buffer
  [in] | pixel_layout | i.e. oyTYPE_123_16 for 16-bit RGB data
  [in] | profile | colour space description
  [in] | object | the optional base

Version
  Oyranos: 0.1.8

Since
  2007/11/00 (Oyranos: 0.1.8)

Date
  2008/08/23

References oyArray2d_s::oyArray2d_Create(), oyCOFF, oyImage_Copy(), oyImage_Release(), oyImage_SetData(), oyOBJECT_IMAGE_S, oyOptions_s::oyOptions_MoveInStruct(), oyProfile_s::oyProfile_Copy(), oyRectangle_s::oyRectangle_New(), oyRectangle_s::oyRectangle_NewWith(), oyToChannels_m, oyToDataType_m, and release.

Referenced by oyConversion_s::oyConversion_CreateBasicPixelsFromBuffers(), oyConversion_CreateFromImage(), oyFilterPlug_s::oyFilterPlug_ResolveImage(), and oyImage_CreateForDisplay().

oyImage_s * oyImage_CreateForDisplay | ( | int | width,
|  | int | height,
|  | oyPointer | channels,
|  | oyPixel_t | pixel_layout,
|  | const char * | display_name,
|  | int | display_pos_x,
|  | int | display_pos_y,
|  | int | display_width,
|  | int | display_height,
|  | oyObject_s | object
| ) |  |

collect infos about a image for showing one a display

Parameters

  [in] | width | image width
  [in] | height | image height
  [in] | channels | pointer to the data buffer
  [in] | pixel_layout | i.e. oyTYPE_123_16 for 16-bit RGB data
  [in] | display_name | display name
  [in] | display_pos_x | left image position on display
  [in] | display_pos_y | top image position on display
  [in] | display_width | width to show in window
  [in] | display_height | height to show in window
  [in] | object | the optional base

Since
  Oyranos: version 0.1.8

Date
  october 2007 (API 0.1.8)

References oyImage_Create(), oyImage_Release(), oyOBJECT_RECTANGLE_S, oyOptions_s::oyOptions_GetType(), oyOptions_s::oyOptions_SetFromText(), oyProfile_s::oyProfile_FromStd(), oyProfile_s::oyProfile_Release(), and oyRectangle_s::oyRectangle_SetGeo().

int oyImage_FillArray | ( | oyImage_s * | image,
|  | oyRectangle_s * | rectangle,
|  | int | allocate_method,
|  | oyArray2d_s ** | array,
|  | oyRectangle_s * | array_rectangle,
|  | oyObject_s | obj
| ) |  |

creata a array from a image and fill with data

Function oyImage_FillArray

The rectangle will be considered relative to the data. A given array will be filled. Allocation of a new array2d object happens as needed.

Parameters

  [in] | image | the image
  [in] | rectangle | the image rectangle in a relative unit a rectangle in the source image
  [in] | allocate_method | 0 assign the rows without copy 1 do copy into the array 2 allocate empty rows
  [out] | array | array to fill; If array is empty, it is allocated as per allocate_method
  [in] | array_rectangle | the array rectangle in samples For NULL the image rectangle will be placed to the top left corner in array. If array_rectangle is provided, image samples will be placed in array at array_rectangle's position and size. The unit is relative to the image.
  [in] | obj | the optional user object

Version
  Oyranos: 0.9.0

Date
  2012/10/20

Since
  2008/10/02 (Oyranos: 0.1.8)

References oyArray2d_s::oyArray2d_Release(), oyArray2d_s::oyArray2d_Reset(), oyArray2d_s::oyArray2d_SetFocus(), oyCHANS, oyImage_PixelsToSamples(), oyLAYOUT, oyOBJECT_IMAGE_S, oyOBJECT_RECTANGLE_S, oyRectangle_s::oyRectangle_SetGeo(), oyToDataType_m, and oyUINT8.

Referenced by oyConversion_s::oyConversion_RunPixels().

oyCHANNELTYPE_e oyImage_GetChannelType | ( | oyImage_s * | image,
|  | int | pos
| ) |  |

Get a channel type.

Function oyImage_GetChannelType

Version
  Oyranos: 0.5.0

Since
  2012/09/05 (Oyranos: 0.5.0)

Date
  2012/09/05

References oyOBJECT_IMAGE_S.

int oyImage_GetHeight | ( | oyImage_s * | image | ) |

Get the width in pixel.

Function oyImage_GetHeight

Version
  Oyranos: 0.5.0

Since
  2009/03/05 (Oyranos: 0.1.10)

Date
  2012/06/12

References oyOBJECT_IMAGE_S.

Referenced by oyConversion_CreateFromImage(), oyImage_PixelsToSamples(), and oyPixelAccess_s::oyPixelAccess_Create().

oyImage_GetLine_f oyImage_GetLineF | ( | oyImage_s * | image | ) |

Get the Line function.

Function oyImage_GetLineF

Version
  Oyranos: 0.5.0

Since
  2012/09/05 (Oyranos: 0.5.0)

Date
  2012/09/05

References oyOBJECT_IMAGE_S.

oyStruct_s * oyImage_GetPixelData | ( | oyImage_s * | image | ) |

Get the pixel data.

Function oyImage_GetPixelData

Version
  Oyranos: 0.5.0

Since
  2012/09/05 (Oyranos: 0.5.0)

Date
  2012/09/05

References copy, and oyOBJECT_IMAGE_S.

int oyImage_GetPixelLayout | ( | oyImage_s * | image,
|  | oyLAYOUT_e | type
| ) |  |

Get the pixel layout.

Function oyImage_GetPixelLayout

See also
  oyPixel_t

Version
  Oyranos: 0.5.0

Since
  2009/03/05 (Oyranos: 0.1.10)

Date
  2012/09/05

References oyOBJECT_IMAGE_S.

Referenced by oyConversion_CreateFromImage(), and oyImage_PixelsToSamples().

oyImage_GetPoint_f oyImage_GetPointF | ( | oyImage_s * | image | ) |

Get the point function.

Function oyImage_GetPointF

Version
  Oyranos: 0.5.0

Since
  2012/09/05 (Oyranos: 0.5.0)

Date
  2012/09/05

References oyOBJECT_IMAGE_S.

oyProfile_s * oyImage_GetProfile | ( | oyImage_s * | image | ) |

Get the image profile.

Function oyImage_GetProfile

Version
  Oyranos: 0.5.0

Since
  2009/08/05 (Oyranos: 0.1.10)

Date
  2012/06/12

References oyOBJECT_IMAGE_S, and oyProfile_s::oyProfile_Copy().

Referenced by oyConversion_CreateFromImage().

int oyImage_GetSubPositioning | ( | oyImage_s * | image | ) |

Get sub positioning.

Function oyImage_GetSubPositioning

Version
  Oyranos: 0.5.0

Since
  2012/09/05 (Oyranos: 0.5.0)

Date
  2012/09/05

References oyOBJECT_IMAGE_S.

oyOptions_s * oyImage_GetTags | ( | oyImage_s * | image | ) |

Get object tags.

Function oyImage_GetTags

Version
  Oyranos: 0.5.0

Since
  2009/03/05 (Oyranos: 0.1.10)

Date
  2012/06/12

References oyOBJECT_IMAGE_S, and oyOptions_s::oyOptions_Copy().

Referenced by oyImage_FromFile(), and oyImage_ToFile().

oyStruct_s * oyImage_GetUserData | ( | oyImage_s * | image | ) |

Get the user data.

Function oyImage_GetUserData

Version
  Oyranos: 0.5.0

Since
  2012/09/05 (Oyranos: 0.5.0)

Date
  2012/09/05

References copy, and oyOBJECT_IMAGE_S.

int oyImage_GetWidth | ( | oyImage_s * | image | ) |

Get the width in pixel.

Function oyImage_GetWidth

Version
  Oyranos: 0.5.0

Since
  2009/03/05 (Oyranos: 0.1.10)

Date
  2012/06/12

References oyOBJECT_IMAGE_S.

Referenced by oyConversion_CreateFromImage(), oyImage_PixelsToSamples(), and oyPixelAccess_s::oyPixelAccess_Create().

OYAPI oyImage_s *OYEXPORT oyImage_New | ( | oyObject_s | object | ) |

allocate a new Image object

Function oyImage_New

References oyOBJECT_OBJECT_S.

int oyImage_PixelsToSamples | ( | oyImage_s * | image,
|  | oyRectangle_s * | image_rectangle,
|  | oyRectangle_s * | pixel_rectangle
| ) |  |

Set sample rectangle from image rectangle.

Function oyImage_PixelsToSamples

Parameters

  [in] | image | a image
  [in] | image_rectangle | rectangle from image, optional
  [in,out] | pixel_rectangle | rectangle for pixel results

Returns
  error

Version
  Oyranos: 0.5.0

Date
  2012/10/05

Since
  2009/03/13 (Oyranos: 0.1.10)

References oyCHANS, oyImage_GetHeight(), oyImage_GetPixelLayout(), oyImage_GetWidth(), oyOBJECT_IMAGE_S, oyRectangle_s::oyRectangle_Round(), oyRectangle_s::oyRectangle_Scale(), oyRectangle_s::oyRectangle_SetByRectangle(), and oyRectangle_s::oyRectangle_SetGeo().

Referenced by oyImage_FillArray(), and oyImage_ReadArray().

int oyImage_ReadArray | ( | oyImage_s * | image,
|  | oyRectangle_s * | image_rectangle,
|  | oyArray2d_s * | array,
|  | oyRectangle_s * | array_rectangle
| ) |  |

read a array into a image

Function oyImage_ReadArray

The rectangle will be considered relative to the image. The given array should match that rectangle.

Version
  Oyranos: 0.1.10

Since
  2009/02/28 (Oyranos: 0.1.10)

Date
  2009/02/28

References oyCHANS, oyImage_PixelsToSamples(), oyLAYOUT, oyOBJECT_IMAGE_S, oyOBJECT_RECTANGLE_S, oyRectangle_s::oyRectangle_Scale(), oyRectangle_s::oyRectangle_SetByRectangle(), oyRectangle_s::oyRectangle_SetGeo(), oyRectangle_s::oyRectangle_Show(), oyToDataType_m, and oyUINT8.

Referenced by oyConversion_s::oyConversion_RunPixels().

OYAPI int OYEXPORT oyImage_Release | ( | oyImage_s ** | image | ) |

release and possibly deallocate a oyImage_s object

Function oyImage_Release

Parameters

  [in,out] | image | Image struct object

References oyOBJECT_IMAGE_S.

Referenced by oyConversion_s::oyConversion_CreateBasicPixelsFromBuffers(), oyConversion_s::oyConversion_RunPixels(), oyFilterPlug_s::oyFilterPlug_ResolveImage(), oyImage_Create(), oyImage_CreateForDisplay(), oyImage_FromFile(), and oyPixelAccess_s::oyPixelAccess_SetOutputImage().

int oyImage_SetCritical | ( | oyImage_s * | image,
|  | oyPixel_t | pixel_layout,
|  | oyProfile_s * | profile,
|  | oyOptions_s * | tags,
|  | int | width,
|  | int | height
| ) |  |

Set a image.

Function oyImage_SetCritical

Set critical options and check consitency.

Parameters

  [in,out] | image | the image
  [in] | pixel_layout | the new layout or pass 0
  [in] | profile | assign a new profile reinterprets colour, optional
  [in] | tags | new tags, replace any old tags, optional
  [in] | width | new width or pass -1
  [in] | height | new height or pass -1

Returns
  error

Version
  Oyranos: 0.5.0

Date
  2012/09/25

Since
  2007/12/19 (Oyranos: 0.1.8)

References oyArray2d_s::oyArray2d_Create(), oyImage_SetData(), oyLAYOUT, oyOBJECT_IMAGE_S, oyOptions_s::oyOptions_Copy(), oyOptions_s::oyOptions_Release(), oyProfile_s::oyProfile_Copy(), oyProfile_s::oyProfile_Release(), oyToChannels_m, and oyToDataType_m.

int oyImage_SetData | ( | oyImage_s * | image,
|  | oyStruct_s ** | pixel_data,
|  | oyImage_GetPoint_f | getPoint,
|  | oyImage_GetLine_f | getLine,
|  | oyImage_GetTile_f | getTile,
|  | oyImage_SetPoint_f | setPoint,
|  | oyImage_SetLine_f | setLine,
|  | oyImage_SetTile_f | setTile
| ) |  |

set a custom image data module

Function oyImage_SetData

This function allowes for exchanging of all the module components.

The pixel_data structure can hold in memory or mmap representations or file pointers. The according point, line and/or tile functions shall use the oyImage_s::pixel_data member to access the data and provide in this interface.

Parameters

  image | the image
  pixel_data | data struct will be moved in
  getPoint | interface function
  getLine | interface function
  getTile | interface function
  setPoint | interface function
  setLine | interface function
  setTile | interface function

Returns
  error

Version
  Oyranos: 0.1.8

Since
  2008/08/23 (Oyranos: 0.1.8)

Date
  2008/08/23

References oyOBJECT_IMAGE_S, and release.

Referenced by oyImage_Create(), and oyImage_SetCritical().

## Field Documentation

oyStruct_Copy_f oyImage_s::copy

copy function

Referenced by oyImage_GetPixelData(), and oyImage_GetUserData().

oyStruct_Release_f oyImage_s::release

release function

Referenced by oyImage_Create(), and oyImage_SetData().