An open API service indexing awesome lists of open source software.

https://github.com/thefox/mandelbrot-c

Generate Mantelbrot set picture
https://github.com/thefox/mandelbrot-c

mandelbrot mandelbrot-set

Last synced: 2 months ago
JSON representation

Generate Mantelbrot set picture

Awesome Lists containing this project

README

          

# Mandelbrot

This script create a picture by using the [Mandelbrot set](http://en.wikipedia.org/wiki/Mandelbrot_set). Source code in C.

## Mac Requirements

- X11:
- Homebrew
- `brew install homebrew/versions/gcc49`
- `brew install imlib2`

## Build

- Basic

( rm -rf build && mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release .. && make && make test ) #cmake

(On **Mac**) use GCC not Clang because Clang doesn't support OpenMP:

( rm -rf build; mkdir -p build && cd build && cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_C_COMPILER=/usr/local/bin/gcc -DCMAKE_CXX_COMPILER=/usr/local/bin/g++ .. && make && make test ) #cmake

### Multithreading Support

- GCC
- OpenMP: Yes.
- OpenCL for Mac: No, because the default [GCC doesn't include blocks support](http://stackoverflow.com/questions/4644814/are-objective-c-blocks-supported-by-compilers-on-linux).
- Clang
- OpenMP: No, because default Clang doesn't include OpenMP support.
- OpenCL: Yes.

## Usage

After building you can generate with `./build/bin/mandelbrot` an image:

```bash
./build/bin/mandelbrot I_WIDTH I_HEIGHT DEPTH_MIN DEPTH_MAX MB_WIDTH_MID MB_WIDTH_ZOOM MB_HEIGHT_MID MB_HEIGHT_MAX
```

Example:

```bash
./build/bin/mandelbrot 1024 1024 1 100 -.5 2 0 2
```

This will generate an 1024x1024 pixel image with depth 1 to 100. The real part coordinate -.5 and the imaginary part coordinate 0 will be centered to the image.

### Arguments

- `I_WIDTH`: The width of the image.
- `I_HEIGHT`: The height of the image.
- `DEPTH_MIN`: The minimum depth. Default 1.
- `DEPTH_MAX`: The maximum depth.
- `MB_WIDTH_MID`: Real part (CR).
- `MB_WIDTH_ZOOM`: Zoom of CR.
- `MB_HEIGHT_MID`: Imaginary part (CI).
- `MB_HEIGHT_MAX`: Zoom of CI.

## Related Links

-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-