ConvertXyyToLinearSRgb() 공개 메소드

public ConvertXyyToLinearSRgb ( ) : void
리턴 void
예제 #1
0
파일: Program.cs 프로젝트: EFanZh/EFanZh
        private static void GenerateXyyColors(Bitmap bitmap, double bigY)
        {
            double width = bitmap.Width - 1;
            double height = bitmap.Width - 1;

            for (int y = 0; y < bitmap.Height; y++)
            {
                for (int x = 0; x <= y; x++)
                {
                    double cx = (x + 0.5) / width;
                    double cy = 1.0 - (y + 0.5) / height;

                    ColorVector colorVector = new ColorVector()
                    {
                        Component1 = cx,
                        Component2 = cy,
                        Component3 = bigY
                    };

                    colorVector.ConvertXyyToLinearSRgb();

                    if (colorVector.IsCanonical())
                    {
                        colorVector.ConvertLinearSRgbToSRgb();

                        bitmap.SetPixel(x, y, colorVector.ToColor());
                    }
                }
            }
        }
예제 #2
0
파일: Program.cs 프로젝트: EFanZh/EFanZh
        private static void GenerateXyYPlane(Bitmap bitmap, double bigY)
        {
            for (int y = 0; y < bitmap.Height; y++)
            {
                for (int x = 0; x < bitmap.Width; x++)
                {
                    double cx = (x + 0.5) / bitmap.Width;
                    double cy = (y + 0.5) / bitmap.Height;
                    ColorVector colorVector = new ColorVector(cx, cy, bigY);

                    colorVector.ConvertXyyToLinearSRgb();
                    colorVector.CompressLuminance();
                    colorVector.ConvertLinearSRgbToSRgb();

                    bitmap.SetPixel(x, bitmap.Height - 1 - y, colorVector.ToColor());
                }
                Console.WriteLine(y);
            }
        }