oyRectangle_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 Member Functions | Data Fields
oyRectangle_s Struct Reference
Conversion » Image Containers

A simple rectangle of double values. 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...
| oyRectangle_Copy
| 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_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 simple rectangle of double values.

## Member Function Documentation

## ◆ oyRectangle_Copy()

oyRectangle_Copy

Copy or Reference a Rectangle object.

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

Referenced by oyPixelAccess_s::oyPixelAccess_GetArrayROI().

## ◆ oyRectangle_CountPoints()

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

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

## ◆ oyRectangle_GetGeo()

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

## ◆ oyRectangle_GetGeo1()

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

## ◆ oyRectangle_Index()

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)

## ◆ oyRectangle_IsEqual()

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

compare

Since
  Oyranos: version 0.1.8

Date
  4 december 2007 (API 0.1.8)

## ◆ oyRectangle_IsInside()

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

## ◆ oyRectangle_MoveInside()

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

## ◆ oyRectangle_New()

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_FillArray(), oyImage_s::oyImage_RoiToSamples(), oyImage_s::oyImage_SamplesToRoi(), oyPixelAccess_s::oyPixelAccess_PixelsToRoi(), oyPixelAccess_s::oyPixelAccess_RoiToPixels(), oyPixelAccess_s::oyPixelAccess_SetArrayFocus(), oyRectangle_NewFrom(), and oyRectangle_NewWith().

## ◆ oyRectangle_NewFrom()

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

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

## ◆ oyRectangle_Normalise()

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

## ◆ oyRectangle_PointIsInside()

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

## ◆ oyRectangle_Release()

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 oyImage_s::oyImage_FillArray().

## ◆ oyRectangle_Round()

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_RoiToSamples(), oyPixelAccess_s::oyPixelAccess_PixelsToRoi(), oyPixelAccess_s::oyPixelAccess_RoiToPixels(), and oyPixelAccess_s::oyPixelAccess_SetArray().

## ◆ oyRectangle_Scale()

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_RoiToSamples(), oyImage_s::oyImage_SamplesToRoi(), oyPixelAccess_s::oyPixelAccess_PixelsToRoi(), oyPixelAccess_s::oyPixelAccess_RoiToPixels(), oyPixelAccess_s::oyPixelAccess_SetArray(), and oyPixelAccess_s::oyPixelAccess_Show().

## ◆ oyRectangle_SetByRectangle()

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 oyImage_s::oyImage_PixelsToSamples(), oyImage_s::oyImage_RoiToSamples(), oyImage_s::oyImage_SamplesToPixels(), oyImage_s::oyImage_SamplesToRoi(), oyPixelAccess_s::oyPixelAccess_ChangeRectangle(), oyPixelAccess_s::oyPixelAccess_PixelsToRoi(), oyPixelAccess_s::oyPixelAccess_RoiToPixels(), oyPixelAccess_s::oyPixelAccess_Show(), and oyRectangle_NewFrom().

## ◆ oyRectangle_SetGeo()

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_RoiToSamples(), oyImage_s::oyImage_SamplesToRoi(), oyPixelAccess_s::oyPixelAccess_PixelsToRoi(), oyPixelAccess_s::oyPixelAccess_RoiToPixels(), oyRectangle_NewWith(), and oyRectangle_SetByRectangle().

## ◆ oyRectangle_SetGeo1()

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)

## ◆ oyRectangle_Show()

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

Debug text.

Function oyRectangle_Show

This function is not not thread safe.

Version
  Oyranos: 0.9.6

Date
  2016/04/04

Since
  2007/12/04 (Oyranos: 0.1.8)

Referenced by oyImage_s::oyImage_FillArray().

## ◆ oyRectangle_Trim()

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

## ◆ copy

oyStruct_Copy_f oyRectangle_s::copy

Copy function.

## ◆ oy_

oyObject_s oyRectangle_s::oy_

Oyranos internal object.

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

## ◆ release

oyStruct_Release_f oyRectangle_s::release

Release function.

## ◆ type_

const oyOBJECT_e oyRectangle_s::type_

Type of object.

The struct type tells Oyranos how to interprete hidden fields.