|
25 | 25 | // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. |
26 | 26 | // |
27 | 27 | using System; |
| 28 | +using System.ComponentModel; |
28 | 29 |
|
29 | 30 | using Foundation; |
30 | 31 | using CoreGraphics; |
|
39 | 40 |
|
40 | 41 | namespace CoreImage { |
41 | 42 | /// <summary>Use to configure the CIContext rendering pipeline.</summary> |
42 | | - /// <remarks>You would use an instance of this class to configure the CIContext rendering operations.</remarks> |
| 43 | + /// <remarks>You would use an instance of this class to configure the CIContext rendering operations.</remarks> |
43 | 44 | [SupportedOSPlatform ("ios")] |
44 | 45 | [SupportedOSPlatform ("maccatalyst")] |
45 | 46 | [SupportedOSPlatform ("macos")] |
46 | 47 | [SupportedOSPlatform ("tvos")] |
47 | | - public class CIContextOptions : DictionaryContainer { |
48 | | - |
49 | | - /// <summary>Creates an empty set of options for CIContext rendering.</summary> |
50 | | - /// <remarks> |
51 | | - /// </remarks> |
52 | | - public CIContextOptions () |
53 | | - { |
54 | | - } |
55 | | - |
56 | | - /// <param name="dictionary">To be added.</param> |
57 | | - /// <summary>Constructs a new <see cref="CoreImage.CIContextOptions" /> object using the options specified in <paramref name="dictionary" />.</summary> |
58 | | - /// <remarks>To be added.</remarks> |
59 | | - public CIContextOptions (NSDictionary dictionary) |
60 | | - : base (dictionary) |
61 | | - { |
62 | | - } |
63 | | - |
64 | | - /// <summary>The desired CIColorSpace to be used for the CIContext rendering operation.</summary> |
65 | | - /// <value> |
66 | | - /// </value> |
67 | | - /// <remarks>This color space is used before the image is rendered into the output.</remarks> |
68 | | - public CGColorSpace? OutputColorSpace { |
69 | | - get { |
70 | | - return GetNativeValue<CGColorSpace> (CIContext.OutputColorSpace); |
71 | | - } |
72 | | - set { |
73 | | - SetNativeValue (CIContext.OutputColorSpace, value); |
74 | | - } |
75 | | - } |
76 | | - |
77 | | - /// <summary>The colorspace used by image processing operations, this is different than the colorspace used for the final rendering.</summary> |
78 | | - /// <value>To be added.</value> |
79 | | - /// <remarks>To be added.</remarks> |
80 | | - public CGColorSpace? WorkingColorSpace { |
81 | | - get { |
82 | | - return GetNativeValue<CGColorSpace> (CIContext._WorkingColorSpace); |
83 | | - } |
84 | | - set { |
85 | | - SetNativeValue (CIContext._WorkingColorSpace, value); |
86 | | - } |
87 | | - } |
88 | | - |
89 | | -#if __MACOS__ |
90 | | - /// <include file="../../docs/api/CoreImage/CIContextOptions.xml" path="/Documentation/Docs[@DocId='macOS:P:CoreImage.CIContextOptions.UseSoftwareRenderer']/*" /> |
91 | | -#else |
92 | | - /// <include file="../../docs/api/CoreImage/CIContextOptions.xml" path="/Documentation/Docs[@DocId='P:CoreImage.CIContextOptions.UseSoftwareRenderer']/*" /> |
93 | | -#endif |
| 48 | + public partial class CIContextOptions : DictionaryContainer { |
| 49 | +#if !XAMCORE_5_0 |
| 50 | + [EditorBrowsable (EditorBrowsableState.Never)] |
| 51 | + [Obsolete ("Use 'NullableUseSoftwareRenderer' instead.")] |
94 | 52 | public bool UseSoftwareRenderer { |
95 | 53 | get { |
96 | | - var b = GetBoolValue (CIContext.UseSoftwareRenderer); |
| 54 | + var b = GetBoolValue (CIContextOptionKeys.UseSoftwareRenderer); |
97 | 55 | return b.HasValue ? b.Value : false; |
98 | 56 | } |
99 | 57 | set { |
100 | | - SetBooleanValue (CIContext.UseSoftwareRenderer, value); |
| 58 | + SetBooleanValue (CIContextOptionKeys.UseSoftwareRenderer, value); |
101 | 59 | } |
102 | 60 | } |
103 | 61 |
|
104 | 62 | /// <summary>Gets or sets the image format to use for storing intermediate rendering results.</summary> |
105 | | - /// <value>To be added.</value> |
106 | | - /// <remarks>To be added.</remarks> |
| 63 | + [EditorBrowsable (EditorBrowsableState.Never)] |
| 64 | + [Obsolete ("Use 'WorkingFormatField' instead.")] |
107 | 65 | public int? CIImageFormat { |
108 | 66 | get { |
109 | | - return GetInt32Value (CIContext.WorkingFormatField); |
110 | | - } |
111 | | - set { |
112 | | - SetNumberValue (CIContext.WorkingFormatField, value); |
113 | | - } |
114 | | - } |
115 | | - |
116 | | - /// <summary>Gets or sets whether to request low priority from the GPU.</summary> |
117 | | - /// <value>To be added.</value> |
118 | | - /// <remarks>To be added.</remarks> |
119 | | - [SupportedOSPlatform ("macos")] |
120 | | - [SupportedOSPlatform ("ios")] |
121 | | - [SupportedOSPlatform ("maccatalyst")] |
122 | | - [SupportedOSPlatform ("tvos")] |
123 | | - public bool? PriorityRequestLow { |
124 | | - get { |
125 | | - return GetBoolValue (CIContext.PriorityRequestLow); |
126 | | - } |
127 | | - set { |
128 | | - SetBooleanValue (CIContext.PriorityRequestLow, value); |
129 | | - } |
130 | | - } |
131 | | - |
132 | | - /// <summary> |
133 | | - /// <see langword="true" /> if downsampling should be higher quality at the expense of performance.</summary> |
134 | | - /// <value>To be added.</value> |
135 | | - /// <remarks>To be added.</remarks> |
136 | | - public bool? HighQualityDownsample { |
137 | | - get { |
138 | | - return GetBoolValue (CIContext.HighQualityDownsample); |
139 | | - } |
140 | | - set { |
141 | | - SetBooleanValue (CIContext.HighQualityDownsample, value); |
142 | | - } |
143 | | - } |
144 | | - |
145 | | - /// <summary>If <see langword="true" />, the output should premultiply pixel values by their alpha values.</summary> |
146 | | - /// <value>To be added.</value> |
147 | | - /// <remarks>To be added.</remarks> |
148 | | - [SupportedOSPlatform ("ios")] |
149 | | - [SupportedOSPlatform ("maccatalyst")] |
150 | | - [SupportedOSPlatform ("macos")] |
151 | | - [SupportedOSPlatform ("tvos")] |
152 | | - public bool? OutputPremultiplied { |
153 | | - get { |
154 | | - return GetBoolValue (CIContext.OutputPremultiplied); |
155 | | - } |
156 | | - set { |
157 | | - SetBooleanValue (CIContext.OutputPremultiplied, value); |
158 | | - } |
159 | | - } |
160 | | - |
161 | | - /// <summary>If not <see langword="null" />, <see langword="true" /> indicates that intermediate images should be cached.</summary> |
162 | | - /// <value>To be added.</value> |
163 | | - /// <remarks>To be added.</remarks> |
164 | | - [SupportedOSPlatform ("ios")] |
165 | | - [SupportedOSPlatform ("macos")] |
166 | | - [SupportedOSPlatform ("maccatalyst")] |
167 | | - [SupportedOSPlatform ("tvos")] |
168 | | - public bool? CacheIntermediates { |
169 | | - get { |
170 | | - return GetBoolValue (CIContext.CacheIntermediates); |
171 | | - } |
172 | | - set { |
173 | | - SetBooleanValue (CIContext.CacheIntermediates, value); |
174 | | - } |
175 | | - } |
176 | | - |
177 | | - [SupportedOSPlatform ("ios13.0")] |
178 | | - [SupportedOSPlatform ("tvos13.0")] |
179 | | - [SupportedOSPlatform ("macos")] |
180 | | - [SupportedOSPlatform ("maccatalyst")] |
181 | | - public bool? AllowLowPower { |
182 | | - get { |
183 | | - return GetBoolValue (CIContext.AllowLowPower); |
184 | | - } |
185 | | - set { |
186 | | - SetBooleanValue (CIContext.AllowLowPower, value); |
187 | | - } |
188 | | - } |
189 | | - |
190 | | - [SupportedOSPlatform ("ios14.0")] |
191 | | - [SupportedOSPlatform ("tvos14.0")] |
192 | | - [SupportedOSPlatform ("macos")] |
193 | | - [SupportedOSPlatform ("maccatalyst")] |
194 | | - public string? Name { |
195 | | - get { |
196 | | - return GetStringValue (CIContext.Name); |
| 67 | + return GetInt32Value (CIContextOptionKeys.WorkingFormatField); |
197 | 68 | } |
198 | 69 | set { |
199 | | - SetStringValue (CIContext.Name, value); |
| 70 | + SetNumberValue (CIContextOptionKeys.WorkingFormatField, value); |
200 | 71 | } |
201 | 72 | } |
| 73 | +#endif // !XAMCORE_5_0 |
202 | 74 | } |
203 | 75 |
|
204 | 76 | public partial class CIContext { |
|
0 commit comments