2013-02-07 139 views

回答

0

据我所知,C#和关联的库不包含任何将CMYK或RGB转换为Lab的函数。包含用于将CMYK转换为RGB的函数(请参阅此answer)。

Windows API似乎具有用于在不同颜色系统之间转换的功能。它至少适用于将RGB转换为CMYK(请参见answer)。

你可能需要以下扩展名:

[StructLayout(LayoutKind.Sequential)] 
    public struct LabCOLOR 
    { 
     public ushort L; 
     public ushort a; 
     public ushort b; 
     public ushort pad; 
    }; 

    [DllImport("mscms.dll", SetLastError = true, CallingConvention = CallingConvention.Winapi)] 
    static extern bool TranslateColors(
     IntPtr hColorTransform, 
     [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2), In] RGBColor[] inputColors, 
     uint nColors, 
     ColorType ctInput, 
     [MarshalAs(UnmanagedType.LPArray, SizeParamIndex = 2), Out] LABColor[] outputColors, 
     ColorType ctOutput); 

那么你应该能够取代“CMYK”和“实验室”从RGB转换为Lab颜色。我还没有尝试过。

+0

杜你知道吗,我是否可以在“mscms”中导入特定的ICC配置文件来转换此颜色。我知道这在LittleCMS中是可行的,但我从来没有从事pInfoke引用。 – Maxim

0

应该可以在Lab空间ICC配置文件的帮助下“转换”为CIE实验室。 AGFA曾经有一个。否则,必须编写一个例程,以手动在ICM之外通过A2B0标签对输出配置文件进行转换。请注意,ISOnewspaperv4个人资料非常简单。