Go to the documentation of this file.
17 static inline unsigned char
18 lighten (
unsigned char value,
float power)
21 float t = (float) val * log10f(power) / 2.0F;
25 return std::min(val, 255);
33 auto *color = (
unsigned char *) col;
34 *color =
lighten (*color, power);
36 *color =
lighten (*color, power);
38 *color =
lighten (*color, power);
40 *color =
lighten (*color, power);
48 for (
int i = 0; i < 512; i++) {
49 l[i].
x = ((float) i * rx) / 512.0F;
55 for (
int i = 0; i < 512; i++) {
56 l[i].
y = ((float) i * ry) / 512.0F;
62 for (
int i = 0; i < 512; i++) {
64 float cosa = param * cosf (l[i].angle);
65 float sina = param * sinf (l[i].angle);
66 l[i].
x = ((float) rx / 2.0F) + cosa;
67 l[i].
y = (float) ry / 2.0F + sina;
77 return (230 << (
ROUGE * 8)) | (120 << (
VERT * 8)) | (10 << (
BLEU * 8));
79 return (120 << (
VERT * 8)) | (252 << (
ROUGE * 8)) | (10 << (
BLEU * 8));
81 return (160 << (
VERT * 8)) | (236 << (
ROUGE * 8)) | (40 << (
BLEU * 8));
83 return (40 << (
BLEU * 8)) | (220 << (
ROUGE * 8)) | (140 << (
VERT * 8));
85 return (200 << (
VERT * 8)) | (80 << (
ROUGE * 8)) | (10 << (
BLEU * 8));
87 return (250 << (
BLEU * 8)) | (30 << (
VERT * 8)) | (80 << (
ROUGE * 8));
89 return 0x5 << (
BLEU * 8);
111 for (
int i = 0; i < 512; i++) {
118 auto *c1 = (
unsigned char *) &l->
color;
119 auto *c2 = (
unsigned char *) &l->
color2;
120 for (
int i = 0; i < 4; i++) {
123 *c1 = (
unsigned char) ((cc1 * 63 + cc2) >> 6);
129 if (l->
power < 1.1F) {
133 if (l->
power > 17.5F) {
143 float param,
float amplitude,
int col)
155 int IDsrc,
float paramS,
int coulS,
156 int IDdest,
float paramD,
int coulD)
171 l->amplitude = l->amplitudeF = 1.0F;
173 genline (IDsrc, paramS, l->points, rx, ry);
174 genline (IDdest, paramD, l->points2, rx, ry);
194 free ((*l)->points2);
202 if (line !=
nullptr) {
206 float cosa = cosf (pt->
angle) / 1000.0F;
207 float sina = sinf (pt->
angle) / 1000.0F;
211 int x1 = (int) (pt->
x + (cosa * line->
amplitude * data[0]));
212 int y1 = (int) (pt->
y + (sina * line->
amplitude * data[0]));
214 for (
int i = 1; i < 512; i++) {
217 cosa = cosf (pt->
angle) / 1000.0F;
218 sina = sinf (pt->
angle) / 1000.0F;
220 int x2 = (int) (pt->
x + (cosa * line->
amplitude * data[i]));
221 int y2 = (int) (pt->
y + (sina * line->
amplitude * data[i]));
std::array< int16_t, 512 > GoomSingleData
GMLine * goom_lines_init(int rx, int ry, int IDsrc, float paramS, int coulS, int IDdest, float paramD, int coulD)
static void draw_line(int *data, int x1, int y1, int x2, int y2, int col, int screenx, int screeny)
void goom_lines_switch_to(GMLine *gml, int IDdest, float param, float amplitude, int col)
void goom_lines_free(GMLine **l)
void goom_lines_set_res(GMLine *gml, int rx, int ry)
#define DRAWMETHOD_DONE()
void goom_lines_draw(GMLine *line, const GoomSingleData &data, unsigned int *p)
static void goom_lines_move(GMLine *l)
static void genline(int id, float param, GMUnitPointer *l, int rx, int ry)
#define ROUGE
position des composantes
static void lightencolor(int *col, float power)
static unsigned char lighten(unsigned char value, float power)
static guint32 getcouleur(int mode)