oyImage_s Struct Reference
Description: C source code API documentation for the Oyranos project.
Keywords: Oyranos,Color Management,Color Management,ICC,CMS,C,doxygen,API,documentation

| Oyranos Color Management System API - Version 0.9.6

Public Types | Public Member Functions | Data Fields
oyImage_s Struct Reference
Conversion » Image Containers

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 Types
typedef oyPointer(* | oyImage_GetPoint_f) (oyImage_s *image, int point_x, int point_y, int channel, int *is_allocated)
| pixel accessor More...
typedef int(* | oyImage_SetPoint_f) (oyImage_s *image, int point_x, int point_y, int channel, oyPointer data)
| pixel setter More...

## Public Member Functions
OYAPI oyImage_s *OYEXPORT | oyImage_New (oyObject_s object)
| allocate a new Image object More...
| oyImage_Copy
| Copy or Reference a Image object. More...
OYAPI int OYEXPORT | oyImage_Release (oyImage_s **image)
| release and possibly deallocate a oyImage_s object More...
oyPointer | oyImage_GetArray2dPointContinous (oyImage_s *image, int point_x, int point_y, int channel, int *is_allocated)
| Continous layout pixel accessor. More...
oyPointer | oyImage_GetArray2dLineContinous (oyImage_s *image, int point_y, int *height, int channel, int *is_allocated)
| Continous layout line accessor. More...
int | oyImage_SetArray2dPointContinous (oyImage_s *image, int point_x, int point_y, int channel, oyPointer data)
| Continous layout pixel accessor. More...
oyImage_s * | oyImage_Create (int width, int height, oyPointer pixels, 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, int icc_profile_flags, 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...
| oyImage_WritePPM
| write buffer to portable pix map format 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...
oyImage_SetPoint_f | oyImage_GetSetPointF (oyImage_s *image)
| Get the point function. More...
oyImage_SetLine_f | oyImage_GetSetLineF (oyImage_s *image)
| Get the Line function. More...
oyStruct_s * | oyImage_GetUserData (oyImage_s *image)
| Get the user data. More...
int | oyImage_RoiToSamples (oyImage_s *image, oyRectangle_s *roi, oyRectangle_s **sample_rectangle)
| Set sample rectangle from image rectangle. More...
int | oyImage_SamplesToRoi (oyImage_s *image, oyRectangle_s *sample_rectangle, oyRectangle_s **roi)
| Set rectangle in image dimension from samples. More...
int | oyImage_SamplesToPixels (oyImage_s *image, oyRectangle_s *sample_rectangle, oyRectangle_s *pixel_rectangle)
| Set rectangle in pixel dimension from samples. More...
int | oyImage_PixelsToSamples (oyImage_s *image, oyRectangle_s *pixel_rectangle, oyRectangle_s *sample_rectangle)
| Set rectangle in sample dimension from pixels. More...
int | oyImage_FromFile (const char *file_name, int icc_profile_flags, oyImage_s **image, oyObject_s obj)
| generate a Oyranos image from a file name More...
int | oyImage_ToFile (oyImage_s *image, const char *file_name, oyOptions_s *opts)
| write a Oyranos image to a file name 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...
| 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...
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

A reference struct to gather information for image transformation.

as we don't 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

Create a basic image with the pixel owned by the caller use oyImage_Create().

To set a image data module use oyImage_SetData().

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

Examples:
  image2pdf.c, image_display.cpp, and oyranos_cmm_oJPG.c.

## Member Typedef Documentation

## ◆ oyImage_GetPoint_f

typedef oyPointer(* oyImage_GetPoint_f) (oyImage_s *image, int point_x, int point_y, int channel, int *is_allocated)

pixel accessor

Typedef oyImage_GetPoint_f

Parameters

  [in,out] | image | the image object
  [in] | point_x | the data location in x direction
  [in] | point_y | the data location in y direction
  [in] | channel | the nth channel will is requested -1 means to request all channels, note that can be an expensive call for non continous pixel layouts
  [out] | is_allocated | are the points always newly allocated?

Version
  Oyranos: 0.1.8

Since
  2008/06/26 (Oyranos: 0.1.8)

Date
  2008/06/26

## ◆ oyImage_SetPoint_f

typedef int(* oyImage_SetPoint_f) (oyImage_s *image, int point_x, int point_y, int channel, oyPointer data)

pixel setter

Typedef oyImage_SetPoint_f

Parameters

  [in,out] | image | the image object
  [in] | point_x | the data location in x direction
  [in] | point_y | the data location in y direction
  [in] | channel | the nth channel will is requested -1 means to request all channels, note that can be an expensive call for non continous pixel layouts
  [out] | data | the data to be copied into the image

Version
  Oyranos: 0.1.8

Since
  2008/06/26 (Oyranos: 0.1.8)

Date
  2008/06/26

## Member Function Documentation

## ◆ oyImage_Copy()

oyImage_Copy

Copy or Reference a Image object.

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

Referenced by oyPixelAccess_s::oyPixelAccess_GetOutputImage(), and oyPixelAccess_s::oyPixelAccess_SetOutputImage().

## ◆ oyImage_Create()

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

collect infos about a image

Create a image description and access object. The passed pixels 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] | pixels | pointer to the data buffer
  [in] | pixel_layout | i.e. oyTYPE_123_16 for 16-bit RGB data
  [in] | profile | color space description
  [in] | object | the optional base

