Vuo  2.4.0
VuoRectangle.h
Go to the documentation of this file.
1
10#pragma once
11
12#include "VuoPoint2d.h"
13
25typedef struct
26{
27 VuoPoint2d center;
28 VuoPoint2d size;
30
34
35#define VuoRectangle_SUPPORTS_COMPARISON
38
40
48
52static inline VuoRectangle VuoRectangle_make(float centerX, float centerY, float width, float height) __attribute__((const));
53static inline VuoRectangle VuoRectangle_make(float centerX, float centerY, float width, float height)
54{
55 return (VuoRectangle){ { centerX, centerY }, { width, height } };
56}
57
61static inline VuoRectangle VuoRectangle_makeTopLeft(float leftX, float topY, float width, float height) __attribute__((const));
62static inline VuoRectangle VuoRectangle_makeTopLeft(float leftX, float topY, float width, float height)
63{
64 return (VuoRectangle){ { leftX + width / 2.f, topY + height / 2.f }, { width, height } };
65}
66
67bool VuoRectangle_isPointInside(VuoRectangle r, VuoPoint2d p);
68
71