diff --git a/upptst/Dither/Dither.upp b/upptst/Dither/Dither.upp new file mode 100644 index 000000000..46b07a61f --- /dev/null +++ b/upptst/Dither/Dither.upp @@ -0,0 +1,10 @@ +uses + CtrlLib, + plugin/jpg; + +file + main.cpp; + +mainconfig + "" = "GUI SSE2"; + diff --git a/upptst/Dither/init b/upptst/Dither/init new file mode 100644 index 000000000..a7648e050 --- /dev/null +++ b/upptst/Dither/init @@ -0,0 +1,5 @@ +#ifndef _Dither_icpp_init_stub +#define _Dither_icpp_init_stub +#include "CtrlLib/init" +#include "plugin/jpg/init" +#endif diff --git a/upptst/Dither/main.cpp b/upptst/Dither/main.cpp new file mode 100644 index 000000000..33bb12d9a --- /dev/null +++ b/upptst/Dither/main.cpp @@ -0,0 +1,33 @@ +#include + +using namespace Upp; + +struct MyApp : TopWindow { + Image image; + Image image2; + + virtual void Paint(Draw& w) { + w.DrawRect(GetSize(), White()); + w.DrawImage(0, 0, image); + w.DrawImage(0, 500, image2); + DrawFrame(w, 0, 500, 512, 32, Black()); + } + + MyApp() { + ImageBuffer ib(512, 32); + RGBA *t = ~ib; + for(int y = 0; y < 32; y++) + for(int x = 0; x < 512; x++) + *t++ = GrayColor(x / 2); + image2 = ib; + image2 = Dither(image2); + } + +}; + +GUI_APP_MAIN +{ + MyApp app; + app.image = Dither(StreamRaster::LoadFileAny(GetDataFile("test.jpg"))); + app.Run(); +} diff --git a/upptst/Dither/test.jpg b/upptst/Dither/test.jpg new file mode 100644 index 000000000..009d2e36f Binary files /dev/null and b/upptst/Dither/test.jpg differ