protected override List <Cms.Profile> GenerateAdjustments() { List <Cms.Profile> profiles = new List <Cms.Profile> (); profiles.Add(InputProfile); profiles.Add(Cms.Profile.CreateAbstract(nsteps, 1.0, 0.0, 0.0, 0.0, -100.0, null, ColorCIExyY.D50, ColorCIExyY.D50)); profiles.Add(Cms.Profile.CreateAbstract(nsteps, 1.0, 32.0, 0.0, 0.0, 0.0, null, ColorCIExyY.D50, ColorCIExyY.WhitePointFromTemperature(9934))); profiles.Add(DestinationProfile); return(profiles); }
protected override Cms.Profile GenerateProfile() { return(Cms.Profile.CreateAbstract(nsteps, 1.0, 32.0, 0.0, 0.0, -100.0, null, ColorCIExyY.D50, ColorCIExyY.WhitePointFromTemperature(9934))); }
protected override List <Profile> GenerateAdjustments() { var profiles = new List <Profile> { InputProfile, Profile.CreateAbstract(nsteps, 1.0, 0.0, 0.0, 0.0, -100.0, null, ColorCIExyY.D50, ColorCIExyY.D50), Profile.CreateAbstract(nsteps, 1.0, 32.0, 0.0, 0.0, 0.0, null, ColorCIExyY.D50, ColorCIExyY.WhitePointFromTemperature(9934)), DestinationProfile }; return(profiles); }
public override Cms.Profile GetProfile () { ColorChunk color = null; IccpChunk icc = null; GammaChunk gamma = null; StandardRgbChunk srgb = null; double gamma_value = 2.2; ColorCIExyY red = new ColorCIExyY (0.64, 0.33, 1.0); ColorCIExyY green = new ColorCIExyY (0.3, 0.6, 1.0); ColorCIExyY blue = new ColorCIExyY (0.15, 0.06, 1.0); ColorCIExyY whitepoint = new ColorCIExyY (0.3127, 0.329, 1.0); ColorCIExyYTriple chroma = new ColorCIExyYTriple (red, green, blue); //System.Console.WriteLine ("Trying to get profile"); foreach (Chunk chunk in Chunks) { if (color == null) color = chunk as ColorChunk; if (icc == null) icc = chunk as IccpChunk; if (srgb == null) srgb = chunk as StandardRgbChunk; if (gamma == null) gamma = chunk as GammaChunk; } //System.Console.WriteLine ("color: {0} icc: {1} srgb: {2} gamma: {3}", color, icc, srgb, gamma); if (icc != null) { try { return new Profile (icc.Profile); } catch (System.Exception ex) { //System.Console.WriteLine ("Error trying to decode embedded profile" + ex.ToString ()); } } if (srgb != null) return Profile.CreateStandardRgb (); if (gamma != null) gamma_value = 1 / gamma.Gamma; if (color != null) { whitepoint = new ColorCIExyY (color.WhiteX.Value, color.WhiteY.Value, 1.0); red = new ColorCIExyY (color.RedX.Value, color.RedY.Value, 1.0); green = new ColorCIExyY (color.GreenX.Value, color.GreenY.Value, 1.0); blue = new ColorCIExyY (color.BlueX.Value, color.BlueY.Value, 1.0); chroma = new ColorCIExyYTriple (red, green, blue); } if (color != null || gamma != null) { GammaTable table = new GammaTable (1024, gamma_value); return new Profile (whitepoint, chroma, new GammaTable [] {table, table, table}); } return null; }