mirror of
https://github.com/ultimatepp/ultimatepp.git
synced 2026-05-16 06:05:58 -06:00
59 lines
922 B
C++
59 lines
922 B
C++
#ifndef _ImageMT_ImageMT_h
|
|
#define _ImageMT_ImageMT_h
|
|
|
|
#include <CtrlLib/CtrlLib.h>
|
|
|
|
using namespace Upp;
|
|
|
|
#define LAYOUTFILE <ImageMT/ImageMT.lay>
|
|
#include <CtrlCore/lay.h>
|
|
|
|
|
|
class Layer
|
|
{
|
|
public:
|
|
Layer(){}
|
|
Layer(Layer* pSource,double op,void* pMain);
|
|
|
|
static void MakeLayerAsThread(Layer* pLayer,double op,void* pMain,int n);
|
|
|
|
|
|
const RGBA* GetImage(int i){return m_img[i];}
|
|
|
|
|
|
Rectf m_rc;
|
|
|
|
|
|
Image m_img;
|
|
|
|
};
|
|
|
|
|
|
class ImageMT : public WithImageMTLayout<TopWindow> {
|
|
public:
|
|
typedef ImageMT CLASSNAME;
|
|
ImageMT();
|
|
~ImageMT();
|
|
|
|
Atomic threads;
|
|
|
|
static void SquareImage();
|
|
|
|
void LoadImage();
|
|
void Square();
|
|
|
|
void AddLayer(Layer* pLayer){m_pLayers.Add(pLayer);}
|
|
|
|
void StartProg(int Steps) {m_prog.SetTotal(Steps);}
|
|
void Step() {m_prog++;}
|
|
void EndProg() {m_prog.Set(0);}
|
|
|
|
protected:
|
|
void Paint(Draw& w);
|
|
|
|
Array<Layer*> m_pLayers;
|
|
|
|
|
|
};
|
|
|
|
#endif
|