vspline 1.1.0
Generic C++11 Code for Uniform B-Splines
Classes | Typedefs | Functions | Variables
mandelbrot.cc File Reference

calculate an image of a section of the mandelbrot set More...

#include <iostream>
#include <vspline/vspline.h>
#include <vigra/stdimage.hxx>
#include <vigra/imageinfo.hxx>
#include <vigra/impex.hxx>

Go to the source code of this file.

Classes

struct  mandelbrot_functor
 
struct  colorize
 

Typedefs

typedef vigra::RGBValue< double, 0, 1, 2 > pixel_type
 
typedef vigra::TinyVector< double, 2 > coordinate_type
 
typedef vspline::vector_traits< coordinate_type >::type crd_v
 
typedef vspline::vector_traits< double >::type compo_v
 
typedef vspline::vector_traits< int, VSZ >::type int_v
 
typedef vigra::MultiArray< 2, pixel_typetarget_type
 

Functions

int main (int argc, char *argv[])
 

Variables

const int VSZ = vspline::vector_traits < coordinate_type > :: size
 

Detailed Description

calculate an image of a section of the mandelbrot set

to demonstrate that vspline's transform routines don't have to use b-splines at all, here's a simple example creating a functor to perform the iteration leading to the mandelbrot set, together with a vspline::domain adapting the coordinates and another functor to do the 'colorization'. The three functors are chained and fed to vspline::transform() to yield the image.

compile with:

./examples.sh mandelbrot.cc

./hwy_mandelbrot_clang++ -2 -1 1 1

( -2 , -1 ) being lower left and ( 1 , 1 ) upper right

the result will be written to 'mandelbrot.tif'

Definition in file mandelbrot.cc.

Typedef Documentation

◆ compo_v

typedef vspline::vector_traits<double>::type compo_v

Definition at line 67 of file mandelbrot.cc.

◆ coordinate_type

typedef vigra::TinyVector< double , 2 > coordinate_type

Definition at line 64 of file mandelbrot.cc.

◆ crd_v

Definition at line 66 of file mandelbrot.cc.

◆ int_v

typedef vspline::vector_traits<int,VSZ>::type int_v

Definition at line 69 of file mandelbrot.cc.

◆ pixel_type

typedef vigra::RGBValue<double,0,1,2> pixel_type

Definition at line 61 of file mandelbrot.cc.

◆ target_type

typedef vigra::MultiArray< 2 , pixel_type > target_type

Definition at line 72 of file mandelbrot.cc.

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 161 of file mandelbrot.cc.

Variable Documentation

◆ VSZ

const int VSZ = vspline::vector_traits < coordinate_type > :: size

Definition at line 68 of file mandelbrot.cc.