Vuo  2.4.1
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
47
51static inline VuoRectangle VuoRectangle_make(float centerX, float centerY, float width, float height) __attribute__((const));
52static inline VuoRectangle VuoRectangle_make(float centerX, float centerY, float width, float height)
53{
54 return (VuoRectangle){ { centerX, centerY }, { width, height } };
55}
56
60static inline VuoRectangle VuoRectangle_makeTopLeft(float leftX, float topY, float width, float height) __attribute__((const));
61static inline VuoRectangle VuoRectangle_makeTopLeft(float leftX, float topY, float width, float height)
62{
63 return (VuoRectangle){ { leftX + width / 2.f, topY + height / 2.f }, { width, height } };
64}
65
66bool VuoRectangle_isPointInside(VuoRectangle r, VuoPoint2d p);
67
70