objc2_app_kit/generated/
NSBitmapImageRep.rs

1//! This file has been automatically generated by `objc2`'s `header-translator`.
2//! DO NOT EDIT
3use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-core-foundation")]
7use objc2_core_foundation::*;
8#[cfg(feature = "objc2-core-graphics")]
9#[cfg(target_vendor = "apple")]
10use objc2_core_graphics::*;
11#[cfg(feature = "objc2-core-image")]
12#[cfg(target_vendor = "apple")]
13use objc2_core_image::*;
14use objc2_foundation::*;
15
16use crate::*;
17
18/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstiffcompression?language=objc)
19// NS_ENUM
20#[repr(transparent)]
21#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
22pub struct NSTIFFCompression(pub NSUInteger);
23impl NSTIFFCompression {
24    #[doc(alias = "NSTIFFCompressionNone")]
25    pub const None: Self = Self(1);
26    #[doc(alias = "NSTIFFCompressionCCITTFAX3")]
27    pub const CCITTFAX3: Self = Self(3);
28    #[doc(alias = "NSTIFFCompressionCCITTFAX4")]
29    pub const CCITTFAX4: Self = Self(4);
30    #[doc(alias = "NSTIFFCompressionLZW")]
31    pub const LZW: Self = Self(5);
32    #[doc(alias = "NSTIFFCompressionJPEG")]
33    pub const JPEG: Self = Self(6);
34    #[doc(alias = "NSTIFFCompressionNEXT")]
35    pub const NEXT: Self = Self(32766);
36    #[doc(alias = "NSTIFFCompressionPackBits")]
37    pub const PackBits: Self = Self(32773);
38    #[doc(alias = "NSTIFFCompressionOldJPEG")]
39    pub const OldJPEG: Self = Self(32865);
40}
41
42unsafe impl Encode for NSTIFFCompression {
43    const ENCODING: Encoding = NSUInteger::ENCODING;
44}
45
46unsafe impl RefEncode for NSTIFFCompression {
47    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
48}
49
50/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbitmapimagefiletype?language=objc)
51// NS_ENUM
52#[repr(transparent)]
53#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
54pub struct NSBitmapImageFileType(pub NSUInteger);
55impl NSBitmapImageFileType {
56    #[doc(alias = "NSBitmapImageFileTypeTIFF")]
57    pub const TIFF: Self = Self(0);
58    #[doc(alias = "NSBitmapImageFileTypeBMP")]
59    pub const BMP: Self = Self(1);
60    #[doc(alias = "NSBitmapImageFileTypeGIF")]
61    pub const GIF: Self = Self(2);
62    #[doc(alias = "NSBitmapImageFileTypeJPEG")]
63    pub const JPEG: Self = Self(3);
64    #[doc(alias = "NSBitmapImageFileTypePNG")]
65    pub const PNG: Self = Self(4);
66    #[doc(alias = "NSBitmapImageFileTypeJPEG2000")]
67    pub const JPEG2000: Self = Self(5);
68}
69
70unsafe impl Encode for NSBitmapImageFileType {
71    const ENCODING: Encoding = NSUInteger::ENCODING;
72}
73
74unsafe impl RefEncode for NSBitmapImageFileType {
75    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
76}
77
78/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsimagereploadstatus?language=objc)
79// NS_ENUM
80#[repr(transparent)]
81#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
82pub struct NSImageRepLoadStatus(pub NSInteger);
83impl NSImageRepLoadStatus {
84    #[doc(alias = "NSImageRepLoadStatusUnknownType")]
85    pub const UnknownType: Self = Self(-1);
86    #[doc(alias = "NSImageRepLoadStatusReadingHeader")]
87    pub const ReadingHeader: Self = Self(-2);
88    #[doc(alias = "NSImageRepLoadStatusWillNeedAllData")]
89    pub const WillNeedAllData: Self = Self(-3);
90    #[doc(alias = "NSImageRepLoadStatusInvalidData")]
91    pub const InvalidData: Self = Self(-4);
92    #[doc(alias = "NSImageRepLoadStatusUnexpectedEOF")]
93    pub const UnexpectedEOF: Self = Self(-5);
94    #[doc(alias = "NSImageRepLoadStatusCompleted")]
95    pub const Completed: Self = Self(-6);
96}
97
98unsafe impl Encode for NSImageRepLoadStatus {
99    const ENCODING: Encoding = NSInteger::ENCODING;
100}
101
102unsafe impl RefEncode for NSImageRepLoadStatus {
103    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
104}
105
106/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbitmapformat?language=objc)
107// NS_OPTIONS
108#[repr(transparent)]
109#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
110pub struct NSBitmapFormat(pub NSUInteger);
111bitflags::bitflags! {
112    impl NSBitmapFormat: NSUInteger {
113        #[doc(alias = "NSBitmapFormatAlphaFirst")]
114        const AlphaFirst = 1<<0;
115        #[doc(alias = "NSBitmapFormatAlphaNonpremultiplied")]
116        const AlphaNonpremultiplied = 1<<1;
117        #[doc(alias = "NSBitmapFormatFloatingPointSamples")]
118        const FloatingPointSamples = 1<<2;
119        #[doc(alias = "NSBitmapFormatSixteenBitLittleEndian")]
120        const SixteenBitLittleEndian = 1<<8;
121        #[doc(alias = "NSBitmapFormatThirtyTwoBitLittleEndian")]
122        const ThirtyTwoBitLittleEndian = 1<<9;
123        #[doc(alias = "NSBitmapFormatSixteenBitBigEndian")]
124        const SixteenBitBigEndian = 1<<10;
125        #[doc(alias = "NSBitmapFormatThirtyTwoBitBigEndian")]
126        const ThirtyTwoBitBigEndian = 1<<11;
127    }
128}
129
130unsafe impl Encode for NSBitmapFormat {
131    const ENCODING: Encoding = NSUInteger::ENCODING;
132}
133
134unsafe impl RefEncode for NSBitmapFormat {
135    const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
136}
137
138/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbitmapimagereppropertykey?language=objc)
139// NS_TYPED_EXTENSIBLE_ENUM
140pub type NSBitmapImageRepPropertyKey = NSString;
141
142extern "C" {
143    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsimagecompressionmethod?language=objc)
144    pub static NSImageCompressionMethod: &'static NSBitmapImageRepPropertyKey;
145}
146
147extern "C" {
148    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsimagecompressionfactor?language=objc)
149    pub static NSImageCompressionFactor: &'static NSBitmapImageRepPropertyKey;
150}
151
152extern "C" {
153    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsimagedithertransparency?language=objc)
154    pub static NSImageDitherTransparency: &'static NSBitmapImageRepPropertyKey;
155}
156
157extern "C" {
158    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsimagergbcolortable?language=objc)
159    pub static NSImageRGBColorTable: &'static NSBitmapImageRepPropertyKey;
160}
161
162extern "C" {
163    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsimageinterlaced?language=objc)
164    pub static NSImageInterlaced: &'static NSBitmapImageRepPropertyKey;
165}
166
167extern "C" {
168    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsimagecolorsyncprofiledata?language=objc)
169    pub static NSImageColorSyncProfileData: &'static NSBitmapImageRepPropertyKey;
170}
171
172extern "C" {
173    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsimageframecount?language=objc)
174    pub static NSImageFrameCount: &'static NSBitmapImageRepPropertyKey;
175}
176
177extern "C" {
178    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsimagecurrentframe?language=objc)
179    pub static NSImageCurrentFrame: &'static NSBitmapImageRepPropertyKey;
180}
181
182extern "C" {
183    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsimagecurrentframeduration?language=objc)
184    pub static NSImageCurrentFrameDuration: &'static NSBitmapImageRepPropertyKey;
185}
186
187extern "C" {
188    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsimageloopcount?language=objc)
189    pub static NSImageLoopCount: &'static NSBitmapImageRepPropertyKey;
190}
191
192extern "C" {
193    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsimagegamma?language=objc)
194    pub static NSImageGamma: &'static NSBitmapImageRepPropertyKey;
195}
196
197extern "C" {
198    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsimageprogressive?language=objc)
199    pub static NSImageProgressive: &'static NSBitmapImageRepPropertyKey;
200}
201
202extern "C" {
203    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsimageexifdata?language=objc)
204    pub static NSImageEXIFData: &'static NSBitmapImageRepPropertyKey;
205}
206
207extern "C" {
208    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsimageiptcdata?language=objc)
209    pub static NSImageIPTCData: &'static NSBitmapImageRepPropertyKey;
210}
211
212extern "C" {
213    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsimagefallbackbackgroundcolor?language=objc)
214    pub static NSImageFallbackBackgroundColor: &'static NSBitmapImageRepPropertyKey;
215}
216
217extern_class!(
218    /// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbitmapimagerep?language=objc)
219    #[unsafe(super(NSImageRep, NSObject))]
220    #[derive(Debug, PartialEq, Eq, Hash)]
221    #[cfg(feature = "NSImageRep")]
222    pub struct NSBitmapImageRep;
223);
224
225#[cfg(feature = "NSImageRep")]
226extern_conformance!(
227    unsafe impl NSCoding for NSBitmapImageRep {}
228);
229
230#[cfg(feature = "NSImageRep")]
231extern_conformance!(
232    unsafe impl NSCopying for NSBitmapImageRep {}
233);
234
235#[cfg(feature = "NSImageRep")]
236unsafe impl CopyingHelper for NSBitmapImageRep {
237    type Result = Self;
238}
239
240#[cfg(feature = "NSImageRep")]
241extern_conformance!(
242    unsafe impl NSObjectProtocol for NSBitmapImageRep {}
243);
244
245#[cfg(feature = "NSImageRep")]
246extern_conformance!(
247    unsafe impl NSSecureCoding for NSBitmapImageRep {}
248);
249
250#[cfg(feature = "NSImageRep")]
251impl NSBitmapImageRep {
252    extern_methods!(
253        #[deprecated = "Use -[NSView cacheDisplayInRect:toBitmapImageRep:] to snapshot a view."]
254        #[unsafe(method(initWithFocusedViewRect:))]
255        #[unsafe(method_family = init)]
256        pub fn initWithFocusedViewRect(
257            this: Allocated<Self>,
258            rect: NSRect,
259        ) -> Option<Retained<Self>>;
260
261        #[cfg(feature = "NSGraphics")]
262        /// # Safety
263        ///
264        /// `planes` must be a valid pointer or null.
265        #[unsafe(method(initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bytesPerRow:bitsPerPixel:))]
266        #[unsafe(method_family = init)]
267        pub unsafe fn initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bytesPerRow_bitsPerPixel(
268            this: Allocated<Self>,
269            planes: *mut *mut c_uchar,
270            width: NSInteger,
271            height: NSInteger,
272            bps: NSInteger,
273            spp: NSInteger,
274            alpha: bool,
275            is_planar: bool,
276            color_space_name: &NSColorSpaceName,
277            r_bytes: NSInteger,
278            p_bits: NSInteger,
279        ) -> Option<Retained<Self>>;
280
281        #[cfg(feature = "NSGraphics")]
282        /// # Safety
283        ///
284        /// `planes` must be a valid pointer or null.
285        #[unsafe(method(initWithBitmapDataPlanes:pixelsWide:pixelsHigh:bitsPerSample:samplesPerPixel:hasAlpha:isPlanar:colorSpaceName:bitmapFormat:bytesPerRow:bitsPerPixel:))]
286        #[unsafe(method_family = init)]
287        pub unsafe fn initWithBitmapDataPlanes_pixelsWide_pixelsHigh_bitsPerSample_samplesPerPixel_hasAlpha_isPlanar_colorSpaceName_bitmapFormat_bytesPerRow_bitsPerPixel(
288            this: Allocated<Self>,
289            planes: *mut *mut c_uchar,
290            width: NSInteger,
291            height: NSInteger,
292            bps: NSInteger,
293            spp: NSInteger,
294            alpha: bool,
295            is_planar: bool,
296            color_space_name: &NSColorSpaceName,
297            bitmap_format: NSBitmapFormat,
298            r_bytes: NSInteger,
299            p_bits: NSInteger,
300        ) -> Option<Retained<Self>>;
301
302        #[cfg(feature = "objc2-core-graphics")]
303        #[cfg(target_vendor = "apple")]
304        #[unsafe(method(initWithCGImage:))]
305        #[unsafe(method_family = init)]
306        pub fn initWithCGImage(this: Allocated<Self>, cg_image: &CGImage) -> Retained<Self>;
307
308        #[cfg(feature = "objc2-core-image")]
309        #[cfg(target_vendor = "apple")]
310        #[unsafe(method(initWithCIImage:))]
311        #[unsafe(method_family = init)]
312        pub fn initWithCIImage(this: Allocated<Self>, ci_image: &CIImage) -> Retained<Self>;
313
314        #[unsafe(method(imageRepsWithData:))]
315        #[unsafe(method_family = none)]
316        pub fn imageRepsWithData(data: &NSData) -> Retained<NSArray<NSImageRep>>;
317
318        #[unsafe(method(imageRepWithData:))]
319        #[unsafe(method_family = none)]
320        pub fn imageRepWithData(data: &NSData) -> Option<Retained<Self>>;
321
322        #[unsafe(method(initWithData:))]
323        #[unsafe(method_family = init)]
324        pub fn initWithData(this: Allocated<Self>, data: &NSData) -> Option<Retained<Self>>;
325
326        #[unsafe(method(bitmapData))]
327        #[unsafe(method_family = none)]
328        pub fn bitmapData(&self) -> *mut c_uchar;
329
330        /// # Safety
331        ///
332        /// `data` must be a valid pointer.
333        #[unsafe(method(getBitmapDataPlanes:))]
334        #[unsafe(method_family = none)]
335        pub unsafe fn getBitmapDataPlanes(&self, data: NonNull<*mut c_uchar>);
336
337        #[unsafe(method(isPlanar))]
338        #[unsafe(method_family = none)]
339        pub fn isPlanar(&self) -> bool;
340
341        #[unsafe(method(samplesPerPixel))]
342        #[unsafe(method_family = none)]
343        pub fn samplesPerPixel(&self) -> NSInteger;
344
345        #[unsafe(method(bitsPerPixel))]
346        #[unsafe(method_family = none)]
347        pub fn bitsPerPixel(&self) -> NSInteger;
348
349        #[unsafe(method(bytesPerRow))]
350        #[unsafe(method_family = none)]
351        pub fn bytesPerRow(&self) -> NSInteger;
352
353        #[unsafe(method(bytesPerPlane))]
354        #[unsafe(method_family = none)]
355        pub fn bytesPerPlane(&self) -> NSInteger;
356
357        #[unsafe(method(numberOfPlanes))]
358        #[unsafe(method_family = none)]
359        pub fn numberOfPlanes(&self) -> NSInteger;
360
361        #[unsafe(method(bitmapFormat))]
362        #[unsafe(method_family = none)]
363        pub fn bitmapFormat(&self) -> NSBitmapFormat;
364
365        /// # Safety
366        ///
367        /// - `compression` must be a valid pointer or null.
368        /// - `factor` must be a valid pointer or null.
369        #[unsafe(method(getCompression:factor:))]
370        #[unsafe(method_family = none)]
371        pub unsafe fn getCompression_factor(
372            &self,
373            compression: *mut NSTIFFCompression,
374            factor: *mut c_float,
375        );
376
377        #[unsafe(method(setCompression:factor:))]
378        #[unsafe(method_family = none)]
379        pub fn setCompression_factor(&self, compression: NSTIFFCompression, factor: c_float);
380
381        #[unsafe(method(TIFFRepresentation))]
382        #[unsafe(method_family = none)]
383        pub fn TIFFRepresentation(&self) -> Option<Retained<NSData>>;
384
385        #[unsafe(method(TIFFRepresentationUsingCompression:factor:))]
386        #[unsafe(method_family = none)]
387        pub fn TIFFRepresentationUsingCompression_factor(
388            &self,
389            comp: NSTIFFCompression,
390            factor: c_float,
391        ) -> Option<Retained<NSData>>;
392
393        #[unsafe(method(TIFFRepresentationOfImageRepsInArray:))]
394        #[unsafe(method_family = none)]
395        pub fn TIFFRepresentationOfImageRepsInArray(
396            array: &NSArray<NSImageRep>,
397        ) -> Option<Retained<NSData>>;
398
399        #[unsafe(method(TIFFRepresentationOfImageRepsInArray:usingCompression:factor:))]
400        #[unsafe(method_family = none)]
401        pub fn TIFFRepresentationOfImageRepsInArray_usingCompression_factor(
402            array: &NSArray<NSImageRep>,
403            comp: NSTIFFCompression,
404            factor: c_float,
405        ) -> Option<Retained<NSData>>;
406
407        /// # Safety
408        ///
409        /// - `list` must be a valid pointer.
410        /// - `num_types` must be a valid pointer.
411        #[unsafe(method(getTIFFCompressionTypes:count:))]
412        #[unsafe(method_family = none)]
413        pub unsafe fn getTIFFCompressionTypes_count(
414            list: NonNull<*const NSTIFFCompression>,
415            num_types: NonNull<NSInteger>,
416        );
417
418        #[unsafe(method(localizedNameForTIFFCompressionType:))]
419        #[unsafe(method_family = none)]
420        pub fn localizedNameForTIFFCompressionType(
421            compression: NSTIFFCompression,
422        ) -> Option<Retained<NSString>>;
423
424        #[unsafe(method(canBeCompressedUsing:))]
425        #[unsafe(method_family = none)]
426        pub fn canBeCompressedUsing(&self, compression: NSTIFFCompression) -> bool;
427
428        #[cfg(all(feature = "NSColor", feature = "objc2-core-foundation"))]
429        #[unsafe(method(colorizeByMappingGray:toColor:blackMapping:whiteMapping:))]
430        #[unsafe(method_family = none)]
431        pub fn colorizeByMappingGray_toColor_blackMapping_whiteMapping(
432            &self,
433            mid_point: CGFloat,
434            mid_point_color: Option<&NSColor>,
435            shadow_color: Option<&NSColor>,
436            light_color: Option<&NSColor>,
437        );
438
439        #[unsafe(method(initForIncrementalLoad))]
440        #[unsafe(method_family = init)]
441        pub fn initForIncrementalLoad(this: Allocated<Self>) -> Retained<Self>;
442
443        #[unsafe(method(incrementalLoadFromData:complete:))]
444        #[unsafe(method_family = none)]
445        pub fn incrementalLoadFromData_complete(&self, data: &NSData, complete: bool) -> NSInteger;
446
447        #[cfg(feature = "NSColor")]
448        #[unsafe(method(setColor:atX:y:))]
449        #[unsafe(method_family = none)]
450        pub fn setColor_atX_y(&self, color: &NSColor, x: NSInteger, y: NSInteger);
451
452        #[cfg(feature = "NSColor")]
453        #[unsafe(method(colorAtX:y:))]
454        #[unsafe(method_family = none)]
455        pub fn colorAtX_y(&self, x: NSInteger, y: NSInteger) -> Option<Retained<NSColor>>;
456
457        /// # Safety
458        ///
459        /// `p` must be a valid pointer.
460        #[unsafe(method(getPixel:atX:y:))]
461        #[unsafe(method_family = none)]
462        pub unsafe fn getPixel_atX_y(&self, p: NonNull<NSUInteger>, x: NSInteger, y: NSInteger);
463
464        /// # Safety
465        ///
466        /// `p` must be a valid pointer.
467        #[unsafe(method(setPixel:atX:y:))]
468        #[unsafe(method_family = none)]
469        pub unsafe fn setPixel_atX_y(&self, p: NonNull<NSUInteger>, x: NSInteger, y: NSInteger);
470
471        #[cfg(feature = "objc2-core-graphics")]
472        #[cfg(target_vendor = "apple")]
473        #[unsafe(method(CGImage))]
474        #[unsafe(method_family = none)]
475        pub fn CGImage(&self) -> Option<Retained<CGImage>>;
476
477        #[cfg(feature = "NSColorSpace")]
478        #[unsafe(method(colorSpace))]
479        #[unsafe(method_family = none)]
480        pub fn colorSpace(&self) -> Retained<NSColorSpace>;
481
482        #[cfg(all(feature = "NSColorSpace", feature = "NSGraphics"))]
483        #[unsafe(method(bitmapImageRepByConvertingToColorSpace:renderingIntent:))]
484        #[unsafe(method_family = none)]
485        pub fn bitmapImageRepByConvertingToColorSpace_renderingIntent(
486            &self,
487            target_space: &NSColorSpace,
488            rendering_intent: NSColorRenderingIntent,
489        ) -> Option<Retained<NSBitmapImageRep>>;
490
491        #[cfg(feature = "NSColorSpace")]
492        #[unsafe(method(bitmapImageRepByRetaggingWithColorSpace:))]
493        #[unsafe(method_family = none)]
494        pub fn bitmapImageRepByRetaggingWithColorSpace(
495            &self,
496            new_space: &NSColorSpace,
497        ) -> Option<Retained<NSBitmapImageRep>>;
498    );
499}
500
501/// Methods declared on superclass `NSImageRep`.
502#[cfg(feature = "NSImageRep")]
503impl NSBitmapImageRep {
504    extern_methods!(
505        #[unsafe(method(init))]
506        #[unsafe(method_family = init)]
507        pub fn init(this: Allocated<Self>) -> Retained<Self>;
508
509        /// # Safety
510        ///
511        /// `coder` possibly has further requirements.
512        #[unsafe(method(initWithCoder:))]
513        #[unsafe(method_family = init)]
514        pub unsafe fn initWithCoder(
515            this: Allocated<Self>,
516            coder: &NSCoder,
517        ) -> Option<Retained<Self>>;
518    );
519}
520
521/// Methods declared on superclass `NSObject`.
522#[cfg(feature = "NSImageRep")]
523impl NSBitmapImageRep {
524    extern_methods!(
525        #[unsafe(method(new))]
526        #[unsafe(method_family = new)]
527        pub fn new() -> Retained<Self>;
528    );
529}
530
531#[cfg(feature = "NSImageRep")]
532impl DefaultRetained for NSBitmapImageRep {
533    #[inline]
534    fn default_retained() -> Retained<Self> {
535        Self::new()
536    }
537}
538
539/// NSBitmapImageFileTypeExtensions.
540#[cfg(feature = "NSImageRep")]
541impl NSBitmapImageRep {
542    extern_methods!(
543        /// # Safety
544        ///
545        /// `properties` generic should be of the correct type.
546        #[unsafe(method(representationOfImageRepsInArray:usingType:properties:))]
547        #[unsafe(method_family = none)]
548        pub unsafe fn representationOfImageRepsInArray_usingType_properties(
549            image_reps: &NSArray<NSImageRep>,
550            storage_type: NSBitmapImageFileType,
551            properties: &NSDictionary<NSBitmapImageRepPropertyKey, AnyObject>,
552        ) -> Option<Retained<NSData>>;
553
554        /// # Safety
555        ///
556        /// `properties` generic should be of the correct type.
557        #[unsafe(method(representationUsingType:properties:))]
558        #[unsafe(method_family = none)]
559        pub unsafe fn representationUsingType_properties(
560            &self,
561            storage_type: NSBitmapImageFileType,
562            properties: &NSDictionary<NSBitmapImageRepPropertyKey, AnyObject>,
563        ) -> Option<Retained<NSData>>;
564
565        /// # Safety
566        ///
567        /// `value` should be of the correct type.
568        #[unsafe(method(setProperty:withValue:))]
569        #[unsafe(method_family = none)]
570        pub unsafe fn setProperty_withValue(
571            &self,
572            property: &NSBitmapImageRepPropertyKey,
573            value: Option<&AnyObject>,
574        );
575
576        #[unsafe(method(valueForProperty:))]
577        #[unsafe(method_family = none)]
578        pub fn valueForProperty(
579            &self,
580            property: &NSBitmapImageRepPropertyKey,
581        ) -> Option<Retained<AnyObject>>;
582    );
583}
584
585/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nstifffiletype?language=objc)
586#[deprecated]
587pub static NSTIFFFileType: NSBitmapImageFileType =
588    NSBitmapImageFileType(NSBitmapImageFileType::TIFF.0);
589
590/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsbmpfiletype?language=objc)
591#[deprecated]
592pub static NSBMPFileType: NSBitmapImageFileType =
593    NSBitmapImageFileType(NSBitmapImageFileType::BMP.0);
594
595/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsgiffiletype?language=objc)
596#[deprecated]
597pub static NSGIFFileType: NSBitmapImageFileType =
598    NSBitmapImageFileType(NSBitmapImageFileType::GIF.0);
599
600/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsjpegfiletype?language=objc)
601#[deprecated]
602pub static NSJPEGFileType: NSBitmapImageFileType =
603    NSBitmapImageFileType(NSBitmapImageFileType::JPEG.0);
604
605/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nspngfiletype?language=objc)
606#[deprecated]
607pub static NSPNGFileType: NSBitmapImageFileType =
608    NSBitmapImageFileType(NSBitmapImageFileType::PNG.0);
609
610/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsjpeg2000filetype?language=objc)
611#[deprecated]
612pub static NSJPEG2000FileType: NSBitmapImageFileType =
613    NSBitmapImageFileType(NSBitmapImageFileType::JPEG2000.0);
614
615/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsalphafirstbitmapformat?language=objc)
616#[deprecated]
617pub static NSAlphaFirstBitmapFormat: NSBitmapFormat = NSBitmapFormat(NSBitmapFormat::AlphaFirst.0);
618
619/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsalphanonpremultipliedbitmapformat?language=objc)
620#[deprecated]
621pub static NSAlphaNonpremultipliedBitmapFormat: NSBitmapFormat =
622    NSBitmapFormat(NSBitmapFormat::AlphaNonpremultiplied.0);
623
624/// [Apple's documentation](https://developer.apple.com/documentation/appkit/nsfloatingpointsamplesbitmapformat?language=objc)
625#[deprecated]
626pub static NSFloatingPointSamplesBitmapFormat: NSBitmapFormat =
627    NSBitmapFormat(NSBitmapFormat::FloatingPointSamples.0);
628
629/// [Apple's documentation](https://developer.apple.com/documentation/appkit/ns16bitlittleendianbitmapformat?language=objc)
630#[deprecated]
631pub static NS16BitLittleEndianBitmapFormat: NSBitmapFormat =
632    NSBitmapFormat(NSBitmapFormat::SixteenBitLittleEndian.0);
633
634/// [Apple's documentation](https://developer.apple.com/documentation/appkit/ns32bitlittleendianbitmapformat?language=objc)
635#[deprecated]
636pub static NS32BitLittleEndianBitmapFormat: NSBitmapFormat =
637    NSBitmapFormat(NSBitmapFormat::ThirtyTwoBitLittleEndian.0);
638
639/// [Apple's documentation](https://developer.apple.com/documentation/appkit/ns16bitbigendianbitmapformat?language=objc)
640#[deprecated]
641pub static NS16BitBigEndianBitmapFormat: NSBitmapFormat =
642    NSBitmapFormat(NSBitmapFormat::SixteenBitBigEndian.0);
643
644/// [Apple's documentation](https://developer.apple.com/documentation/appkit/ns32bitbigendianbitmapformat?language=objc)
645#[deprecated]
646pub static NS32BitBigEndianBitmapFormat: NSBitmapFormat =
647    NSBitmapFormat(NSBitmapFormat::ThirtyTwoBitBigEndian.0);