paysages3d/src/render/software/CanvasPreview.h

59 lines
1.1 KiB
C
Raw Normal View History

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;}
const Color &getFinalPixel(int x, int y) const;
2014-06-10 13:13:16 +00:00
void setSize(int real_width, int real_height, int preview_width, int preview_height);
void setToneMapping(const ColorProfile &profile);
2014-06-10 13:13:16 +00:00
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
ColorProfile *profile;
2014-06-12 15:45:59 +00:00
int dirty_left;
int dirty_right;
int dirty_down;
int dirty_up;
bool scaled;
double factor;
double factor_x;
double factor_y;
2014-06-10 13:13:16 +00:00
};
}
}
#endif // CANVASPREVIEW_H