| 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
oyRectangle_s Struct Reference
Image Container API

Start with a simple rectangle. More...

`#include <oyRectangle_s.h>`

Inheritance diagram for oyRectangle_s:
Collaboration diagram for oyRectangle_s:

## Public Member Functions

OYAPI oyRectangle_s *OYEXPORT | oyRectangle_New (oyObject_s object)
| allocate a new Rectangle object More...
OYAPI oyRectangle_s *OYEXPORT | oyRectangle_Copy (oyRectangle_s *rectangle, oyObject_s object)
| copy or reference a Rectangle object More...
OYAPI int OYEXPORT | oyRectangle_Release (oyRectangle_s **rectangle)
| release and possibly deallocate a oyRectangle_s object More...
double | oyRectangle_CountPoints (oyRectangle_s *rectangle)
| Count number of points covered by this rectangle. More...
int | oyRectangle_Index (oyRectangle_s *rectangle, double x, double y)
| Return position inside rectangle, assuming rectangle size. More...
int | oyRectangle_IsEqual (oyRectangle_s *rectangle1, oyRectangle_s *rectangle2)
| compare More...
int | oyRectangle_IsInside (oyRectangle_s *test, oyRectangle_s *ref)
| Compare. More...
void | oyRectangle_MoveInside (oyRectangle_s *edit_rectangle, oyRectangle_s *ref)
| Trim edit_rectangle to ref extents. More...
oyRectangle_s * | oyRectangle_NewFrom (oyRectangle_s *ref, oyObject_s object)
| New from other rectangle. More...
oyRectangle_s * | oyRectangle_NewWith (double x, double y, double width, double height, oyObject_s object)
| New with geometry. More...
void | oyRectangle_Normalise (oyRectangle_s *edit_rectangle)
| Normalise swapped values for width and height. More...
int | oyRectangle_PointIsInside (oyRectangle_s *rectangle, double x, double y)
| Compare. More...
void | oyRectangle_Round (oyRectangle_s *edit_rectangle)
| Scale with origin in the top left corner. More...
void | oyRectangle_Scale (oyRectangle_s *edit_rectangle, double factor)
| Scale with origin in the top left corner. More...
void | oyRectangle_SetByRectangle (oyRectangle_s *edit_rectangle, oyRectangle_s *ref)
| Copy values. More...
void | oyRectangle_SetGeo (oyRectangle_s *edit_rectangle, double x, double y, double width, double height)
| Set geometry. More...
void | oyRectangle_GetGeo (oyRectangle_s *rectangle, double *x, double *y, double *width, double *height)
| get geometry More...
OYAPI double OYEXPORT | oyRectangle_GetGeo1 (oyRectangle_s *rectangle, int x_y_w_h)
| Get single geometry. More...
OYAPI double *OYEXPORT | oyRectangle_SetGeo1 (oyRectangle_s *rectangle, int x_y_w_h)
| Set single geometry. More...
const char * | oyRectangle_Show (oyRectangle_s *rect)
| Debug text. More...
void | oyRectangle_Trim (oyRectangle_s *edit_rectangle, oyRectangle_s *ref)
| Trim edit_rectangle to ref extents. 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

Start with a simple rectangle.

Version
  Oyranos: x.x.x

Since
  YYYY/MM/DD (Oyranos: x.x.x)

Date
  YYYY/MM/DD

## Member Function Documentation

OYAPI oyRectangle_s *OYEXPORT oyRectangle_Copy | ( | oyRectangle_s * | rectangle,
|  | oyObject_s | object
| ) |  |

copy or reference a Rectangle object

Function oyRectangle_Copy

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

Parameters

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

References oyOBJECT_RECTANGLE_S.

Referenced by oyPixelAccess_s::oyPixelAccess_GetOutputROI().

double oyRectangle_CountPoints | ( | oyRectangle_s * | rectangle | ) |

Count number of points covered by this rectangle.

Function oyRectangle_CountPoints

