-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathtask_U.psy
More file actions
36 lines (30 loc) · 982 Bytes
/
task_U.psy
File metadata and controls
36 lines (30 loc) · 982 Bytes
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
/************ Copyright Krono-Safe S.A. 2020, All rights reserved ************/
#include <app.psyh>
agent task_U (uses realtime, defaultclock clk_s)
{
global {
float noise_mat[IMG_H][IMG_W];
unsigned char image[IMG_H][IMG_W];
/* Take a look at app.h. The counter is incremented by one each
* "GEN_WORK", but we want to keep it constant between iterations
* (hence the counter-- after these calls)
* It is initialized to 39 because the following computations are
* performed:
* int max = (IMG_H + Counter + 60) % IMG_H + 1
* we want a max value to be IMG_H, so counter must be 39.
*
* That's a bit convoluted, but enables code factorization.
*/
unsigned int counter = 39u;
}
body start {
/* C0 -- not interesting, do nothing */
jump body_at_c1;
}
body body_at_c1 {
@c1 advance 1; /* <--- closes */
/* C1 */
GEN_WORK("U0", filter2, noise_mat, image, 12, counter);
counter--;
}
}