Пример #1
0
        public override Channel Clone()
        {
            ChannelUInt32 clone = new ChannelUInt32(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 <uint> Add(GenericChannel <uint> other)
        {
            ChannelUInt32 outcome = new ChannelUInt32(Width, Height);

            for (int x = 0; x < Width; x++)
            {
                for (int y = 0; y < Height; y++)
                {
                    long newValue = (long)this[x, y] + other[x, y];
                    if (newValue > uint.MaxValue)
                    {
                        newValue = uint.MaxValue;
                    }
                    outcome[x, y] = (uint)newValue;
                }
            }
            return(outcome);
        }