Sign in to follow this  
Followers 0
davidf

Seamless Move (3rd Nov 2012)

10 posts in this topic

Effects > Distort > Seamless Move

Note: it turns out this plugin is fairly redundant (see posts below), so feel free to ignore!

This is a small plugin to help create seamless images: it lets you scroll an image around, wrapping around the left & right and top & bottom of the image.

For an alternative, see the Seamless Texture Maker plugin (which does something similar to this with the "only cut" option, but with no scrolling): http://forums.getpai...?showtopic=4591.

seamless_move.jpg

The parameters are:

Position - drag to change the center of the image.

Fine tune X / Y - pixel perfect X and Y adjustment.

The CodeLab code is very short:

#region UICode
Pair<double, double> Amount1 = Pair.Create( 0.0 , 0.0 ); // Position
int Amount2 = 0; // [-100,100] Fine tune X
int Amount3 = 0; // [-100,100] Fine tune Y
#endregion

void Render(Surface dst, Surface src, Rectangle rect)
{
int w = src.Bounds.Width;
int h = src.Bounds.Height;
int dx = -((int) (Amount1.First * 0.5 * w) + Amount2);
int dy = -((int) (Amount1.Second * 0.5 * h) + Amount3);

for (int y = rect.Top; y < rect.Bottom; y++)
{
	int ypos = (y + dy) % h;
	if (ypos < 0) { ypos += h; }

	for (int x = rect.Left; x < rect.Right; x++)
	{
		int xpos = (x + dx) % w;
		if (xpos < 0) { xpos += w; }

		dst[x,y] = src[xpos,ypos];
	}
}
}

One problem is that there is no obvious way to reset the parameters to all zero when the effect is restarted; it always remembers the parameter values last used, which is not really appropriate for this particular plugin.

Anyone know of a way to do this (within either CodeLab or a Visual Studio project)?

Download: SeamlessMove.zip

Edited by davidf
0

Share this post


Link to post
Share on other sites

This looks interesting, will have a play around with it :) thanks for creating.

0

Share this post


Link to post
Share on other sites

I can get the same look with Rotate/Zoom :RotateZoom: with Tiling clicked.

0

Share this post


Link to post
Share on other sites

I can get the same look with Rotate/Zoom :RotateZoom: with Tiling clicked.

Ah, I hadn't noticed the Tiling option ... oh, well!

0

Share this post


Link to post
Share on other sites

Well, don't feel bad. I've been around almost from the beginning and even I don't know them all.

You might want to download the Plugin Index and do a quick search before starting a plugin.

We typically don't mind someone making improvements to existing plugins. But, exact duplicates are somewhat frowned upon. There are some people around here that download EVERY plugin!

FWIW, I've been enjoying your plugins so far. I've got my eye on you. ;)

You want to tackle something tough? How about a "seam carving" canvas plugin? :D

0

Share this post


Link to post
Share on other sites

FWIW, I've been enjoying your plugins so far. I've got my eye on you. ;)

Thanks!

You want to tackle something tough? How about a "seam carving" canvas plugin? :D

I'm already on something at the moment ... it's a surprise, though :smile:

It'll take a few more days (and then another few days to add the extra features I've thought of by then ...)

Is there a general area where people post ideas or requests for plugins, by the way? Or is that just mixed in with the other forums?

Edited by davidf
0

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0