acme
Foundational cross-platform layer of the ca2 framework
Loading...
Searching...
No Matches
_configuration.h
1// Created by camilo on 2022-11-08 23:35 <3ThomasBorregaardSorensen!!
2#pragma once
3
4
5#include "color_indexes.h"
6
7
8//#if defined(WINDOWS) || defined(LINUX) || defined(__i386__) || defined(FREEBSD) || defined(OPENBSD)
9//
10//
11//#define IMAGE_ARGB(a, r, g, b) ((::color::color)((lower_byte(b)|((::u16)(lower_byte(g))<<8))|(((::u32)lower_byte(r))<<16)|(((::u32)lower_byte(a))<<24)))
12//
13//
14//#define image_r_value(rgb) (lower_byte((rgb)>>16))
15//#define image_g_value(rgb) (lower_byte((rgb)>>8))
16//#define image_b_value(rgb) (lower_byte((rgb)))
17//#define image_a_value(rgb) (lower_byte((rgb)>>24))
18//
19//
20//#else
21//
22//
23//#define IMAGE_ARGB(a, r, g, b) ((::color::color)((lower_byte(r)|((::u16)(lower_byte(g))<<8))|(((::u32)lower_byte(b))<<16)|(((::u32)lower_byte(a))<<24)))
24//
25//
26//#define image_r_value(rgb) (lower_byte((rgb)))
27//#define image_g_value(rgb) (lower_byte((rgb)>>8))
28//#define image_b_value(rgb) (lower_byte((rgb)>>16))
29//#define image_a_value(rgb) (lower_byte((rgb)>>24))
30//
31//
32//#endif
33
34
35#ifdef __APPLE__
36
37
38#define IMAGE_Y(y, h) ((h) - (y) - 1)
39
40
41#else
42
43
44#define IMAGE_Y(y, h) (y)
45
46
47#endif
48
49
50#if defined(WINDOWS) || defined(LINUX) || defined(__i386__) || defined(FREEBSD) || defined(OPENBSD)
51
52
53constexpr inline color_indexes common_system_image_color_indexes() { return bgra_indexes(); }
54
55#elif defined(__APPLE__)
56
57constexpr inline color_indexes common_system_image_color_indexes() { return rgba_indexes(); }
58
59#else
60
61
62constexpr inline color_indexes common_system_image_color_indexes() { return rgba_indexes(); }
63
64
65#endif
66
67
68
Definition color_indexes.h:9