Example #1
0
        public override Channel Clone()
        {
            ChannelUInt16 clone = new ChannelUInt16(Width, Height);

            for (int x = 0; x < Width; x++)
            {
                for (int y = 0; y < Height; y++)
                {
                    clone[x, y] = Pixels[x, y];
                }
            }
            return(clone);
        }
Example #2
0
        public override GenericChannel <ushort> Add(GenericChannel <ushort> other)
        {
            ChannelUInt16 outcome = new ChannelUInt16(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 > ushort.MaxValue)
                    {
                        newValue = ushort.MaxValue;
                    }
                    outcome[x, y] = (ushort)newValue;
                }
            }
            return(outcome);
        }