picofuse-objc

NXGeometry.h
Go to the documentation of this file.
1 
5 #pragma once
6 #include <stdint.h>
7 
12 typedef struct {
13  int16_t x;
14  int16_t y;
15 } NXPoint;
16 
21 typedef struct {
22  uint16_t width;
23  uint16_t height;
24 } NXSize;
25 
30 typedef struct {
33 } NXRect;
34 
39 static inline NXPoint NXMakePoint(int16_t x, int16_t y) {
40  NXPoint point = {x, y};
41  return point;
42 }
43 
48 static inline NXSize NXMakeSize(uint16_t width, uint16_t height) {
49  NXSize size = {width, height};
50  return size;
51 }
52 
57 static inline NXRect NXMakeRect(int16_t x, int16_t y, uint16_t width, uint16_t height) {
58  NXRect rect = {{x, y}, {width, height}};
59  return rect;
60 }
NXSize size
Its size.
Definition: NXGeometry.h:32
A size, in pixels.
Definition: NXGeometry.h:21
static NXRect NXMakeRect(int16_t x, int16_t y, uint16_t width, uint16_t height)
Returns a rectangle.
Definition: NXGeometry.h:57
uint16_t width
Width.
Definition: NXGeometry.h:22
int16_t x
Pixels from the left.
Definition: NXGeometry.h:13
static NXSize NXMakeSize(uint16_t width, uint16_t height)
Returns a size.
Definition: NXGeometry.h:48
uint16_t height
Height.
Definition: NXGeometry.h:23
NXPoint origin
Its top left.
Definition: NXGeometry.h:31
int16_t y
Pixels from the top.
Definition: NXGeometry.h:14
static NXPoint NXMakePoint(int16_t x, int16_t y)
Returns a point.
Definition: NXGeometry.h:39
A point, in pixels from the top left.
Definition: NXGeometry.h:12
A rectangle: its top left, and its size.
Definition: NXGeometry.h:30