예제 #1
0
파일: Profile.cs 프로젝트: hbons/f-spot
 public Profile(IccColorSpace color_space, ToneCurve [] gamma)
 {
     Handle = new HandleRef (this, NativeMethods.CmsCreateLinearizationDeviceLink (color_space, CopyHandles (gamma)));
 }
예제 #2
0
파일: Profile.cs 프로젝트: hbons/f-spot
 public Profile(ColorCIExyY whitepoint, ColorCIExyYTriple primaries, ToneCurve [] gamma)
 {
     Handle = new HandleRef (this, NativeMethods.CmsCreateRGBProfile (out whitepoint, out primaries, CopyHandles (gamma)));
 }
예제 #3
0
파일: Profile.cs 프로젝트: hbons/f-spot
        private static HandleRef[] CopyHandles(ToneCurve [] gamma)
        {
            if (gamma == null)
                return null;

            HandleRef [] gamma_handles = new HandleRef [gamma.Length];
            for (int i = 0; i < gamma_handles.Length; i++)
                gamma_handles [i] = gamma [i].Handle;

            return gamma_handles;
        }
예제 #4
0
파일: Profile.cs 프로젝트: hbons/f-spot
 public static Profile CreateGray(ColorCIExyY whitePoint, ToneCurve transfer)
 {
     if (transfer == null)
         return new Profile (NativeMethods.CmsCreateGrayProfile (ref whitePoint, new ToneCurve (2.2).Handle));
     else
         return new Profile (NativeMethods.CmsCreateGrayProfile (ref whitePoint, transfer.Handle));
 }
예제 #5
0
파일: Profile.cs 프로젝트: hbons/f-spot
        public static Profile CreateAlternateRgb()
        {
            // FIXME I'm basing this off the values set in the camera
            // exif data when the adobe profile is selected.  They could
            // easily be off
            ColorCIExyY wp = new ColorCIExyY (.3127, .329, 1.0);
            ColorCIExyYTriple primaries = new ColorCIExyYTriple (
                new ColorCIExyY (.64, .33, 1.0),
                new ColorCIExyY (.21, .71, 1.0),
                new ColorCIExyY (.15, .06, 1.0));
            ToneCurve tc = new ToneCurve (2.2);
            ToneCurve [] tcs = new ToneCurve [] { tc, tc, tc, tc};

            return new Profile (wp, primaries, tcs);
        }
예제 #6
0
파일: Profile.cs 프로젝트: hbons/f-spot
        public static Profile CreateAbstract(int nLUTPoints,
						      double Exposure,
						      double Bright,
						      double Contrast,
						      double Hue,
						      double Saturation,
						      ToneCurve [] tables,
						      ColorCIExyY srcWp,
						      ColorCIExyY destWp)
        {
            if (tables == null) {
                ToneCurve gamma = new ToneCurve (Math.Pow (10, -Bright/100));
                ToneCurve line = new ToneCurve (1.0);
                tables = new ToneCurve [] { gamma, line, line };
            }

            /*
            System.Console.WriteLine ("e {0}", Exposure);
            System.Console.WriteLine ("b {0}", Bright);
            System.Console.WriteLine ("c {0}", Contrast);
            System.Console.WriteLine ("h {0}", Hue);
            System.Console.WriteLine ("s {0} {1} {2}", Saturation, srcWp, destWp);
            */
            return new Profile (NativeMethods.FCmsCreateBCHSWabstractProfile (nLUTPoints,
                                         Exposure,
                                         0.0, //Bright,
                                         Contrast,
                                         Hue,
                                         Saturation,
                                         ref srcWp,
                                         ref destWp,
                                         CopyHandles (tables)));
        }
예제 #7
0
파일: Profile.cs 프로젝트: hbons/f-spot
        public static Profile CreateAbstract(int nLUTPoints,
						      double Exposure,
						      double Bright,
						      double Contrast,
						      double Hue,
						      double Saturation,
						      int TempSrc,
						      int TempDest)
        {
            #if true
            ToneCurve gamma = new ToneCurve (Math.Pow (10, -Bright/100));
            ToneCurve line = new ToneCurve (1.0);
            ToneCurve [] tables = new ToneCurve [] { gamma, line, line };
            return CreateAbstract (nLUTPoints, Exposure, 0.0, Contrast, Hue, Saturation, tables,
                           ColorCIExyY.WhitePointFromTemperature (TempSrc),
                           ColorCIExyY.WhitePointFromTemperature (TempDest));
            #else
            GammaTable [] tables = null;
            return CreateAbstract (nLUTPoints, Exposure, Bright, Contrast, Hue, Saturation, tables,
                           ColorCIExyY.WhitePointFromTemperature (TempSrc),
                           ColorCIExyY.WhitePointFromTemperature (TempDest));
            #endif
        }