Apply() public method

public Apply ( PixelFunction pixelFunc ) : void
pixelFunc PixelFunction
return void
Esempio n. 1
0
        public override TextureResource Transform(TextureResource data, int width, int height)
        {
            //byte[] tdata = new byte[width * height];

            TextureResource transData = new TextureResource(width, height);
            transData.Apply((c, x, y) =>
            {
                return data[height - x, width - y];
            });

            /*for (int y = 0; y < height; y++) {
                for (int x = 0; x < width; x++) {
                    int dindex = y * width + x;
                    int tindex = (width - x) * height + y;
                    tdata[tindex] = data.RawData[dindex];
                }
            }*/

            return transData;
        }
Esempio n. 2
0
 private void SetTransparentColor(TextureResource resource)
 {
     ClearTransparentColor(resource);
     resource.Apply(c => {
         if (c.Equals(_transColor))
             return Colors.Transparent;
         else
             return c;
     });
 }