Esempio n. 1
0
 internal static LCMSEnums.ConvertProfileStatus ConvertToProfile(
     LCMSProfileHandle inputProfile,
     LCMSProfileHandle outputProfile,
     RenderingIntent renderingIntent,
     LCMSEnums.TransformFlags flags,
     ref LCMSStructs.BitmapData input,
     ref LCMSStructs.BitmapData output
     )
 {
     if (IntPtr.Size == 8)
     {
         return(LCMS_64.ConvertToProfile(
                    inputProfile,
                    outputProfile,
                    renderingIntent,
                    flags,
                    ref input,
                    ref output
                    ));
     }
     else
     {
         return(LCMS_86.ConvertToProfile(
                    inputProfile,
                    outputProfile,
                    renderingIntent,
                    flags,
                    ref input,
                    ref output
                    ));
     }
 }
Esempio n. 2
0
 private static void SetGamutWarningColor(Color gamutWarningColor)
 {
     if (IntPtr.Size == 8)
     {
         LCMS_64.SetGamutWarningColor(gamutWarningColor.R, gamutWarningColor.G, gamutWarningColor.B);
     }
     else
     {
         LCMS_86.SetGamutWarningColor(gamutWarningColor.R, gamutWarningColor.G, gamutWarningColor.B);
     }
 }
Esempio n. 3
0
 internal static bool SaveColorProfile(LCMSProfileHandle hProfile, string fileName)
 {
     if (IntPtr.Size == 8)
     {
         return(LCMS_64.SaveColorProfileToFile(hProfile, fileName));
     }
     else
     {
         return(LCMS_86.SaveColorProfileToFile(hProfile, fileName));
     }
 }
Esempio n. 4
0
 internal static LCMSProfileHandle OpenColorProfile(string fileName)
 {
     if (IntPtr.Size == 8)
     {
         return(LCMS_64.OpenColorProfileFromFile(fileName));
     }
     else
     {
         return(LCMS_86.OpenColorProfileFromFile(fileName));
     }
 }
Esempio n. 5
0
 internal static void SetProfileRenderingIntent(LCMSProfileHandle hProfile, RenderingIntent newRenderingIntent)
 {
     if (IntPtr.Size == 8)
     {
         LCMS_64.SetProfileRenderingIntent(hProfile, newRenderingIntent);
     }
     else
     {
         LCMS_86.SetProfileRenderingIntent(hProfile, newRenderingIntent);
     }
 }
Esempio n. 6
0
 internal static RenderingIntent GetProfileRenderingIntent(LCMSProfileHandle hProfile)
 {
     if (IntPtr.Size == 8)
     {
         return(LCMS_64.GetProfileRenderingIntent(hProfile));
     }
     else
     {
         return(LCMS_86.GetProfileRenderingIntent(hProfile));
     }
 }
Esempio n. 7
0
 internal static ProfileColorSpace GetProfileColorSpace(LCMSProfileHandle hProfile)
 {
     if (IntPtr.Size == 8)
     {
         return(LCMS_64.GetProfileColorSpace(hProfile));
     }
     else
     {
         return(LCMS_86.GetProfileColorSpace(hProfile));
     }
 }
Esempio n. 8
0
 internal static uint GetProfileInfoSize(LCMSProfileHandle hProfile, LCMSEnums.ProfileInfoType infoType)
 {
     if (IntPtr.Size == 8)
     {
         return(LCMS_64.GetColorProfileInfoSize(hProfile, infoType));
     }
     else
     {
         return(LCMS_86.GetColorProfileInfoSize(hProfile, infoType));
     }
 }
Esempio n. 9
0
        internal static LCMSTransformHandle CreateProofingTransformBGRA8(
            LCMSProfileHandle input,
            LCMSProfileHandle display,
            RenderingIntent displayIntent,
            LCMSProfileHandle proofing,
            RenderingIntent proofingIntent,
            bool checkGamut,
            Color gamutWarningColor,
            bool blackPointCompensation
            )
        {
            LCMSEnums.TransformFlags flags = LCMSEnums.TransformFlags.None;

            if (checkGamut)
            {
                flags |= LCMSEnums.TransformFlags.GamutCheck;
                SetGamutWarningColor(gamutWarningColor);
            }
            else
            {
                flags |= LCMSEnums.TransformFlags.SoftProofing;
            }

            if (UseBlackPointCompensation(blackPointCompensation, proofingIntent))
            {
                flags |= LCMSEnums.TransformFlags.BlackPointCompensation;
            }

            if (IntPtr.Size == 8)
            {
                return(LCMS_64.CreateProofingTransformBGRA8(
                           input,
                           display,
                           displayIntent,
                           proofing,
                           proofingIntent,
                           flags
                           ));
            }
            else
            {
                return(LCMS_86.CreateProofingTransformBGRA8(
                           input,
                           display,
                           displayIntent,
                           proofing,
                           proofingIntent,
                           flags
                           ));
            }
        }
Esempio n. 10
0
        internal static string GetProfileInfo(LCMSProfileHandle hProfile, LCMSEnums.ProfileInfoType infoType, uint bufferSize)
        {
            if (bufferSize > 0U)
            {
                uint          result;
                StringBuilder buffer = new StringBuilder((int)bufferSize);

                if (IntPtr.Size == 8)
                {
                    result = LCMS_64.GetColorProfileInfo(hProfile, infoType, buffer, bufferSize);
                }
                else
                {
                    result = LCMS_86.GetColorProfileInfo(hProfile, infoType, buffer, bufferSize);
                }

                if (result > 0U)
                {
                    return(buffer.ToString());
                }
            }

            return(string.Empty);
        }
 protected override bool ReleaseHandle()
 {
     return(LCMS_86.CloseColorProfile(this.handle));
 }
 protected override bool ReleaseHandle()
 {
     LCMS_86.DeleteTransform(this.handle);
     return(true);
 }