Optimized some format conversions
Thanks to kristofjé Former-commit-id: f7c0e5da41b7b7b4c967d7ae812b6da517761823
This commit is contained in:
parent
7ddff94a30
commit
5464b3e184
|
|
@ -16,7 +16,7 @@ namespace
|
|||
|
||||
inline nzUInt8 c4to8(nzUInt8 c)
|
||||
{
|
||||
return c * (255/15);
|
||||
return c >> 4;
|
||||
}
|
||||
|
||||
inline nzUInt8 c5to4(nzUInt8 c)
|
||||
|
|
@ -31,7 +31,7 @@ namespace
|
|||
|
||||
inline nzUInt8 c8to4(nzUInt8 c)
|
||||
{
|
||||
return c * (15.f/255.f);
|
||||
return c << 4;
|
||||
}
|
||||
|
||||
inline nzUInt8 c8to5(nzUInt8 c)
|
||||
|
|
|
|||
Loading…
Reference in New Issue