mirror of
https://gitee.com/csharpui/CPF.git
synced 2025-04-05 17:37:51 +08:00
50 lines
1.0 KiB
C#
50 lines
1.0 KiB
C#
using CPF.Mac.CoreFoundation;
|
|
using CPF.Mac.CoreGraphics;
|
|
using CPF.Mac.Foundation;
|
|
|
|
namespace CPF.Mac.CoreImage
|
|
{
|
|
public class CIContextOptions
|
|
{
|
|
public CGColorSpace OutputColorSpace
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public CGColorSpace WorkingColorSpace
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
public bool UseSoftwareRenderer
|
|
{
|
|
get;
|
|
set;
|
|
}
|
|
|
|
internal NSDictionary ToDictionary()
|
|
{
|
|
if (OutputColorSpace == null && WorkingColorSpace == null && !UseSoftwareRenderer)
|
|
{
|
|
return null;
|
|
}
|
|
NSMutableDictionary nSMutableDictionary = new NSMutableDictionary();
|
|
if (OutputColorSpace != null)
|
|
{
|
|
nSMutableDictionary.LowlevelSetObject(OutputColorSpace.Handle, CIContext.OutputColorSpace.Handle);
|
|
}
|
|
if (WorkingColorSpace != null)
|
|
{
|
|
nSMutableDictionary.LowlevelSetObject(WorkingColorSpace.Handle, CIContext.WorkingColorSpace.Handle);
|
|
}
|
|
if (UseSoftwareRenderer)
|
|
{
|
|
nSMutableDictionary.LowlevelSetObject(CFBoolean.True.Handle, CIContext.UseSoftwareRenderer.Handle);
|
|
}
|
|
return nSMutableDictionary;
|
|
}
|
|
}
|
|
}
|