#include <FractalImage.h>
Public Methods | |
| FractalImage (void) | |
| Constructor. | |
| FractalImage (const FractalImage &) | |
| Copy constructor. | |
| ~FractalImage (void) | |
| Destructor. | |
| const Processor * | inq_processor (void) const |
| void | set_processor (const Processor *) |
| Sets the Processor to use. | |
| const ComplexNumber & | inq_initial_z (void) const |
| void | set_initial_z (const ComplexNumber &z) |
| void | set_invert_u (bool invert_u) |
| bool | inq_invert_u (void) const |
| void | set_palette (const Palette *) |
| Sets the Palette to use. | |
| const Palette * | inq_palette (void) const |
| void | resize (int width, int height, rgbcolour_t *rgb_pixels) |
| Resizes the image to the given width & height in pixels. | |
| void | set_view (const Vector2 ¢re, double width, double angle) |
| Sets the view transform. | |
| const Matrix33 & | inq_view_transform (void) const |
| const Vector2 & | inq_view_centre (void) const |
| double | inq_view_width (void) const |
| double | inq_view_angle (void) const |
| int | inq_width (void) const |
| int | inq_height (void) const |
| int | inq_npixels (void) const |
| unsigned short * | inq_pixel_itns (void) const |
| const unsigned short * | inq_pixel_itns (int x, int y) const |
| rgbcolour_t * | inq_rgb_pixels (void) const |
| void | restart (void) |
| This should be called whenever a new image is being calculated. | |
| void | update_all_rgb_pixels (void) |
| Updates the colours of all RGB pixels. | |
| ComplexNumber | convert_point_to_z (const Vector2 &) const |
| Converts the given point into a complex number. | |
Private Methods | |
| void | update_view_transform (void) |
| Updates the view transform. | |
Private Attributes | |
| const Processor * | m_processor |
| Fractal image generator. | |
| bool | m_invert_u |
| If set, u is set to the reciprical of the coordinate before calculating the fractal at that point. | |
| ComplexNumber | m_initial_z |
| Starting value for 'z'. | |
| const Palette * | m_palette |
| Palette to use. | |
| int | m_width |
| Width in pixels. | |
| int | m_height |
| Height in pixels. | |
| unsigned short * | m_pixel_itns |
| Pointer to array of 'width' x 'height' unsigned shorts. | |
| rgbcolour_t * | m_rgb_pixels |
| Pointer to RGB pixels. | |
| Vector2 | m_view_centre |
| Centre of view in fractal space. | |
| double | m_view_width |
| Width of view in fractal space. | |
| double | m_view_angle |
| Angle in radians that view is rotated about view centre. | |
| Matrix33 | m_view_transform |
| View transform. | |
This class stores both the number of iterations calculated for each pixel and the RGB colour for each pixel. This allows the RGB colours to be quickly recalculated if the palette is changec. This class also stores a pointer to the pixel processor 'm_processor' which performs the fractal calculations at each pixel. This is used by the FastImageGen and ProgressiveImageGen classes to generate this image.
|
|
Constructor.
|
|
|
Copy constructor. Copies the parameters from the given FractalImage. Note: any pixel values already processed in the given FractalImage are not copied. resize()/init() must be called before this FractalImage is used. |
|
|
Destructor.
|
|
|
Converts the given point into a complex number. Normally, this simply involves copying the x-coordinate to the real component, and the y-coordinate to the imaginary component, but other transforms such as taking the recipricol or square root may be applied to apply distortions to the image. |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||||||||||||||
|
Resizes the image to the given width & height in pixels. set_view_transform() must be called after this method. |
|
|
This should be called whenever a new image is being calculated. It sets all the pixel values to the main colour. |
|
|
|
|
|
|
|
|
Sets the Palette to use. This must be set before any other methods are called. |
|
|
Sets the Processor to use. This must be set before any other methods are called. |
|
||||||||||||||||
|
Sets the view transform.
|
|
|
Updates the colours of all RGB pixels. This is called whenever the palette is changed. |
|
|
Updates the view transform. This should be called whenever the view or image size is changed. |
|
|
Height in pixels.
|
|
|
Starting value for 'z'.
|
|
|
If set, u is set to the reciprical of the coordinate before calculating the fractal at that point.
|
|
|
Palette to use.
|
|
|
Pointer to array of 'width' x 'height' unsigned shorts. As the iterated value at each pixel exceeds the divergence threshold, the iteration count is set here for each pixel. Lines are order bottom to top, as is conventional for windows bitmaps. Note: this is the reverse to the convention for the coordinate space used by windows, which have (0,0) at top left. |
|
|
Fractal image generator.
|
|
|
Pointer to RGB pixels. There are 'm_width' x 'm_height' pixels, ordered bottom to top row by row. These pixels are owned by the HBITMAP in CFracWnd, so it is that class's responsibility to make sure that if these pixels are invalidated (such as when the window is resized) this class is notified. |
|
|
Angle in radians that view is rotated about view centre.
|
|
|
Centre of view in fractal space.
|
|
|
View transform. Transforms a coordinate in image pixel space (y=0 at bottom) to the fractal space. |
|
|
Width of view in fractal space.
|
|
|
Width in pixels.
|
1.2.16