Exemplo n.º 1
0
        public override Image ToUInt16()
        {
            ImageUInt16CMYK uint16Image = new ImageUInt16CMYK(Width, Height);
            double          multiplier  = (double)ushort.MaxValue + 1;

            for (int x = 0; x < Width; x++)
            {
                for (int y = 0; y < Height; y++)
                {
                    uint16Image.C[x, y] = (ushort)(C[x, y] * multiplier);
                    uint16Image.M[x, y] = (ushort)(M[x, y] * multiplier);
                    uint16Image.Y[x, y] = (ushort)(Y[x, y] * multiplier);
                    uint16Image.K[x, y] = (ushort)(K[x, y] * multiplier);
                }
            }
            return(uint16Image);
        }
Exemplo n.º 2
0
        public override Image ToUInt16()
        {
            ImageUInt16CMYK uint16Image = new ImageUInt16CMYK(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.C[x, y] = (ushort)(C[x, y] / divider);
                    uint16Image.M[x, y] = (ushort)(M[x, y] / divider);
                    uint16Image.Y[x, y] = (ushort)(Y[x, y] / divider);
                    uint16Image.K[x, y] = (ushort)(K[x, y] / divider);
                }
            }
            return(uint16Image);
        }