Version
  Oyranos: 0.1.10

Since
  2007/12/04 (Oyranos: 0.1.8)

Date
  2009/02/23

void oyRectangle_GetGeo | ( | oyRectangle_s * | rectangle,
|  | double * | x,
|  | double * | y,
|  | double * | width,
|  | double * | height
| ) |  |

get geometry

Version
  Oyranos: 0.4.0

Since
  2012/01/11 (Oyranos: 0.4.0)

Date
  2012/01/11

OYAPI double OYEXPORT oyRectangle_GetGeo1 | ( | oyRectangle_s * | rectangle,
|  | int | x_y_w_h
| ) |  |

Get single geometry.

Function oyRectangle_GetGeo1

Version
  Oyranos: 0.5.0

Since
  2012/09/06 (Oyranos: 0.5.0)

Date
  2012/09/06

Referenced by oyArray2d_s::oyArray2d_GetDataGeo1().

int oyRectangle_Index | ( | oyRectangle_s * | rectangle,
|  | double | x,
|  | double | y
| ) |  |

Return position inside rectangle, assuming rectangle size.

Function oyRectangle_Index

Since
  Oyranos: version 0.1.8

Date
  4 december 2007 (API 0.1.8)

int oyRectangle_IsEqual | ( | oyRectangle_s * | rectangle1,
|  | oyRectangle_s * | rectangle2
| ) |  |

compare

Since
  Oyranos: version 0.1.8

Date
  4 december 2007 (API 0.1.8)

int oyRectangle_IsInside | ( | oyRectangle_s * | test,
|  | oyRectangle_s * | ref
| ) |  |

Compare.

Function oyRectangle_IsInside

Version
  Oyranos: 0.1.10

Since
  2009/02/23 (Oyranos: 0.1.10)

Date
  2009/02/23

References oyRectangle_PointIsInside().

void oyRectangle_MoveInside | ( | oyRectangle_s * | edit_rectangle,
|  | oyRectangle_s * | ref
| ) |  |

Trim edit_rectangle to ref extents.

Function oyRectangle_MoveInside

Since
  Oyranos: version 0.1.8

Date
  4 december 2007 (API 0.1.8)

References oyRectangle_Normalise().

OYAPI oyRectangle_s *OYEXPORT oyRectangle_New | ( | oyObject_s | object | ) |

allocate a new Rectangle object

Function oyRectangle_New

References oyOBJECT_OBJECT_S.

Referenced by oyImage_s::oyImage_Create(), oyConversion_s::oyPixelAccess_ChangeRectangle(), oyRectangle_NewFrom(), and oyRectangle_NewWith().

oyRectangle_s * oyRectangle_NewFrom | ( | oyRectangle_s * | ref,
|  | oyObject_s | object
| ) |  |

New from other rectangle.

Function oyRectangle_NewFrom

Since
  Oyranos: version 0.1.8

Date
  4 december 2007 (API 0.1.8)

References oyRectangle_New(), and oyRectangle_SetByRectangle().

oyRectangle_s * oyRectangle_NewWith | ( | double | x,
|  | double | y,
|  | double | width,
|  | double | height,
|  | oyObject_s | object
| ) |  |

New with geometry.

Function oyRectangle_NewWith

Since
  Oyranos: version 0.1.8

Date
  4 december 2007 (API 0.1.8)

References oyRectangle_New(), and oyRectangle_SetGeo().

Referenced by oyImage_s::oyImage_Create().

void oyRectangle_Normalise | ( | oyRectangle_s * | edit_rectangle | ) |

Normalise swapped values for width and height.

Function oyRectangle_Normalise

Since
  Oyranos: version 0.1.8

Date
  4 december 2007 (API 0.1.8)

Referenced by oyRectangle_MoveInside(), and oyRectangle_Trim().

int oyRectangle_PointIsInside | ( | oyRectangle_s * | rectangle,
|  | double | x,
|  | double | y
| ) |  |

Compare.

Function oyRectangle_PointIsInside