Version
  Oyranos: 0.1.8

Since
  2007/11/00 (Oyranos: 0.1.8)

Date
  2008/08/23

Examples:
  image2pdf.c, and oyranos_cmm_oJPG.c.

References oyArray2d_s::oyArray2d_Create(), oyCOFF, oyImage_GetArray2dLineContinous(), oyImage_GetArray2dPointContinous(), oyImage_Release(), oyImage_SetArray2dPointContinous(), oyImage_SetData(), oyProfile_s::oyProfile_Copy(), oyRectangle_s::oyRectangle_NewWith(), oyToChannels_m, and oyToDataType_m.

Referenced by oyConversion_s::oyConversion_CreateBasicPixelsFromBuffers(), and oyImage_CreateForDisplay().

## ◆ 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,
|  | int | icc_profile_flags,
|  | 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] | icc_profile_flags | profile selection flags, see oyProfile_FromFile()
  [in] | object | the optional base

Version
  Oyranos: 0.9.6

Date
  2014/04/06

Since
  2007/10/00 (Oyranos: 0.1.8)

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

## ◆ oyImage_FillArray()

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 oyImage_GetWidth(image) == 1.0 unit. The rectangle is 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. During function execution the array might have a changed focus. Focus is restored before return.
  [in] | array_rectangle | The array rectangle in oyImage_GetWidth(image) == 1.0 unit. 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.6

Date
  2016/09/06

Since
  2008/10/02 (Oyranos: 0.1.8)

References oy_debug, oyArray2d_s::oyArray2d_Show(), oyCHANS, oyDataTypeGetSize(), oyImage_GetPixelLayout(), oyImage_RoiToSamples(), oyImage_SamplesToPixels(), oyLAYOUT, oyOBJECT_IMAGE_S, oyOBJECT_RECTANGLE_S, oyRectangle_s::oyRectangle_New(), oyRectangle_s::oyRectangle_Release(), oyRectangle_s::oyRectangle_SetGeo(), oyRectangle_s::oyRectangle_Show(), oyToDataType_m, and oyUINT8.

## ◆ oyImage_FromFile()

int oyImage_FromFile | ( | const char * | file_name,
|  | int | icc_profile_flags,
|  | oyImage_s ** | image,
|  | oyObject_s | obj
| ) |  |

generate a Oyranos image from a file name

Function oyImage_FromFile

The file name will be stored inside the image's tags.

oyOptions_s * tags = oyImage_GetTags( image );
const char * filename = oyOptions_FindString( tags,
"//" OY_TYPE_STD "/file_read/filename",
0 );
oyOptions_Release( &tags );

Parameters

  [in] | file_name | input
  [in] | icc_profile_flags | profile selection flags, see oyProfile_FromFile()
  [out] | image | output
  [in] | obj | Oyranos object (optional)

Returns
  >0 == error, <0 == issue or zero

Version
  Oyranos: 0.9.6

Date
  2014/04/06

Since
  2012/04/21 (Oyranos: 0.5.0)

Examples:
  image2pdf.c.

