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

Method ConvertRow

Source/HLEGraphics/ConvertImage.cpp:377–409  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

375
376 template< typename OutT, u32 F >
377 static inline void ConvertRow( OutT * dst, const u8 * src, u32 src_offset, u32 width )
378 {
379 // Do two pixels at a time
380 for ( u32 x {}; x+1 < width; x+=2 )
381 {
382 u8 b {src[src_offset ^ F]};
383
384 // Even
385 dst[x + 0] = OutT( FourToEight[(b & 0xF0)>>4],
386 FourToEight[(b & 0xF0)>>4],
387 FourToEight[(b & 0xF0)>>4],
388 FourToEight[(b & 0xF0)>>4] );
389 // Odd
390 dst[x + 1] = OutT( FourToEight[(b & 0x0F)],
391 FourToEight[(b & 0x0F)],
392 FourToEight[(b & 0x0F)],
393 FourToEight[(b & 0x0F)] );
394
395 src_offset++;
396 }
397
398 if(width & 1)
399 {
400 u8 b {src[src_offset ^ F]};
401
402 // Even
403 dst[width-1] = OutT( FourToEight[(b & 0xF0)>>4],
404 FourToEight[(b & 0xF0)>>4],
405 FourToEight[(b & 0xF0)>>4],
406 FourToEight[(b & 0xF0)>>4] );
407
408 }
409 }
410
411 template < typename OutT >
412 static inline void ConvertTextureT( const TextureDestInfo & dsti, const TextureInfo & ti )

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected