-
Notifications
You must be signed in to change notification settings - Fork 1
/
ForLoop2.cpp
26 lines (21 loc) · 1.05 KB
/
ForLoop2.cpp
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
kernel For_Loop2 : ImageComputationKernel <ePixelWise>
{
Image<eRead,eAccessRandom,eEdgeClamped> src; //input image
Image<eWrite> dst; //output image
param:
int trigger;
int increments; //increment param
int amount; //amount param
void define(){
defineParam(trigger,"trigger",10); //loop trigger
defineParam(increments,"increments", 2); //increment default
defineParam(amount,"amount",100); //amount default
}
void process(int2 pos) {
int total = 0; //total initial value
for (int i = trigger; i =< increments; i++) { //loop
total += amount; //loop sum
}
dst() = src((pos.x+total),pos.y); //out
}
};