objc2_sprite_kit/generated/
SKMutableTexture.rs1use core::ffi::*;
4use core::ptr::NonNull;
5use objc2::__framework_prelude::*;
6#[cfg(feature = "objc2-app-kit")]
7#[cfg(target_os = "macos")]
8use objc2_app_kit::*;
9#[cfg(feature = "objc2-core-foundation")]
10use objc2_core_foundation::*;
11#[cfg(feature = "objc2-core-graphics")]
12use objc2_core_graphics::*;
13use objc2_foundation::*;
14
15use crate::*;
16
17extern_class!(
18 #[unsafe(super(SKTexture, NSObject))]
20 #[derive(Debug, PartialEq, Eq, Hash)]
21 #[cfg(feature = "SKTexture")]
22 pub struct SKMutableTexture;
23);
24
25#[cfg(feature = "SKTexture")]
26unsafe impl NSCoding for SKMutableTexture {}
27
28#[cfg(feature = "SKTexture")]
29unsafe impl NSCopying for SKMutableTexture {}
30
31#[cfg(feature = "SKTexture")]
32unsafe impl CopyingHelper for SKMutableTexture {
33 type Result = Self;
34}
35
36#[cfg(feature = "SKTexture")]
37unsafe impl NSObjectProtocol for SKMutableTexture {}
38
39#[cfg(feature = "SKTexture")]
40unsafe impl NSSecureCoding for SKMutableTexture {}
41
42#[cfg(feature = "SKTexture")]
43impl SKMutableTexture {
44 extern_methods!(
45 #[cfg(feature = "objc2-core-foundation")]
46 #[unsafe(method(initWithSize:))]
51 #[unsafe(method_family = init)]
52 pub unsafe fn initWithSize(this: Allocated<Self>, size: CGSize) -> Retained<Self>;
53
54 #[cfg(feature = "objc2-core-foundation")]
55 #[unsafe(method(mutableTextureWithSize:))]
56 #[unsafe(method_family = none)]
57 pub unsafe fn mutableTextureWithSize(size: CGSize) -> Retained<Self>;
58
59 #[cfg(feature = "objc2-core-foundation")]
60 #[unsafe(method(initWithSize:pixelFormat:))]
67 #[unsafe(method_family = init)]
68 pub unsafe fn initWithSize_pixelFormat(
69 this: Allocated<Self>,
70 size: CGSize,
71 format: c_int,
72 ) -> Retained<Self>;
73
74 #[cfg(feature = "block2")]
75 #[unsafe(method(modifyPixelDataWithBlock:))]
77 #[unsafe(method_family = none)]
78 pub unsafe fn modifyPixelDataWithBlock(
79 &self,
80 block: &block2::Block<dyn Fn(*mut c_void, usize)>,
81 );
82 );
83}
84
85#[cfg(feature = "SKTexture")]
87impl SKMutableTexture {
88 extern_methods!(
89 #[unsafe(method(textureWithImageNamed:))]
94 #[unsafe(method_family = none)]
95 pub unsafe fn textureWithImageNamed(name: &NSString) -> Retained<Self>;
96
97 #[cfg(feature = "objc2-core-foundation")]
98 #[unsafe(method(textureWithRect:inTexture:))]
105 #[unsafe(method_family = none)]
106 pub unsafe fn textureWithRect_inTexture(
107 rect: CGRect,
108 texture: &SKTexture,
109 ) -> Retained<Self>;
110
111 #[cfg(feature = "objc2-core-foundation")]
112 #[unsafe(method(textureVectorNoiseWithSmoothness:size:))]
120 #[unsafe(method_family = none)]
121 pub unsafe fn textureVectorNoiseWithSmoothness_size(
122 smoothness: CGFloat,
123 size: CGSize,
124 ) -> Retained<Self>;
125
126 #[cfg(feature = "objc2-core-foundation")]
127 #[unsafe(method(textureNoiseWithSmoothness:size:grayscale:))]
136 #[unsafe(method_family = none)]
137 pub unsafe fn textureNoiseWithSmoothness_size_grayscale(
138 smoothness: CGFloat,
139 size: CGSize,
140 grayscale: bool,
141 ) -> Retained<Self>;
142
143 #[cfg(feature = "objc2-core-graphics")]
144 #[unsafe(method(textureWithCGImage:))]
149 #[unsafe(method_family = none)]
150 pub unsafe fn textureWithCGImage(image: &CGImage) -> Retained<Self>;
151
152 #[cfg(feature = "objc2-app-kit")]
153 #[cfg(target_os = "macos")]
154 #[unsafe(method(textureWithImage:))]
155 #[unsafe(method_family = none)]
156 pub unsafe fn textureWithImage(image: &NSImage) -> Retained<Self>;
157
158 #[cfg(feature = "objc2-core-foundation")]
159 #[unsafe(method(textureWithData:size:))]
166 #[unsafe(method_family = none)]
167 pub unsafe fn textureWithData_size(pixel_data: &NSData, size: CGSize) -> Retained<Self>;
168
169 #[cfg(feature = "objc2-core-foundation")]
170 #[unsafe(method(textureWithData:size:flipped:))]
171 #[unsafe(method_family = none)]
172 pub unsafe fn textureWithData_size_flipped(
173 pixel_data: &NSData,
174 size: CGSize,
175 flipped: bool,
176 ) -> Retained<Self>;
177
178 #[cfg(feature = "objc2-core-foundation")]
179 #[unsafe(method(textureWithData:size:rowLength:alignment:))]
190 #[unsafe(method_family = none)]
191 pub unsafe fn textureWithData_size_rowLength_alignment(
192 pixel_data: &NSData,
193 size: CGSize,
194 row_length: c_uint,
195 alignment: c_uint,
196 ) -> Retained<Self>;
197 );
198}
199
200#[cfg(feature = "SKTexture")]
202impl SKMutableTexture {
203 extern_methods!(
204 #[unsafe(method(init))]
205 #[unsafe(method_family = init)]
206 pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
207
208 #[unsafe(method(new))]
209 #[unsafe(method_family = new)]
210 pub unsafe fn new() -> Retained<Self>;
211 );
212}