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

Start with a simple rectangle. More...

#include <oyRectangle_s.h>

Inheritance diagram for oyRectangle_s:
Inheritance graph
Collaboration diagram for oyRectangle_s:
Collaboration graph

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_soyRectangle_NewFrom (oyRectangle_s *ref, oyObject_s object)
 New from other rectangle. More...
 
oyRectangle_soyRectangle_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...
 

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

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]rectangleRectangle struct object
objectNULL - 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]rectangleRectangle 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.

oyObject_s oyRectangle_s::oy_

Oyranos internal object.

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

oyStruct_Release_f oyRectangle_s::release

Release function.

const oyOBJECT_e oyRectangle_s::type_

Type of object.

The struct type tells Oyranos how to interprete hidden fields.