MCPcopy Create free account
hub / github.com/DaedalusX64/daedalus / MirrorTexelsST

Function MirrorTexelsST

Source/Graphics/TextureTransform.cpp:273–310  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271// Assumes width p_dst = 2*width p_src and height p_dst = 2*height p_src
272template< typename T, bool MirrorS, bool MirrorT >
273static void MirrorTexelsST( void * dst, u32 dst_stride, const void * src, u32 src_stride, u32 width, u32 height )
274{
275 T * p_dst = reinterpret_cast< T * >( dst );
276 const T * p_src = reinterpret_cast< const T * >( src );
277
278 for( u32 y {}; y < height; ++y )
279 {
280 // Copy regular pixels
281 CopyRow< T >( p_dst, p_src, width );
282
283 if( MirrorS )
284 {
285 CopyRowReverse< T >( p_dst, p_src, width );
286 }
287
288 p_dst = AddByteOffset< T >( p_dst, dst_stride );
289 p_src = AddByteOffset< T >( p_src, src_stride );
290 }
291
292 if( MirrorT )
293 {
294 // Copy remaining rows in reverse order
295 for( u32 y {}; y < height; ++y )
296 {
297 p_src = AddByteOffset( p_src, -s32(src_stride) );
298
299 // Copy regular pixels
300 CopyRow< T >( p_dst, p_src, width );
301
302 if( MirrorS )
303 {
304 CopyRowReverse< T >( p_dst, p_src, width );
305 }
306
307 p_dst = AddByteOffset< T >( p_dst, dst_stride );
308 }
309 }
310}
311
312template< bool MirrorS, bool MirrorT >
313static void MirrorTexels( void * dst, u32 dst_stride, const void * src, u32 src_stride, ETextureFormat tex_fmt, u32 width, u32 height )

Callers

nothing calls this directly

Calls 1

AddByteOffsetFunction · 0.85

Tested by

no test coverage detected