public override Image ToUInt16()
        {
            ImageUInt16Gray uint16Image = new ImageUInt16Gray(Width, Height);
            double          multiplier  = (double)ushort.MaxValue + 1;

            for (int x = 0; x < Width; x++)
            {
                for (int y = 0; y < Height; y++)
                {
                    uint16Image.Gray[x, y] = (ushort)(Gray[x, y] * multiplier);
                }
            }
            return(uint16Image);
        }
Esempio n. 2
0
        public override Image ToUInt16()
        {
            ImageUInt16Gray uint16Image = new ImageUInt16Gray(Width, Height);
            long            divider     = ((long)uint.MaxValue + 1) / (ushort.MaxValue + 1);

            for (int x = 0; x < Width; x++)
            {
                for (int y = 0; y < Height; y++)
                {
                    uint16Image.Gray[x, y] = (ushort)(Gray[x, y] / divider);
                }
            }
            return(uint16Image);
        }