Version
  Oyranos: 0.1.10

Since
  2007/12/04 (Oyranos: 0.1.8)

Date
  2009/02/23

Referenced by oyRectangle_IsInside().

OYAPI int OYEXPORT oyRectangle_Release | ( | oyRectangle_s ** | rectangle | ) |

release and possibly deallocate a oyRectangle_s object

Function oyRectangle_Release

Parameters

  [in,out] | rectangle | Rectangle struct object

References oyOBJECT_RECTANGLE_S.

Referenced by oyConversion_s::oyPixelAccess_ChangeRectangle().

void oyRectangle_Round | ( | oyRectangle_s * | edit_rectangle | ) |

Scale with origin in the top left corner.

Function oyRectangle_Round

Since
  Oyranos: version 0.1.8

Date
  4 december 2007 (API 0.1.8)

Referenced by oyImage_s::oyImage_PixelsToSamples().

void oyRectangle_Scale | ( | oyRectangle_s * | edit_rectangle,
|  | double | factor
| ) |  |

Scale with origin in the top left corner.

Function oyRectangle_Scale

Version
  Oyranos: 0.1.8

Since
  2007/12/04 (Oyranos: 0.1.8)

Date
  2007/12/04

Referenced by oyImage_s::oyImage_PixelsToSamples(), and oyImage_s::oyImage_ReadArray().

void oyRectangle_SetByRectangle | ( | oyRectangle_s * | edit_rectangle,
|  | oyRectangle_s * | ref
| ) |  |

Copy values.

Function oyRectangle_SetByRectangle

Version
  Oyranos: 0.1.8

Since
  2007/12/04 (Oyranos: 0.1.8)

Date
  2007/12/04

References oyRectangle_SetGeo().

Referenced by oyConversion_s::oyConversion_RunPixels(), oyImage_s::oyImage_PixelsToSamples(), oyImage_s::oyImage_ReadArray(), oyConversion_s::oyPixelAccess_ChangeRectangle(), and oyRectangle_NewFrom().

void oyRectangle_SetGeo | ( | oyRectangle_s * | edit_rectangle,
|  | double | x,
|  | double | y,
|  | double | width,
|  | double | height
| ) |  |

Set geometry.

Function oyRectangle_SetGeo

Version
  Oyranos: 0.1.8

Since
  2007/12/04 (Oyranos: 0.1.8)

Date
  2007/12/04

Referenced by oyImage_s::oyImage_CreateForDisplay(), oyImage_s::oyImage_FillArray(), oyImage_s::oyImage_PixelsToSamples(), oyImage_s::oyImage_ReadArray(), oyRectangle_NewWith(), and oyRectangle_SetByRectangle().

OYAPI double *OYEXPORT oyRectangle_SetGeo1 | ( | oyRectangle_s * | rectangle,
|  | int | x_y_w_h
| ) |  |

Set single geometry.

Function oyRectangle_SetGeo1

Version
  Oyranos: 0.5.0

Date
  2012/09/25

Since
  2012/09/25 (Oyranos: 0.5.0)

const char * oyRectangle_Show | ( | oyRectangle_s * | rect | ) |

Debug text.

Function oyRectangle_Show

Not so threadsafe

Version
  Oyranos: 0.1.8

Since
  2007/12/04 (Oyranos: 0.1.8)

Date
  2007/12/04

Referenced by oyImage_s::oyImage_ReadArray().

void oyRectangle_Trim | ( | oyRectangle_s * | edit_rectangle,
|  | oyRectangle_s * | ref
| ) |  |

Trim edit_rectangle to ref extents.

Function oyRectangle_Trim

Version
  Oyranos: 0.1.8

Since
  2007/12/04 (Oyranos: 0.1.8)

Date
  2007/12/04

References oyRectangle_Normalise().

## Field Documentation

oyStruct_Copy_f oyRectangle_s::copy

copy function

oyStruct_Release_f oyRectangle_s::release

release function