Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma once
- #include "_video/window.hpp"
- #include <stdint.h>
- namespace kit {
- namespace color {
- //what GDI uses (save for the alpha channel)
- union ARGB { //4B; 0xAARRGGBB
- uint32_t v; //entire color [v]alue
- struct {
- uint8_t b;
- uint8_t g;
- uint8_t r;
- uint8_t a;
- };
- ARGB() : v(0) {}
- ARGB(uint32_t _v) : v(_v) {}
- ARGB(uint8_t _r, uint8_t _g,
- uint8_t _b, uint8_t _a) : r(_r), g(_g), b(_b), a(_a) {}
- };
- union ABGR { //4B; 0xAABBGGRR
- uint32_t v; //entire color [v]alue
- struct {
- uint8_t r;
- uint8_t g;
- uint8_t b;
- uint8_t a;
- };
- ABGR() : v(0) {}
- ABGR(uint32_t _v) : v(_v) {}
- ABGR(uint8_t _r, uint8_t _g,
- uint8_t _b, uint8_t _a) : r(_r), g(_g), b(_b), a(_a) {}
- };
- };
- namespace shape {
- struct point { //8B
- int32_t x, y;
- point() : x(0), y(0) {}
- point(int32_t _x, int32_t _y) : x(_x), y(_y) {}
- };
- struct rect { //16B
- int32_t x, y; //x & y position of the rectangle's top-left corner
- int32_t w, h; //the rectangle's width & height
- point() : x(0), y(0), w(0), h(0) {}
- point(int32_t _x, int32_t _y) : x(_x), y(_y) {}
- point(int32_t _x, int32_t _y,
- int32_t _w, int32_t _h) : x(_x), y(_y), w(_w), h(_h) {}
- };
- struct fpoint { //8B
- float x, y;
- point() : x(0.0f), y(0.0f) {}
- point(float _x, float _y) : x(_x), y(_y) {}
- };
- struct frect { //16B
- float x, y; //x & y position of rectangle's top-left corner
- float w, h; //the rectangle's width & height
- point() : x(0.0f), y(0.0f), w(0.0f), h(0.0f) {}
- point(float _x, float _y) : x(_x), y(_y) {}
- point(float _x, float _y,
- float _w, float _h) : x(_x), y(_y), w(_w), h(_h) {}
- };
- struct dpoint { //16B
- double x, y;
- point() : x(0.0), y(0.0) {}
- point(double _x, double _y) : x(_x), y(_y) {}
- };
- struct drect { //32B
- double x, y; //x & y position of rectangle's top-left corner
- double w, h; //the rectangle's width & height
- point() : x(0.0), y(0.0), w(0.0), h(0.0) {}
- point(double _x, double _y) : x(_x), y(_y) {}
- point(double _x, double _y,
- double _w, double _h) : x(_x), y(_y), w(_w), h(_h) {}
- };
- };
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement