Jump to content

How-to swap channels ?


Recommended Posts

Yeah, and so would this CodeLab script:

void Render(Surface dst, Surface src, Rectangle rect)
{
   ColorBgra CurrentPixel;
   for (int y = rect.Top; y     {
       for (int x = rect.Left; x         {
           CurrentPixel = src[x,y];
           byte tempR = CurrentPixel.R;
           CurrentPixel.R = CurrentPixel.B;
           CurrentPixel.B = tempR;
           dst[x,y] = CurrentPixel;
       }
   }
}

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to comment
Share on other sites

Yeah, and so would this CodeLab script:

void Render(Surface dst, Surface src, Rectangle rect)
{
   ColorBgra CurrentPixel;
   for (int y = rect.Top; y < rect.Bottom; y++)
   {
       for (int x = rect.Left; x < rect.Right; x++)
       {
           CurrentPixel = src[x,y];
           byte tempR = CurrentPixel.R;
           CurrentPixel.R = CurrentPixel.B;
           CurrentPixel.B = tempR;
           dst[x,y] = CurrentPixel;
       }
   }
}

Hey, that's kinda like a bubble sort!

 

Take responsibility for your own intelligence. ;) -Rick Brewster

Link to comment
Share on other sites

Yeah, and so would this CodeLab script:

void Render(Surface dst, Surface src, Rectangle rect)
{
   ColorBgra CurrentPixel;
   for (int y = rect.Top; y     {
       for (int x = rect.Left; x         {
           CurrentPixel = src[x,y];
           byte tempR = CurrentPixel.R;
           CurrentPixel.R = CurrentPixel.B;
           CurrentPixel.B = tempR;
           dst[x,y] = CurrentPixel;
       }
   }
}

Hey, that's kinda like a bubble sort!

Only in Bizzaro world.

Click to play:
j.pngs.pngd.pnga.pngp.png
Download: BoltBait's Plugin Pack | CodeLab | and how about a Computer Dominos Game

Link to comment
Share on other sites

Guest
This topic is now closed to further replies.
 Share

×
×
  • Create New...