Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Community » U++ community news and announcements » 2020.1 alpha
Re: 2020.1 alpha [message #53367 is a reply to message #53361] Tue, 31 March 2020 13:02 Go to previous messageGo to previous message
Tom1
Messages: 1212
Registered: March 2007
Senior Contributor
Hi Mirek,

I'm using the wonderful new Xform2D::Map() to render a raster map image over a specific area with specific corner coordinates. This is a great feature, but BufferPainter::Fill(image) suffers from edge effects at the borders of the image fill. The fill leaves narrow gaps between the filled triangles. Both FILL_FAST and FILL_EXACT exhibit this problem. Even a simple BufferPainter::Fill(Blue()) exhibits this issue, although the gap seems slightly narrower then.

At this time I would like to be able to use at least FILL_FAST. Can you take a look at this?

Here's a testcase:

#include <CtrlLib/CtrlLib.h>

using namespace Upp;

class PainterImageMapping : public TopWindow {
public:
	typedef PainterImageMapping CLASSNAME;
	
	PainterImageMapping(){
		Sizeable();
	}
		
	virtual void Paint(Draw &draw){
		ImageBuffer ib(GetSize());
		{
			ImageBuffer imb(500,500);
			{
				BufferPainter iw(imb);
				iw.Clear(Black());
			}
			
			Image img(imb);

			// image coordinates
			Pointf iNW(0,0);
			Pointf iNE(img.GetWidth(),0);
			Pointf iSW(0,img.GetHeight());
			Pointf iSE(img.GetWidth(),img.GetHeight());
			
			BufferPainter w(ib);
			w.Clear(White());
			
			dword flags=FILL_FAST;
			//dword flags=FILL_EXACT;
			{
				Pointf nw(100,100);
				Pointf ne(700,100);
				Pointf sw(100,700);
				Pointf se(650,750);
				w.Move(nw).Line(ne).Line(se).Fill(img, Xform2D::Map(iNW,iNE,iSE,nw,ne,se), flags);
				w.Move(nw).Line(sw).Line(se).Fill(img, Xform2D::Map(iNW,iSW,iSE,nw,sw,se), flags);
			}
			{
				Pointf nw(700,100);
				Pointf ne(1400,120);
				Pointf sw(650,750);
				Pointf se(1300,720);
				w.Move(nw).Line(ne).Line(se).Fill(img, Xform2D::Map(iNW,iNE,iSE,nw,ne,se), flags);
				w.Move(nw).Line(sw).Line(se).Fill(img, Xform2D::Map(iNW,iSW,iSE,nw,sw,se), flags);
			}
			{
				Pointf nw(100,700);
				Pointf ne(650,750);
				Pointf sw(100,1200);
				Pointf se(650,1350);
				w.Move(nw).Line(ne).Line(se).Fill(img, Xform2D::Map(iNW,iNE,iSE,nw,ne,se), flags);
				w.Move(nw).Line(sw).Line(se).Fill(img, Xform2D::Map(iNW,iSW,iSE,nw,sw,se), flags);
			}
			{
				Pointf nw(650,750);
				Pointf ne(1300,720);
				Pointf sw(650,1350);
				Pointf se(1300,1220);
				w.Move(nw).Line(ne).Line(se).Fill(img, Xform2D::Map(iNW,iNE,iSE,nw,ne,se), flags);
				w.Move(nw).Line(sw).Line(se).Fill(img, Xform2D::Map(iNW,iSW,iSE,nw,sw,se), flags);
			}

			w.Finish();
		}
		SetSurface(draw,Rect(ib.GetSize()),ib,ib.GetSize(),Point(0,0));
	}
};

GUI_APP_MAIN
{
	PainterImageMapping().Run();
}


Best regards,

Tom

[EDIT] - Expanded testcase to include another row of tiles. This effectively adds (nearly) horizontal facing edges.

[Updated on: Tue, 31 March 2020 13:23]

Report message to a moderator

 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Ide: GUI font settings and some skins
Next Topic: svn/github now has auto-generated Makefile
Goto Forum:
  


Current Time: Wed Apr 24 18:11:03 CEST 2024

Total time taken to generate the page: 0.02892 seconds