예제 #1
0
        public override Channel Clone()
        {
            ChannelUInt8 clone = new ChannelUInt8(Width, Height);

            for (int x = 0; x < Width; x++)
            {
                for (int y = 0; y < Height; y++)
                {
                    clone[x, y] = Pixels[x, y];
                }
            }
            return(clone);
        }
예제 #2
0
        public override GenericChannel <byte> Add(GenericChannel <byte> other)
        {
            ChannelUInt8 outcome = new ChannelUInt8(Width, Height);

            for (int x = 0; x < Width; x++)
            {
                for (int y = 0; y < Height; y++)
                {
                    int newValue = this[x, y] + other[x, y];
                    if (newValue > byte.MaxValue)
                    {
                        newValue = byte.MaxValue;
                    }
                    outcome[x, y] = (byte)newValue;
                }
            }
            return(outcome);
        }
예제 #3
0
 public ImageUInt8RGB(uint width, uint height) : base(width, height)
 {
     R = new ChannelUInt8(width, height);
     G = new ChannelUInt8(width, height);
     B = new ChannelUInt8(width, height);
 }