Changeset 551 for trunk/src/image/png_writer.cc
- Timestamp:
- 03/14/17 16:44:18 (8 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/image/png_writer.cc
r534 r551 12 12 #include <stdarg.h> 13 13 14 using namespace nv;14 //using namespace nv; 15 15 16 16 #if NV_COMPILER == NV_CLANG … … 33 33 }; 34 34 35 #define STBI_MALLOC(sz) nv malloc(sz)36 #define STBI_REALLOC(p,sz) nv realloc(p,sz)37 #define STBI_FREE(p) nv free(p)38 #define STBI_MEMMOVE(d,s,c) nv memmove(d,s,c)35 #define STBI_MALLOC(sz) nv::nvmalloc(sz) 36 #define STBI_REALLOC(p,sz) nv::nvrealloc(p,sz) 37 #define STBI_FREE(p) nv::nvfree(p) 38 #define STBI_MEMMOVE(d,s,c) nv::nvmemmove(d,s,c) 39 39 40 40 typedef void stbi_write_func( void *context, void *data, int size ); … … 57 57 58 58 template < typename T > 59 inline uchar8 byte_cast( T x )60 { 61 return uchar8( ( x ) & 255 );59 inline nv::uchar8 byte_cast( T x ) 60 { 61 return nv::uchar8( ( x ) & 255 ); 62 62 } 63 63 … … 246 246 } 247 247 248 static int iabs( int i ) 249 { 250 return i >= 0 ? i : -i; 251 } 252 248 253 static unsigned char stbiw__paeth( int a, int b, int c ) 249 254 { 250 int p = a + b - c, pa = abs( p - a ), pb = abs( p - b ), pc =abs( p - c );255 int p = a + b - c, pa = iabs( p - a ), pb = iabs( p - b ), pc = iabs( p - c ); 251 256 if ( pa <= pb && pa <= pc ) return byte_cast( a ); 252 257 if ( pb <= pc ) return byte_cast( b ); … … 320 325 if ( p ) break; 321 326 for ( i = 0; i < x*n; ++i ) 322 est += abs( (signed char)line_buffer[i] );327 est += iabs( (signed char)line_buffer[i] ); 323 328 if ( est < bestval ) { bestval = est; best = k; } 324 329 }
Note: See TracChangeset
for help on using the changeset viewer.