git-svn-id: svn://ultimatepp.org/upp/trunk@7315 f0d560ea-af0d-0410-9eb7-867de7ffcac7
This commit is contained in:
cxl 2014-04-25 13:30:17 +00:00
parent 96bc6fe038
commit 6433c940ce
4 changed files with 48 additions and 0 deletions

10
upptst/Dither/Dither.upp Normal file
View file

@ -0,0 +1,10 @@
uses
CtrlLib,
plugin/jpg;
file
main.cpp;
mainconfig
"" = "GUI SSE2";

5
upptst/Dither/init Normal file
View file

@ -0,0 +1,5 @@
#ifndef _Dither_icpp_init_stub
#define _Dither_icpp_init_stub
#include "CtrlLib/init"
#include "plugin/jpg/init"
#endif

33
upptst/Dither/main.cpp Normal file
View file

@ -0,0 +1,33 @@
#include <CtrlLib/CtrlLib.h>
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();
}

BIN
upptst/Dither/test.jpg Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 10 KiB