main function now allocates image array on the heap to be able to support larger images
This commit is contained in:
@@ -199,13 +199,18 @@ int main(int argc, char** argv)
|
|||||||
bytesPerColour = 1;
|
bytesPerColour = 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
unsigned char tempArr[width*height*bytesPerColour]; // if not colored, rem
|
unsigned char *tempArr = malloc(width*abs(height)*bytesPerColour);// allocate image array on the heap to support large images as the stack is usually only 8 MB big
|
||||||
|
if(tempArr == NULL) {
|
||||||
|
exit(EXIT_FAILURE);
|
||||||
|
}
|
||||||
|
|
||||||
printf("yashar\n");
|
printf("yashar\n");
|
||||||
tricorn_simd(complexA,width,height,resolution,n,colored,tempArr);
|
tricorn_simd(complexA,width,height,resolution,n,colored,tempArr);
|
||||||
printf("yashar\n");
|
printf("yashar\n");
|
||||||
save_bmp(output_data,tempArr,width,height,colored);
|
save_bmp(output_data,tempArr,width,height,colored);
|
||||||
|
|
||||||
free(output_data); //
|
free(output_data);
|
||||||
|
free(tempArr);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user