Skip to content

Commit 902ba5c

Browse files
committed
Moved RGB functions
1 parent 3efc420 commit 902ba5c

File tree

1 file changed

+18
-18
lines changed

1 file changed

+18
-18
lines changed

mandelbrot.js

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -189,6 +189,24 @@ function adjustAspectRatio(xRange, yRange, canvas)
189189
}
190190
}
191191

192+
function addRGB(v, w)
193+
{
194+
v[0] += w[0];
195+
v[1] += w[1];
196+
v[2] += w[2];
197+
v[3] += w[3];
198+
return v;
199+
}
200+
201+
function divRGB(v, div)
202+
{
203+
v[0] /= div;
204+
v[1] /= div;
205+
v[2] /= div;
206+
v[3] /= div;
207+
return v;
208+
}
209+
192210
/*
193211
* Render the Mandelbrot set
194212
*/
@@ -287,24 +305,6 @@ function draw(pickColor, superSamples)
287305
return [n, Tr, Ti];
288306
}
289307

290-
function addRGB(v, w)
291-
{
292-
v[0] += w[0];
293-
v[1] += w[1];
294-
v[2] += w[2];
295-
v[3] += w[3];
296-
return v;
297-
}
298-
299-
function divRGB(v, div)
300-
{
301-
v[0] /= div;
302-
v[1] /= div;
303-
v[2] /= div;
304-
v[3] /= div;
305-
return v;
306-
}
307-
308308
function drawLineSuperSampled(Ci, off, Cr_init, Cr_step)
309309
{
310310
var Cr = Cr_init;

0 commit comments

Comments
 (0)