#include <ProgressiveImageGen.h>
Inheritance diagram for ProgressiveImageGen:

Public Methods | |
| ProgressiveImageGen (FractalImage *) | |
| Constructor. | |
| ~ProgressiveImageGen (void) | |
| Destructor. | |
| void | init (void) |
| Overriden from ImageGen base class. | |
| void | restart (void) |
| Overriden from ImageGen base class. | |
| bool | process (void) |
| Overriden from ImageGen base class. | |
| bool | inq_done (void) const |
| Overriden from ImageGen base class. | |
| int | inq_progress (void) const |
| Overriden from ImageGen base class. | |
Private Methods | |
| void | init_pixels (void) |
| Initialises the FractalPixels for generating a new image. | |
| void | process_line (void) |
| Performs one iteration on all the pixels on the given line. | |
Private Attributes | |
| FractalImage * | m_image |
| FractalImage. | |
| ComplexNumber * | m_pixel_values |
| Current value of 'z' at each pixel. | |
| bool * | m_pixels_done |
| Flag for each pixel, set true once the value of 'z' at that pixel has exceeded the divergence threshold. | |
| bool * | m_lines_done |
| Flags for each line, set once all pixels on that line have been computed. | |
| Vector2 | m_origin |
| Position in fractal space of first pixel on the first (bottom) row. | |
| Vector2 | m_rowstart |
| Position in fractal space of first pixel on the current row. | |
| Vector2 | m_xoffs |
| Offset in fractal space from a pixel to the next. | |
| Vector2 | m_yoffs |
| Offset in fractal space from a pixel in one row to the next. | |
| unsigned short | m_current_itn |
| Current iteration - each pixel in the whole image is advanced one iteration at a time. | |
| bool | m_done |
| Flag set when no more processing to be done. | |
| int | m_nextline |
| Next line to process in OnIdle. | |
| bool | m_curr_itn_all_done |
| This flag is set at the beginning of each iteration, and cleared if any pixels are found that are not complete. | |
| bool | m_curr_itn_any_changed |
| This flag is cleared at the beginning of each iteration, and set if any pixels are completed on this iteration, which indicates that the display needs to be updated. | |
This allows the display to be updated regularly, rather than having to wait before anything is seen. This class maintains the state that allows the processing to be done in many incremental steps, which are called from OnIdle(). Multiple passes are run over all pixels so that the whole image is updated regularly, rather than calculating each pixel one by one. On each iteration, all pixels that have exceed the divergence threshold are set using the current iteration value. Although this approach is slower, it gives a more interesting image more quickly that develops over time.
|
|
Constructor.
|
|
|
Destructor.
|
|
|
Overriden from ImageGen base class. Initialises thie ProgressiveImageGen for processing the current FractalImage. This must be called before any processing is done. This must also be called if the size of the image ever changes. Implements ImageGen. |
|
|
Initialises the FractalPixels for generating a new image.
|
|
|
Overriden from ImageGen base class.
Implements ImageGen. |
|
|
Overriden from ImageGen base class.
Implements ImageGen. |
|
|
Overriden from ImageGen base class. Processes the current line.
Implements ImageGen. |
|
|
Performs one iteration on all the pixels on the given line.
|
|
|
Overriden from ImageGen base class. Restarts the processing. This should be called whenever any attribute that affects the image is changed, such as the view transform or the palette. Implements ImageGen. |
|
|
This flag is set at the beginning of each iteration, and cleared if any pixels are found that are not complete.
|
|
|
This flag is cleared at the beginning of each iteration, and set if any pixels are completed on this iteration, which indicates that the display needs to be updated.
|
|
|
Current iteration - each pixel in the whole image is advanced one iteration at a time.
|
|
|
Flag set when no more processing to be done.
|
|
|
|
|
|
Flags for each line, set once all pixels on that line have been computed. This array has 'image-height' elements. |
|
|
Next line to process in OnIdle.
|
|
|
Position in fractal space of first pixel on the first (bottom) row.
|
|
|
Current value of 'z' at each pixel. This array has one element per pixel, stored in the same order as the pixels in the FractalImage. |
|
|
Flag for each pixel, set true once the value of 'z' at that pixel has exceeded the divergence threshold. This array has one element per pixel, stored in the same order as the pixels in the FractalImage. |
|
|
Position in fractal space of first pixel on the current row.
|
|
|
Offset in fractal space from a pixel to the next. This is determined from the view transform and the image size. |
|
|
Offset in fractal space from a pixel in one row to the next. This is determined from the view transform and the image size. |
1.2.16