References OY_CREATE_NEW, OY_SELECT_FILTER, OY_TYPE_STD, oyConversion_s::oyConversion_GetImage(), oyConversion_s::oyConversion_New(), oyConversion_s::oyConversion_Set(), oyFilterNode_s::oyFilterNode_Connect(), oyFilterNode_s::oyFilterNode_GetOptions(), oyFilterNode_s::oyFilterNode_NewWith(), oyOptions_s::oyOptions_Release(), oyOptions_s::oyOptions_SetFromInt(), and oyOptions_s::oyOptions_SetFromText().

## ◆ oyImage_GetArray2dLineContinous()

oyPointer oyImage_GetArray2dLineContinous | ( | oyImage_s * | image,
|  | int | point_y,
|  | int * | height,
|  | int | channel,
|  | int * | is_allocated
| ) |  |

Continous layout line accessor.

Function oyImage_GetArray2dLineContinous

Will be used by default.

Version
  Oyranos: 0.1.8

Date
  2008/08/21

Since
  2008/08/23 (Oyranos: 0.1.8)

References oy_debug.

Referenced by oyImage_Create().

## ◆ oyImage_GetArray2dPointContinous()

oyPointer oyImage_GetArray2dPointContinous | ( | oyImage_s * | image,
|  | int | point_x,
|  | int | point_y,
|  | int | channel,
|  | int * | is_allocated
| ) |  |

Continous layout pixel accessor.

Function oyImage_GetArray2dPointContinous

Will be used by default.

See also
  oyImage_GetPoint_f()

Version
  Oyranos: 0.9.5

Date
  2013/07/21

Since
  2008/06/26 (Oyranos: 0.1.8)

References oyCHAN0, oyCHANS, and oyDATA_SIZE.

Referenced by oyImage_Create().

## ◆ oyImage_GetChannelType()

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.

## ◆ oyImage_GetHeight()

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

Examples:
  image2pdf.c, and oyranos_cmm_oJPG.c.

References oyOBJECT_IMAGE_S.

Referenced by oyImage_RoiToSamples(), oyImage_SamplesToRoi(), oyPixelAccess_s::oyPixelAccess_PixelsToRoi(), and oyPixelAccess_s::oyPixelAccess_RoiToPixels().

## ◆ oyImage_GetLineF()

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.

## ◆ oyImage_GetPixelData()

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.

## ◆ oyImage_GetPixelLayout()

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

Examples:
  oyranos_cmm_oJPG.c.

References oyOBJECT_IMAGE_S.

Referenced by oyImage_FillArray(), oyImage_PixelsToSamples(), oyImage_RoiToSamples(), oyImage_SamplesToPixels(), oyImage_SamplesToRoi(), oyPixelAccess_s::oyPixelAccess_ChangeRectangle(), oyPixelAccess_s::oyPixelAccess_PixelsToRoi(), oyPixelAccess_s::oyPixelAccess_RoiToPixels(), oyPixelAccess_s::oyPixelAccess_SetArray(), oyPixelAccess_s::oyPixelAccess_SetArrayFocus(), and oyPixelAccess_s::oyPixelAccess_Show().

## ◆ oyImage_GetPointF()

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.

## ◆ oyImage_GetProfile()

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().

## ◆ oyImage_GetSetLineF()

oyImage_SetLine_f oyImage_GetSetLineF | ( | oyImage_s * | image | ) |

Get the Line function.

Function oyImage_GetSetLineF

Version
  Oyranos: 0.9.5

Since
  2013/07/22 (Oyranos: 0.9.5)

Date
  2012/07/22

## ◆ oyImage_GetSetPointF()

oyImage_SetPoint_f oyImage_GetSetPointF | ( | oyImage_s * | image | ) |

Get the point function.

Function oyImage_GetSetPointF

Version
  Oyranos: 0.9.5

Since
  2013/07/22 (Oyranos: 0.9.5)

Date
  2012/07/22

References oyOBJECT_IMAGE_S.

## ◆ oyImage_GetSubPositioning()

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.

## ◆ oyImage_GetTags()

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

Examples:
  oyranos_cmm_oJPG.c.

References oyOBJECT_IMAGE_S, and oyOptions_s::oyOptions_Copy().

Referenced by oyImage_ToFile().

## ◆ oyImage_GetUserData()

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.

