-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathyCOLOR_priv.h
286 lines (210 loc) · 9.61 KB
/
yCOLOR_priv.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
/*============================----beg-of-source---============================*/
/*===[[ BEG_HEADER ]]=========================================================*/
/*345678901-12345678901-12345678901-12345678901-12345678901-12345678901-12345678901-12345678901-*/
/*===[[ ONE_LINERS ]]=========================================================*/
#define P_FOCUS "RS (run-time support)"
#define P_NICHE "as (aesthetics)"
#define P_SUBJECT "color palettes and control"
#define P_PURPOSE "predictably aesthetic color palettes and transformations"
#define P_NAMESAKE "iris-chrysopteros (golden-winged)"
#define P_HERITAGE "iris is the goddess of rainbow, color, and messenger of zeus"
#define P_IMAGERY "beautiful young maiden with golden wings and a coat of rainbows"
#define P_REASON ""
#define P_ONELINE P_NAMESAKE " " P_SUBJECT
#define P_BASENAME ""
#define P_FULLPATH ""
#define P_SUFFIX ""
#define P_CONTENT ""
#define P_SYSTEM "gnu/linux (powerful, ubiquitous, technical, and hackable)"
#define P_LANGUAGE "ansi-c (wicked, limitless, universal, and everlasting)"
#define P_CODESIZE "large (appoximately 10,000 slocl)"
#define P_DEPENDS "none"
#define P_AUTHOR "heatherlyrobert"
#define P_CREATED "2009-09"
#define P_VERMAJOR ""
#define P_VERMINOR ""
#define P_VERNUM "1.3h"
#define P_VERTXT "update for new DEBUG_ macro calls"
#define P_PRIORITY "direct, simple, brief, vigorous, and lucid (h.w. fowler)"
#define P_PRINCIPAL "[grow a set] and build your wings on the way down (r. bradbury)"
#define P_REMINDER "there are many better options, but i *own* every byte of this one"
/*===[[ END_HEADER ]]=========================================================*/
/*===[[ HEADER GUARD ]]=======================================================*/
#ifndef yCOLOR_PRIV
#define yCOLOR_PRIV loaded
#include "yCOLOR.h"
/*===[[ HEADERS ]]========================================*/
/*---(ansi-c standard)-------------------*/
#include <stdio.h> /* CLIBC standard input/output */
#include <stdlib.h> /* CLIBC standard general purpose */
#include <string.h> /* CLIBC standard string handling */
#include <math.h> /* CLIBC standard math functions */
/*---(X11 standard)----------------------*/
#include <X11/X.h> /* X11 standard overall file */
#include <X11/Xlib.h> /* X11 standard C API */
/*---(opengl standard)-------------------*/
#include <GL/gl.h> /* OPENGL standard primary header */
#include <GL/glx.h> /* OPENGL standard X11 integration */
/*---(custom core)-----------------------*/
#include <yURG.h> /* heatherly urgent processing */
#include <yLOG.h> /* heatherly program logging */
#include <ySTR.h> /* heatherly string processing */
#include <yVAR.h> /* CUSTOM heatherly variable testing */
#include <yVIHUB_solo.h>
/*===[[ RATIONAL LIMITS ]]====================================================*/
/* LEN_ is a length or size of something
* MIN_ is a minimum count
* DEF_ is a default count
* MAX_ is a maximum count
*
*/
/*3456789012+123456789012+123456789012+123456789012+123456789012+123456789012*/
/*===[[ TYPEDEFS ]]===========================================================*/
/*3456789012+123456789012+123456789012+123456789012+123456789012+123456789012-*/
/*---(basics)--------------------------*/
typedef signed char schar;
typedef unsigned char uchar;
typedef const char cchar;
typedef unsigned short ushort;
typedef signed long slong;
typedef unsigned long ulong;
typedef signed long long llong;
typedef unsigned long long ullong;
/*---(data structures)-----------------*/
typedef struct cYFONT tYFONT;
typedef struct cGLYPH tGLYPH;
typedef struct cPOINT tPOINT;
typedef struct cVERT tVERT;
/*===[[ RYB ARTISTS COLOR SPECTRUM ]]=========================================*/
#define MAX_COLOR 90
#define MAX_OPTION 16
extern const char s_RYB [MAX_COLOR][MAX_OPTION + 1][LEN_LABEL];
typedef struct cCOLORS tCOLORS;
struct cCOLORS {
char name [LEN_LABEL];
char hex [LEN_TERSE];
float pct;
float cut;
float red;
float grn;
float blu;
char norm [LEN_TERSE];
};
extern tCOLORS s_colors [MAX_COLOR];
typedef struct cPALETTE tPALETTE;
struct cPALETTE {
char hex [LEN_TERSE];
float red;
float grn;
float blu;
};
extern tPALETTE s_palette [MAX_COLOR];
/*---(color norming methods)-------------------------*/
#define MAX_NORMING 100
typedef struct cNORMING tNORMING;
struct cNORMING {
char abbr[8];
char name[35];
double red;
double grn;
double blu;
char is_value;
};
extern const tNORMING s_normings [MAX_NORMING];
typedef struct cACCESSOR tACCESSOR;
struct cACCESSOR {
/*---(primary info)-------------------*/
int wheel; /* color wheel variation */
int degree; /* color degree */
/*---(harmony info)-------------------*/
char harmony [LEN_LABEL]; /* complement, triad, etc */
int comp; /* color degree -- complement */
int neg; /* color degree -- accent A */
int pos; /* color degree -- accent B */
/*---(specific colors)----------------*/
int reg;
int repl;
int inpt;
int bad;
/*---(variant)------------------------*/
char sat_name [LEN_LABEL]; /* variant saturation name */
char val_name [LEN_LABEL]; /* variant value name */
float sat;
float val;
float acc;
/*---(display)------------------------*/
char names;
char extra;
char conf;
char refs;
char hexes;
/*---(done)---------------------------*/
};
extern tACCESSOR myCOLOR;
extern char s_use;
extern char s_scale;
extern int s_cset;
extern int s_tcolor;
extern int s_ncolor;
extern int s_cvariant;
extern int s_lvariant;
extern int s_nvariant;
extern int s_cnorming;
extern int s_nnorming;
extern const char s_newRYB [12][1][LEN_LABEL];
typedef struct cOGL tOPL;
struct cOGL {
short deg;
char name [LEN_LABEL];
char base [LEN_TERSE];
};
extern const tOPL g_full [700];
extern char unit_answer [ LEN_TEXT ];
char WHEEL_init (void);
char ycolor_har_init (void);
char HARM_seq (int a_seq, char *a_name, char *a_abbr, int *a_base, int *a_comp, int *a_neg, int *a_pos);
float yCOLOR__min3 (float a_one , float a_two, float a_three);
float yCOLOR__max3 (float a_one , float a_two, float a_three);
char DRAW_dot (char a_type, int a_deg);
char yCOLOR__palette_fresh (void);
char WHEEL_set (cchar *a_name);
char ycolor_degree (cint a_deg);
char ycolor_harmony (cchar *a_name);
char ycolor_value (cchar *a_name);
char VARS_seq (int a_seq, char *a_sat, char *a_val, char *a_abbr);
/*===[[ yCOLOR_conv.c ]]======================================================*/
/*345678901-12345678901-12345678901-12345678901-12345678901-12345678901-123456*/
int ycolor_deg2fix (cint a_deg);
char ycolor_deg2hex (cint a_deg, char *a_hex);
/*---(hex)------------------*/
char ycolor_hex2rgb (char *a_hex, float *a_red, float *a_grn, float *a_blu);
char ycolor_rgb2hex (char *a_hex, cfloat a_red, cfloat a_grn, cfloat a_blu);
/*===[[ yCOLOR_pal.c ]]=======================================================*/
/*345678901-12345678901-12345678901-12345678901-12345678901-12345678901-123456*/
/*---(program)--------------*/
char ycolor_palette_purge (void);
char ycolor_palette_init (void);
char ycolor_constant (void);
/*---(generate)-------------*/
char ycolor_palette__save (cint a_major, cint a_minor, cchar *a_hex);
/*---(report)---------------*/
char ycolor_palette_debug (void);
/*---(done)-----------------*/
/*===[[ yCOLOR_pal.c ]]=======================================================*/
/*345678901-12345678901-12345678901-12345678901-12345678901-12345678901-123456*/
char ycolor_unit__quiet (void);
char ycolor_unit__loud (void);
char ycolor_unit__end (void);
/*---(saturation)-----------*/
char ycolor_sat_init (void);
char ycolor_sat_by_abbr (cchar a_abbr);
char ycolor_sat_by_name (cchar *a_name);
char ycolor_saturation (cchar *a_name);
/*---(value)----------------*/
char ycolor_val_init (void);
char ycolor_val_by_abbr (cchar a_abbr);
char ycolor_val_by_name (cchar *a_name);
char ycolor_value (cchar *a_name);
/*---(done)-----------------*/
#endif
/*============================----end-of-source---============================*/