@@ -224,7 +224,7 @@ impl SamplerRepeatPot {
224224 /// Creates a new `SamplerRepeatPot` based on the dimensions of `tex`.
225225 /// # Panics
226226 /// If the width or height of `tex` is not a power of two.
227- pub fn new < C > ( tex : & Texture < impl AsSlice2 < C > > ) -> Self {
227+ pub fn new ( tex : & Texture < impl AsSlice2 > ) -> Self {
228228 let w = tex. width ( ) as u32 ;
229229 let h = tex. height ( ) as u32 ;
230230 assert ! ( w. is_power_of_two( ) , "width must be 2^n, was {w}" ) ;
@@ -237,11 +237,11 @@ impl SamplerRepeatPot {
237237 ///
238238 /// Uses nearest neighbor sampling.
239239 #[ inline]
240- pub fn sample < C : Copy > (
240+ pub fn sample < D : AsSlice2 < Elem : Copy > > (
241241 & self ,
242- tex : & Texture < impl AsSlice2 < C > > ,
242+ tex : & Texture < D > ,
243243 tc : TexCoord ,
244- ) -> C {
244+ ) -> D :: Elem {
245245 let scaled_uv = uv ( tex. width ( ) * tc. u ( ) , tex. height ( ) * tc. v ( ) ) ;
246246 self . sample_abs ( tex, scaled_uv)
247247 }
@@ -252,11 +252,11 @@ impl SamplerRepeatPot {
252252 ///
253253 /// Uses nearest neighbor sampling.
254254 #[ inline]
255- pub fn sample_abs < C : Copy > (
255+ pub fn sample_abs < D : AsSlice2 < Elem : Copy > > (
256256 & self ,
257- tex : & Texture < impl AsSlice2 < C > > ,
257+ tex : & Texture < D > ,
258258 tc : TexCoord ,
259- ) -> C {
259+ ) -> D :: Elem {
260260 use crate :: math:: float:: f32;
261261 // Convert first to signed int to avoid clamping to zero
262262 let u = f32:: floor ( tc. u ( ) ) as i32 as u32 & self . w_mask ;
@@ -277,11 +277,11 @@ impl SamplerClamp {
277277 ///
278278 /// Uses nearest neighbor sampling.
279279 #[ inline]
280- pub fn sample < C : Copy > (
280+ pub fn sample < D : AsSlice2 < Elem : Copy > > (
281281 & self ,
282- tex : & Texture < impl AsSlice2 < C > > ,
282+ tex : & Texture < D > ,
283283 tc : TexCoord ,
284- ) -> C {
284+ ) -> D :: Elem {
285285 self . sample_abs ( tex, uv ( tc. u ( ) * tex. w , tc. v ( ) * tex. h ) )
286286 }
287287
@@ -291,11 +291,11 @@ impl SamplerClamp {
291291 ///
292292 /// Uses nearest neighbor sampling.
293293 #[ inline]
294- pub fn sample_abs < C : Copy > (
294+ pub fn sample_abs < D : AsSlice2 < Elem : Copy > > (
295295 & self ,
296- tex : & Texture < impl AsSlice2 < C > > ,
296+ tex : & Texture < D > ,
297297 tc : TexCoord ,
298- ) -> C {
298+ ) -> D :: Elem {
299299 use crate :: math:: float:: f32;
300300 let u = f32:: floor ( tc. u ( ) . clamp ( 0.0 , tex. w - 1.0 ) ) as u32 ;
301301 let v = f32:: floor ( tc. v ( ) . clamp ( 0.0 , tex. h - 1.0 ) ) as u32 ;
@@ -322,11 +322,11 @@ impl SamplerOnce {
322322 /// # Panics
323323 /// May panic if `tc` is not in the valid range.
324324 #[ inline]
325- pub fn sample < C : Copy > (
325+ pub fn sample < D : AsSlice2 < Elem : Copy > > (
326326 & self ,
327- tex : & Texture < impl AsSlice2 < C > > ,
327+ tex : & Texture < D > ,
328328 tc : TexCoord ,
329- ) -> C {
329+ ) -> D :: Elem {
330330 let scaled_uv = uv ( tex. width ( ) * tc. u ( ) , tex. height ( ) * tc. v ( ) ) ;
331331 self . sample_abs ( tex, scaled_uv)
332332 }
@@ -340,11 +340,11 @@ impl SamplerOnce {
340340 /// # Panics
341341 /// May panic if `tc` is not in the valid range.
342342 #[ inline]
343- pub fn sample_abs < C : Copy > (
343+ pub fn sample_abs < D : AsSlice2 < Elem : Copy > > (
344344 & self ,
345- tex : & Texture < impl AsSlice2 < C > > ,
345+ tex : & Texture < D > ,
346346 tc : TexCoord ,
347- ) -> C {
347+ ) -> D :: Elem {
348348 let u = tc. u ( ) as u32 ;
349349 let v = tc. v ( ) as u32 ;
350350
0 commit comments