## ◆ oyImage_GetWidth()

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

Examples:
  image2pdf.c, and oyranos_cmm_oJPG.c.

References oyOBJECT_IMAGE_S.

Referenced by oyImage_RoiToSamples(), oyImage_SamplesToRoi(), oyPixelAccess_s::oyPixelAccess_ChangeRectangle(), oyPixelAccess_s::oyPixelAccess_PixelsToRoi(), oyPixelAccess_s::oyPixelAccess_RoiToPixels(), oyPixelAccess_s::oyPixelAccess_SetArray(), oyPixelAccess_s::oyPixelAccess_Show(), and oyPixelAccess_s::oyPixelAccess_SynchroniseROI().

## ◆ oyImage_New()

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

allocate a new Image object

Function oyImage_New

References oyOBJECT_OBJECT_S.

## ◆ oyImage_PixelsToSamples()

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

Set rectangle in sample dimension from pixels.

Function oyImage_PixelsToSamples

Parameters

  [in] | image | a image
  [in] | pixel_rectangle | rectangle in pixel unit; optional
  [in,out] | sample_rectangle | rectangle result of image in samples for x,width and pixel for y,height

Returns
  error

Version
  Oyranos: 0.9.6

Date
  2016/09/25

Since
  2016/09/25 (Oyranos: 0.9.6)

References oyCHANS, oyImage_GetPixelLayout(), oyOBJECT_IMAGE_S, oyRectangle_s::oyRectangle_SetByRectangle(), and type_.

Referenced by oyPixelAccess_s::oyPixelAccess_SetArrayFocus().

## ◆ 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.

Parameters

  [in] | image | a image
  [in] | image_rectangle | rectangle from image, in oyImage_GetWidth() == 1.0 unit; optional
  [in,out] | array | the array to read from
  [in] | array_rectangle | rectangle for array, in oyImage_GetWidth() == 1.0 unit; optional

Returns
  error

Version
  Oyranos: 0.1.10

Since
  2009/02/28 (Oyranos: 0.1.10)

Date
  2009/02/28

References oyCHANS, oyDataTypeGetSize(), oyImage_RoiToSamples(), oyLAYOUT, oyOBJECT_IMAGE_S, oyOBJECT_RECTANGLE_S, oyToDataType_m, and oyUINT8.

## ◆ oyImage_Release()

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

Examples:
  image2pdf.c, and oyranos_cmm_oJPG.c.

References oyOBJECT_IMAGE_S.

Referenced by oyConversion_s::oyConversion_CreateBasicPixelsFromBuffers(), oyImage_Create(), oyImage_CreateForDisplay(), and oyPixelAccess_s::oyPixelAccess_SetOutputImage().

## ◆ oyImage_RoiToSamples()

int oyImage_RoiToSamples | ( | oyImage_s * | image,
|  | oyRectangle_s * | roi,
|  | oyRectangle_s ** | sample_rectangle
| ) |  |

Set sample rectangle from image rectangle.

Function oyImage_RoiToSamples

Parameters

  [in] | image | a image
  [in] | roi | rectangle from image in oyImage_GetWidth() == 1.0 unit; optional
  [in,out] | sample_rectangle | rectangle for sample results in samples for x,width and pixel for y,height

Returns
  error

Version
  Oyranos: 0.9.6

Date
  2016/09/24

Since
  2009/03/13 (Oyranos: 0.1.10)

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

Referenced by oyImage_FillArray(), and oyImage_ReadArray().

## ◆ oyImage_SamplesToPixels()

int oyImage_SamplesToPixels | ( | oyImage_s * | image,
|  | oyRectangle_s * | sample_rectangle,
|  | oyRectangle_s * | pixel_rectangle
| ) |  |

Set rectangle in pixel dimension from samples.

Function oyImage_SamplesToPixels

Parameters

  [in] | image | a image
  [in] | sample_rectangle | rectangle in samples for x,width and pixel for y,height; optional
  [in,out] | pixel_rectangle | rectangle result of image in pixel unit

Returns
  error

Version
  Oyranos: 0.9.6

Date
  2016/09/25

Since
  2016/09/25 (Oyranos: 0.9.6)

References oyCHANS, oyImage_GetPixelLayout(), oyOBJECT_IMAGE_S, oyRectangle_s::oyRectangle_SetByRectangle(), and type_.

