2014-06-10 13:13:16 +00:00
|
|
|
#ifndef CANVASPREVIEW_H
|
|
|
|
#define CANVASPREVIEW_H
|
|
|
|
|
|
|
|
#include "software_global.h"
|
|
|
|
|
|
|
|
namespace paysages {
|
|
|
|
namespace software {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* @brief Smaller preview of a Canvas rendering, that can be watched live.
|
|
|
|
*/
|
|
|
|
class SOFTWARESHARED_EXPORT CanvasPreview
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
CanvasPreview();
|
|
|
|
~CanvasPreview();
|
|
|
|
|
|
|
|
inline int getWidth() const {return width;}
|
|
|
|
inline int getHeight() const {return height;}
|
|
|
|
|
|
|
|
void setSize(int real_width, int real_height, int preview_width, int preview_height);
|
|
|
|
void reset();
|
|
|
|
|
2014-06-12 15:45:59 +00:00
|
|
|
void initLive(CanvasLiveClient *client);
|
|
|
|
void updateLive(CanvasLiveClient *client);
|
|
|
|
|
|
|
|
void pushPixel(int real_x, int real_y, const Color &old_color, const Color &new_color);
|
2014-06-10 13:13:16 +00:00
|
|
|
|
2014-06-12 15:45:59 +00:00
|
|
|
protected:
|
|
|
|
void setAllDirty();
|
2014-06-10 13:13:16 +00:00
|
|
|
|
|
|
|
private:
|
2014-06-12 15:45:59 +00:00
|
|
|
Mutex *lock;
|
|
|
|
|
|
|
|
Color *pixels;
|
2014-06-10 13:13:16 +00:00
|
|
|
int width;
|
|
|
|
int height;
|
2014-06-12 15:45:59 +00:00
|
|
|
|
|
|
|
int dirty_left;
|
|
|
|
int dirty_right;
|
|
|
|
int dirty_down;
|
|
|
|
int dirty_up;
|
2014-06-10 13:13:16 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif // CANVASPREVIEW_H
|