7#include "libmythbase/mythconfig.h"
17void ifs_update (uint32_t * data,
const uint32_t *
back,
int width,
int height,
20 static int s_couleur = 0xc0c0c0c0;
21 static std::array<int,4> s_v { 2, 4, 3, 2 };
22 static std::array<int,4> s_col { 2, 4, 3, 2 };
24 enum MODE : std::uint8_t {
29 static MODE s_mode = MOD_MERVER;
30 static int s_justChanged = 0;
31 static int s_cycle = 0;
33 int couleursl = s_couleur;
40 cycle10 = s_cycle / 10;
42 cycle10 = 7 - (s_cycle / 10);
45 auto *
tmp = (
unsigned char *) &couleursl;
47 for (
int i = 0; i < 4; i++) {
48 *
tmp = (*tmp) >> cycle10;
60 for (
int i = 0; i < nbpt; i += increment) {
64 if ((x < width) && (y < height) && (x > 0) && (y > 0)) {
65 int pos = x + (y * width);
73 for (
int i = 0; i < nbpt; i += increment) {
74 int x = points[i].
x & 0x7fffffff;
75 int y = points[i].
y & 0x7fffffff;
77 if ((x < width) && (y < height)) {
78 int pos = x + (y * width);
80 auto *bra = (
unsigned char *) &
back[pos];
81 auto *dra = (
unsigned char *) &data[pos];
82 auto *cra = (
unsigned char *) &couleursl;
84 for (
int j = 0; j < 4; j++) {
87 tra = std::min(tra, 255);
98 s_col[
ALPHA] = s_couleur >> (
ALPHA * 8) & 0xff;
99 s_col[
BLEU] = s_couleur >> (
BLEU * 8) & 0xff;
100 s_col[
VERT] = s_couleur >> (
VERT * 8) & 0xff;
101 s_col[
ROUGE] = s_couleur >> (
ROUGE * 8) & 0xff;
103 if (s_mode == MOD_MER) {
105 if (s_col[
BLEU] > 255) {
109 if (s_col[
BLEU] < 32) {
115 if (s_col[
VERT] > 200) {
123 if (s_col[
VERT] < 32) {
129 if (s_col[
ROUGE] > 64) {
133 if (s_col[
ROUGE] < 0) {
139 if (s_col[
ALPHA] > 0) {
143 if (s_col[
ALPHA] < 0) {
150 &&
rand_bool(20)) && (s_justChanged < 0)) {
151 s_mode = !
rand_bool(3) ? MOD_FEU : MOD_MERVER;
155 else if (s_mode == MOD_MERVER) {
157 if (s_col[
BLEU] > 128) {
161 if (s_col[
BLEU] < 16) {
167 if (s_col[
VERT] > 200) {
175 if (s_col[
VERT] < 32) {
181 if (s_col[
ROUGE] > 128) {
185 if (s_col[
ROUGE] < 0) {
191 if (s_col[
ALPHA] > 255) {
195 if (s_col[
ALPHA] < 0) {
202 &&
rand_bool(20)) && (s_justChanged < 0)) {
203 s_mode = !
rand_bool(3) ? MOD_FEU : MOD_MER;
207 else if (s_mode == MOD_FEU) {
210 if (s_col[
BLEU] > 64) {
214 if (s_col[
BLEU] < 0) {
220 if (s_col[
VERT] > 200) {
230 if (s_col[
VERT] < 0) {
236 if (s_col[
ROUGE] > 255) {
244 if (s_col[
ROUGE] < 0) {
250 if (s_col[
ALPHA] > 0) {
254 if (s_col[
ALPHA] < 0) {
260 && (s_col[
BLEU] > 32)
261 &&
rand_bool(20)) && (s_justChanged < 0)) {
262 s_mode =
rand_bool() ? MOD_MER : MOD_MERVER;
#define ROUGE
position des composantes
IFSPoint * draw_ifs(int *nbPoints)
void ifs_update(uint32_t *data, const uint32_t *back, int width, int height, int increment)
#define punpckldq_r2r(regs, regd)
#define paddusb_r2r(regs, regd)
#define movd_r2m(reg, var)
#define movd_m2r(var, reg)
Convenience inline random number generator functions.
int MythRandomInt(int min, int max)
generate a uniformly distributed random signed int in the closed interval [min, max].
bool rand_bool(uint32_t chance=2)
return a random bool with P(true) = 1/chance