Referenced by oyImage_FillArray().

## ◆ oyImage_SamplesToRoi()

int oyImage_SamplesToRoi | ( | oyImage_s * | image,
|  | oyRectangle_s * | sample_rectangle,
|  | oyRectangle_s ** | roi
| ) |  |

Set rectangle in image dimension from samples.

Function oyImage_SamplesToRoi

Parameters

  [in] | image | a image
  [in] | sample_rectangle | rectangle in samples for x,width and pixel for y,height; optional
  [in,out] | roi | rectangle result of image in oyImage_GetWidth() == 1.0 unit

Returns
  error

Version
  Oyranos: 0.9.6

Date
  2016/09/25

Since
  2016/09/25 (Oyranos: 0.9.6)

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

## ◆ oyImage_SetArray2dPointContinous()

int oyImage_SetArray2dPointContinous | ( | oyImage_s * | image,
|  | int | point_x,
|  | int | point_y,
|  | int | channel,
|  | oyPointer | data
| ) |  |

Continous layout pixel accessor.

Function oyImage_SetArray2dPointContinous

Will be used by default.

See also
  oyImage_SetPoint_f()

Version
  Oyranos: 0.9.5

Date
  2013/07/21

Since
  2009/02/22 (Oyranos: 0.1.10)

References oyCHAN0, oyCHANS, oyDATA_SIZE, oyDataTypeGetSize(), oyLAYOUT, oyToChannels_m, and oyToDataType_m.

Referenced by oyImage_Create().

## ◆ oyImage_SetCritical()

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 color, 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)

Examples:
  oyranos_cmm_oJPG.c.

References oy_debug, and oyOBJECT_IMAGE_S.

## ◆ oyImage_SetData()

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

Referenced by oyImage_Create().

## ◆ oyImage_ToFile()

int oyImage_ToFile | ( | oyImage_s * | image,
|  | const char * | file_name,
|  | oyOptions_s * | opts
| ) |  |

write a Oyranos image to a file name

Function oyImage_ToFile

Parameters

  [in] | image | input
  [in] | file_name | output
  [in] | opts | options for file_write node

Returns
  >0 == error, <0 == issue or zero

Version
  Oyranos: 0.5.0

Since
  2012/07/18 (Oyranos: 0.5.0)

Date
  2012/07/18

References OY_CREATE_NEW, OY_SELECT_FILTER, OY_TYPE_STD, oyBOOLEAN_UNION, oyConversion_s::oyConversion_New(), oyConversion_s::oyConversion_Release(), oyConversion_s::oyConversion_RunPixels(), oyConversion_s::oyConversion_Set(), oyFilterNode_s::oyFilterNode_Connect(), oyFilterNode_s::oyFilterNode_GetOptions(), oyFilterNode_s::oyFilterNode_NewWith(), oyFilterNode_s::oyFilterNode_Release(), oyFilterNode_s::oyFilterNode_SetData(), oyImage_GetTags(), oyOptions_s::oyOptions_CopyFrom(), oyOptions_s::oyOptions_Release(), and oyOptions_s::oyOptions_SetFromText().

## ◆ oyImage_WritePPM()

oyImage_WritePPM

write buffer to portable pix map format

Parameters

  [in] | image | the image
  [in] | file_name | a writeable file name, The file can contain "%d" to include the image ID.
  [in] | free_text | A text to include as comment.

Version
  Oyranos: 0.3.1

Date
  2011/05/12

Since
  2008/10/07 (Oyranos: 0.1.8)

## Field Documentation

## ◆ copy

oyStruct_Copy_f oyImage_s::copy

Copy function.

Referenced by oyImage_GetPixelData(), and oyImage_GetUserData().

## ◆ oy_

oyObject_s oyImage_s::oy_

Oyranos internal object.

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

Examples:
  image_display.cpp.

## ◆ release

oyStruct_Release_f oyImage_s::release

Release function.

## ◆ type_

const oyOBJECT_e oyImage_s::type_

Type of object.

The struct type tells Oyranos how to interprete hidden fields.

Referenced by oyImage_PixelsToSamples(), oyImage_RoiToSamples(), oyImage_SamplesToPixels(), and oyImage_SamplesToRoi().