Skip to content

Commit baffa37

Browse files
committed
Fixed #10
Turns out, my images were just upside down. Maths coordinates increase from the bottom up, but display coordinates increase from the top down.
1 parent b782af7 commit baffa37

4 files changed

Lines changed: 3 additions & 3 deletions

File tree

bin/rainbrot-gen

0 Bytes
Binary file not shown.

raindraw.m

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
fprintf('[%s] Opening file...\n',datetime);
66
f=fopen(sprintf('%s/%d-%d',dir,iters(i),iters(i+1)-1));
77
fprintf('[%s] Reading file...\n',datetime);
8-
t=fread(f,dim,'uint64');
8+
t=fread(f,dim([2,1]),'uint64');
99
fprintf('[%s] Closing file...\n',datetime);
1010
fclose(f);
1111
fprintf('[%s] Applying transform...\n',datetime);

src/main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ int main (int argc,char** argv)
5959
function=mandelbrot;
6060
optimiser=mandelbrot_optimiser;
6161
}
62-
else if(strcmp(args.function,"mandelbrot")==0)
62+
else if(strcmp(args.function,"ship")==0)
6363
{
6464
function=ship;
6565
optimiser=no_optimiser;

src/worker.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -116,7 +116,7 @@ void* worker(void *arg_v)
116116

117117
/* increment buffer */
118118
idx_x=round((creall(Z) - arg->re_min)*( arg->re_size -1)/(arg->re_max-arg->re_min));
119-
idx_y=round((cimagl(Z) - arg->im_min)*( arg->im_size -1)/(arg->im_max-arg->im_min));
119+
idx_y=arg->im_size - round((cimagl(Z) - arg->im_min)*( arg->im_size -1)/(arg->im_max-arg->im_min));
120120

121121
if(idx_x>=0 && idx_x < arg->re_size && idx_y>=0 && idx_y < arg->im_size)
122122
{

0 commit comments

Comments
 (0)