Jump to content

TR's & EER's Drum Skin v1.3 (Mar 27, 2014)


Recommended Posts

TechnoRobbo's & Ego Eram Reputo's  Drum Skin

 

A Plugin that Re-Maps Rectangular Images into Circular Images.

 

Originally designed for Bass Drum Skin Text

http://forums.getpaint.net/index.php?/topic/28071-how-to-make-text-into-a-circle/?p=406359

 

 

v1.4 - PDN 3.5 Compatible

 

Menu: Effects->Distort

DrumSkinMenu.PNG?raw=1

 

V1.1 Video

 

 

The Code:

Hidden Content:
// Submenu: Distort
// Name: TR's & EER's Drum Skin
// Title: TR's & EER's Drum Skin - v1.3
// Author: TechnoRobbo & Ego Eram Reputo
 
#region UICode
double Amount1 = 0.5; // [0,1] Intensity
double Amount2 = 1; // [0,1] Magnify X
double Amount3 = 1; // [0,1] Magnify Y
int Amount4 = 50; // [25,75] Width
int Amount5 = 50; // [25,75] Height
#endregion
 
 
void Render(Surface dst, Surface src, Rectangle rect)
{
    Rectangle selection = EnvironmentParameters.GetSelection(src.Bounds).GetBoundsInt();
    float CenterX = ((selection.Right - selection.Left) / 2)+selection.Left;
    float CenterY= ((selection.Bottom - selection.Top) / 2)+selection.Top;
 
    float offx=0,offy=0;
    ColorBgra CurrentPixel;
    for (float y = rect.Top; y < rect.Bottom; y++)
    {
        for (float x = rect.Left; x < rect.Right; x++)
        {
            float nx  = (x - CenterX);
            float ny  = (y - CenterY);
            
            nx /= CenterX * (float)Amount4/50;
            ny /= CenterY * (float) Amount5/50;
            
            offx = nx / (float)Math.Sqrt(1 -  Amount1 * (ny * ny))* CenterX * (float)Amount2 + CenterX;
            offy = ny / (float)Math.Sqrt(1 -  Amount1 * (nx * nx))* CenterY * (float)Amount3 + CenterY;
            
 
            CurrentPixel = src.GetBilinearSample((float)offx,(float)offy);
            dst[(int)x,(int)y]=CurrentPixel;
 
        }
    }
 
}
 

TRsDrumSkin.zip

Edited by TechnoRobbo
  • Upvote 6

Go out there and be amazing. Have Fun, TR
TRsSig.png?raw=1
Some Pretty Pictures Some Cool Plugins

Link to comment
Share on other sites

I tawt I taw a puddy tat!

Just to be clear, rectangular image become ellipsoid, and square become circular.

Cool name for the plugin!

  • Upvote 2
Link to comment
Share on other sites

If I may be so bold.....

With a couple of little changes to your code, the image can be further distorted to get a round result from a rectangular canvas. I took the liberty and added two controls, Height and Width.

These can be used as a pseudo resize if you don't want the result to fill the canvas to the edges.

yhsjjie-1154.png

Hidden Content:
  • Upvote 2
Link to comment
Share on other sites

 

 

If I may be so bold.....

With a couple of little changes to your code, the image can be further distorted to get a round result from a rectangular canvas. I took the liberty and added two controls, Height and Width.

And if I may be so bold as to incorporate your code and add magnification sliders and include your name in the Title

 

TR's & EER's Drumskin Version 1.3 uploaded.

  • Upvote 1

Go out there and be amazing. Have Fun, TR
TRsSig.png?raw=1
Some Pretty Pictures Some Cool Plugins

Link to comment
Share on other sites

And if I may be so bold as to incorporate your code ..... and include your name in the Title

 

You have my permission (and thanks) :D  I don't really think my little bit of code should grant me co-authorship - I'm still bewildered by the remapping code ;)

 

 

 

even though it is listed in the PDN Effects file it does not show up in the program

 

@ TR - have you ported the CodeLab source to VS?

Link to comment
Share on other sites

Sorry, I think the confusion is the name change the new one will appear as

Drumskin%20New%20%281%29.png?raw=1

 

 

 

it was compiled under vista to be 3.5 compatible - sorry again

 

 

 

 

 I don't really think my little bit of code should grant me co-authorship - I'm still bewildered by the remapping code - EGO

Heck I didn't come up with the algorithm - Pythagoras did.

Edited by TechnoRobbo

Go out there and be amazing. Have Fun, TR
TRsSig.png?raw=1
Some Pretty Pictures Some Cool Plugins

Link to comment
Share on other sites

These are the only TR plugin's I have in the Distort sub menu Drum skin is not showing.

submenu_zpsf05b5ee3.jpg

Even though it is in my effects folder (downloaded again Today) 

effects_zpsef0d58df.jpg

 

Do you have the first version of this you could maybe upload again?

HFuQlot.png

 

 

 

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...