fracwall

This fractal wallpaper generator creates a bitmap file depicting either the Mandelbrot or the Julia set
Log | Files | Refs | README | LICENSE

fracwall.c (806B)


      1 /*
      2   Fractal Wallpaper Generator
      3   "fracwall.c"
      4   M. Yamanaka
      5   email: myamanaka@live.com
      6   website: csmyamanaka.com
      7   license: MIT (See included "LICENSE" file for details)
      8 */
      9 
     10 #include "juliamath.h"
     11 #include "bmpfileiopp.h"
     12 
     13 int main(){
     14   
     15   /*
     16     create pre-fractal array of iteration values
     17   */
     18   int* array = imgIters(1200, 800);
     19 
     20   /*
     21     create bitmap file
     22   */
     23   BMPIS b = {800, 1200, 3, "wallpaper.bmp"};
     24   char* pv = (char*)malloc(sizeof(char)*1200*800*3);
     25   
     26   /*
     27     simple and tentative colouring scheme: will come up with a better one soon!
     28   */
     29   for(int i = 0; i < 1200*800; i++){
     30     pv[i*3] = (char)(int)(1.0*255*array[i]/iter_max);
     31     pv[i*3 + 1] = (char)(int)(1.0*255*array[i]/iter_max);
     32     pv[i*3 + 2] = (char)(int)(1.0*255*array[i]/iter_max);
     33   }
     34   writeBMP(b, pv);
     35   return 0;
     36 }

Generated using stagit (https://codemadness.org/stagit.html)