debian/0000755000000000000000000000000012212470454007167 5ustar debian/libnvtt-bin.install0000644000000000000000000000001212212470454013000 0ustar usr/bin/* debian/libnvtt-dev.install0000644000000000000000000000003512212470454013013 0ustar usr/include/* usr/lib/*/*.so debian/docs0000644000000000000000000000004012212470454010034 0ustar NVIDIA_Texture_Tools_README.txt debian/libnvtt-bin.manpages0000644000000000000000000000025212212470454013133 0ustar debian/manpages/nvassemble.1 debian/manpages/nvcompress.1 debian/manpages/nvddsinfo.1 debian/manpages/nvdecompress.1 debian/manpages/nvimgdiff.1 debian/manpages/nvzoom.1 debian/rules0000755000000000000000000000104212212470454010244 0ustar #!/usr/bin/make -f DEB_DEBIAN_DIR=$(dir $(firstword $(MAKEFILE_LIST))) DPKG_EXPORT_BUILDFLAGS = 1 include /usr/share/dpkg/buildflags.mk CFLAGS+=$(CPPFLAGS) CXXFLAGS+=$(CPPFLAGS) %: dh $@ override_dh_auto_configure: cmake -DNVTT_SHARED=1 -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=/usr -DLIB_DIR_PATH=lib/`dpkg-architecture -qDEB_HOST_MULTIARCH` override_dh_installdocs: dh_installdocs --link-doc=libnvtt2 get-orig-source: uscan --noconf --force-download --rename --repack --download-current-version --destdir=$(DEB_DEBIAN_DIR)/.. debian/patches/0000755000000000000000000000000012212470454010616 5ustar debian/patches/01-library-versioning.patch0000644000000000000000000000536412212470454015712 0ustar Title: Library Versioning DEP: 3 Last-Update: 2012-01-07 Author: Lennart Weller Forwarded: http://code.google.com/p/nvidia-texture-tools/issues/detail?id=170&thanks=170&ts=1326227583 Abstract: Added library versioning to match debian standards. Patch is submitted upstream. diff --git a/CMakeLists.txt b/CMakeLists.txt index 51f1253..68b4fe4 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -22,7 +22,7 @@ IF(NVTT_SHARED) SET(NVIMAGE_SHARED TRUE) ENDIF(NVTT_SHARED) - +INCLUDE(${NV_CMAKE_DIR}/Libraries.cmake) ADD_SUBDIRECTORY(src) IF(WIN32) diff --git a/cmake/Libraries.cmake b/cmake/Libraries.cmake new file mode 100644 index 0000000..d03b19d --- /dev/null +++ b/cmake/Libraries.cmake @@ -0,0 +1,8 @@ +file(READ "VERSION" VERSION) + +string(REGEX REPLACE "([0-9]).*" "\\1" MAJOR ${VERSION}) +string(REGEX REPLACE "[0-9].([0-9]).*" "\\1"MINOR ${VERSION}) +string(REGEX REPLACE ".*([0-9])\n$" "\\1" MAINTENANCE ${VERSION}) + +set(GENERIC_LIB_VERSION "${MAJOR}.${MINOR}.${MAINTENANCE}") +set(GENERIC_LIB_SOVERSION ${MAJOR}) diff --git a/src/nvcore/CMakeLists.txt b/src/nvcore/CMakeLists.txt index 385e201..50ace0f 100644 --- a/src/nvcore/CMakeLists.txt +++ b/src/nvcore/CMakeLists.txt @@ -40,6 +40,9 @@ ELSE(NVCORE_SHARED) ENDIF(NVCORE_SHARED) TARGET_LINK_LIBRARIES(nvcore ${LIBS}) +SET_TARGET_PROPERTIES(nvcore PROPERTIES + VERSION ${GENERIC_LIB_VERSION} + SOVERSION ${GENERIC_LIB_SOVERSION}) INSTALL(TARGETS nvcore RUNTIME DESTINATION bin diff --git a/src/nvimage/CMakeLists.txt b/src/nvimage/CMakeLists.txt index 7b2f197..bfcb576 100644 --- a/src/nvimage/CMakeLists.txt +++ b/src/nvimage/CMakeLists.txt @@ -60,6 +60,9 @@ ELSE(NVIMAGE_SHARED) ENDIF(NVIMAGE_SHARED) TARGET_LINK_LIBRARIES(nvimage ${LIBS} nvcore nvmath posh) +SET_TARGET_PROPERTIES(nvimage PROPERTIES + VERSION ${GENERIC_LIB_VERSION} + SOVERSION ${GENERIC_LIB_SOVERSION}) INSTALL(TARGETS nvimage RUNTIME DESTINATION bin diff --git a/src/nvmath/CMakeLists.txt b/src/nvmath/CMakeLists.txt index 96aec78..5e42733 100644 --- a/src/nvmath/CMakeLists.txt +++ b/src/nvmath/CMakeLists.txt @@ -26,6 +26,9 @@ ELSE(NVMATH_SHARED) ENDIF(NVMATH_SHARED) TARGET_LINK_LIBRARIES(nvmath ${LIBS} nvcore) +SET_TARGET_PROPERTIES(nvmath PROPERTIES + VERSION ${GENERIC_LIB_VERSION} + SOVERSION ${GENERIC_LIB_SOVERSION}) INSTALL(TARGETS nvmath RUNTIME DESTINATION bin diff --git a/src/nvtt/CMakeLists.txt b/src/nvtt/CMakeLists.txt index 9ce93d0..1be4200 100644 --- a/src/nvtt/CMakeLists.txt +++ b/src/nvtt/CMakeLists.txt @@ -51,6 +51,9 @@ ELSE(NVTT_SHARED) ENDIF(NVTT_SHARED) TARGET_LINK_LIBRARIES(nvtt ${LIBS} nvcore nvmath nvimage squish) +SET_TARGET_PROPERTIES(nvtt PROPERTIES + VERSION ${GENERIC_LIB_VERSION} + SOVERSION ${GENERIC_LIB_SOVERSION}) INSTALL(TARGETS nvtt RUNTIME DESTINATION bin debian/patches/09-arm-fix.patch0000644000000000000000000000100512212470454013424 0ustar Title: Fix build on arm DEP: 3 Last-Update: 2013-09-06 From: NVTT SVN r1173 ( https://code.google.com/p/nvidia-texture-tools/source/detail?r=1173 ) --- a/src/nvcore/nvcore.h +++ b/src/nvcore/nvcore.h @@ -67,6 +67,7 @@ // NV_CPU_X86 // NV_CPU_X86_64 // NV_CPU_PPC +// NV_CPU_ARM #define NV_CPU_STRING POSH_CPU_STRING @@ -76,6 +77,8 @@ # define NV_CPU_X86 1 #elif defined POSH_CPU_PPC # define NV_CPU_PPC 1 +#elif defined POSH_CPU_STRONGARM +# define NV_CPU_ARM 1 #else # error "Unsupported CPU" #endif debian/patches/07-fix-valgrind.patch0000644000000000000000000006326512212470454014471 0ustar DEP: 3 Subject: Remove malloc overrides Last-Update: 2012-03-31 Origin: upstream, http://code.google.com/p/nvidia-texture-tools/source/detail?r=1172 Bug: http://code.google.com/p/nvidia-texture-tools/issues/detail?id=138 diff --git a/src/nvcore/Containers.h b/src/nvcore/Containers.h index f0b63d4..3d1d8ee 100644 --- a/src/nvcore/Containers.h +++ b/src/nvcore/Containers.h @@ -16,9 +16,9 @@ Do not use memmove in insert & remove, use copy ctors instead. // nvcore -#include -#include -#include +#include "nvcore.h" +#include "Memory.h" +#include "Debug.h" #include // memmove #include // for placement new @@ -589,15 +589,15 @@ namespace nv // free the buffer. if( m_buffer_size == 0 ) { if( m_buffer ) { - mem::free( m_buffer ); + free( m_buffer ); m_buffer = NULL; } } // realloc the buffer else { - if( m_buffer ) m_buffer = (T *) mem::realloc( m_buffer, sizeof(T) * m_buffer_size ); - else m_buffer = (T *) mem::malloc( sizeof(T) * m_buffer_size ); + if( m_buffer ) m_buffer = (T *) realloc(m_buffer, sizeof(T) * m_buffer_size); + else m_buffer = (T *) ::malloc(sizeof(T) * m_buffer_size); } } @@ -778,7 +778,7 @@ namespace nv e->clear(); } } - mem::free(table); + free(table); table = NULL; entry_count = 0; size_mask = -1; @@ -1001,7 +1001,7 @@ namespace nv new_size = nextPowerOfTwo(new_size); HashMap new_hash; - new_hash.table = (Entry *) mem::malloc(sizeof(Entry) * new_size); + new_hash.table = (Entry *) ::malloc(sizeof(Entry) * new_size); nvDebugCheck(new_hash.table != NULL); new_hash.entry_count = 0; @@ -1026,7 +1026,7 @@ namespace nv } // Delete our old data buffer. - mem::free(table); + free(table); } // Steal new_hash's data. diff --git a/src/nvcore/Memory.cpp b/src/nvcore/Memory.cpp index 7ece018..d470580 100644 --- a/src/nvcore/Memory.cpp +++ b/src/nvcore/Memory.cpp @@ -1,36 +1,118 @@ +// This code is in the public domain -- Ignacio Castaño #include "Memory.h" #include "Debug.h" -//#if HAVE_MALLOC_H -//#include -//#endif - #include +#define USE_EFENCE 0 + +#if USE_EFENCE +extern "C" void *EF_malloc(size_t size); +extern "C" void *EF_realloc(void * oldBuffer, size_t newSize); +extern "C" void EF_free(void * address); +#endif using namespace nv; -void * nv::mem::malloc(size_t size) +#if NV_OVERRIDE_ALLOC + +void * malloc(size_t size) +{ +#if USE_EFENCE + return EF_malloc(size); +#else + return ::malloc(size); +#endif +} + +void * debug_malloc(size_t size, const char * file, int line) +{ + NV_UNUSED(file); + NV_UNUSED(line); +#if USE_EFENCE + return EF_malloc(size); +#else + return ::malloc(size); +#endif +} + +void free(void * ptr) { - return ::malloc(size); +#if USE_EFENCE + return EF_free(const_cast(ptr)); +#else + ::free(const_cast(ptr)); +#endif } -void * nv::mem::malloc(size_t size, const char * file, int line) +void * realloc(void * ptr, size_t size) { - NV_UNUSED(file); - NV_UNUSED(line); - return ::malloc(size); + nvDebugCheck(ptr != NULL || size != 0); // undefined realloc behavior. +#if USE_EFENCE + return EF_realloc(ptr, size); +#else + return ::realloc(ptr, size); +#endif } -void nv::mem::free(const void * ptr) +/* No need to override this unless we want line info. +void * operator new (size_t size) throw() { - ::free(const_cast(ptr)); + return malloc(size); } -void * nv::mem::realloc(void * ptr, size_t size) +void operator delete (void *p) throw() { - nvDebugCheck(ptr != NULL || size != 0); // undefined realloc behavior. - return ::realloc(ptr, size); + free(p); } +void * operator new [] (size_t size) throw() +{ + return malloc(size); +} + +void operator delete [] (void * p) throw() +{ + free(p); +} +*/ + +#if 0 // Code from Apple: +void* operator new(std::size_t sz) throw (std::bad_alloc) +{ + void *result = std::malloc (sz == 0 ? 1 : sz); + if (result == NULL) + throw std::bad_alloc(); + gNewCounter++; + return result; +} +void operator delete(void* p) throw() +{ + if (p == NULL) + return; + std::free (p); + gDeleteCounter++; +} + +/* These are the 'nothrow' versions of the above operators. + The system version will try to call a std::new_handler if they + fail, but your overriding versions are not required to do this. */ +void* operator new(std::size_t sz, const std::nothrow_t&) throw() +{ + try { + void * result = ::operator new (sz); // calls our overridden operator new + return result; + } catch (std::bad_alloc &) { + return NULL; + } +} +void operator delete(void* p, const std::nothrow_t&) throw() +{ + ::operator delete (p); +} + +#endif // 0 + + +#endif // NV_OVERRIDE_ALLOC diff --git a/src/nvcore/Memory.h b/src/nvcore/Memory.h index d699926..897388b 100644 --- a/src/nvcore/Memory.h +++ b/src/nvcore/Memory.h @@ -1,186 +1,52 @@ -// This code is in the public domain -- castanyo@yahoo.es +// This code is in the public domain -- Ignacio Castaño +#pragma once #ifndef NV_CORE_MEMORY_H #define NV_CORE_MEMORY_H -#include +#include "nvcore.h" #include // malloc(), realloc() and free() -#include // size_t +#include // size_t #include // new and delete -// Custom memory allocator -namespace nv -{ - namespace mem - { - NVCORE_API void * malloc(size_t size); - NVCORE_API void * malloc(size_t size, const char * file, int line); - - NVCORE_API void free(const void * ptr); - NVCORE_API void * realloc(void * ptr, size_t size); - - } // mem namespace - -} // nv namespace - - -// Override new/delete +#define NV_OVERRIDE_ALLOC 0 -inline void * operator new (size_t size) throw() -{ - return nv::mem::malloc(size); -} - -inline void operator delete (void *p) throw() -{ - nv::mem::free(p); -} +#if NV_OVERRIDE_ALLOC -inline void * operator new [] (size_t size) throw() -{ - return nv::mem::malloc(size); -} - -inline void operator delete [] (void * p) throw() -{ - nv::mem::free(p); +// Custom memory allocator +extern "C" { + NVCORE_API void * malloc(size_t size); + NVCORE_API void * debug_malloc(size_t size, const char * file, int line); + NVCORE_API void free(void * ptr); + NVCORE_API void * realloc(void * ptr, size_t size); } /* #ifdef _DEBUG #define new new(__FILE__, __LINE__) -#define malloc(i) malloc(i, __FILE__, __LINE__) +#define malloc(i) debug_malloc(i, __FILE__, __LINE__) #endif */ -#if 0 -/* - File: main.cpp - - Version: 1.0 - - Abstract: Overrides the C++ 'operator new' and 'operator delete'. - - Disclaimer: IMPORTANT: This Apple software is supplied to you by Apple Computer, Inc. - ("Apple") in consideration of your agreement to the following terms, and your - use, installation, modification or redistribution of this Apple software - constitutes acceptance of these terms. If you do not agree with these terms, - please do not use, install, modify or redistribute this Apple software. - - In consideration of your agreement to abide by the following terms, and subject - to these terms, Apple grants you a personal, non-exclusive license, under Apple’s - copyrights in this original Apple software (the "Apple Software"), to use, - reproduce, modify and redistribute the Apple Software, with or without - modifications, in source and/or binary forms; provided that if you redistribute - the Apple Software in its entirety and without modifications, you must retain - this notice and the following text and disclaimers in all such redistributions of - the Apple Software. Neither the name, trademarks, service marks or logos of - Apple Computer, Inc. may be used to endorse or promote products derived from the - Apple Software without specific prior written permission from Apple. Except as - expressly stated in this notice, no other rights or licenses, express or implied, - are granted by Apple herein, including but not limited to any patent rights that - may be infringed by your derivative works or by other works in which the Apple - Software may be incorporated. - - The Apple Software is provided by Apple on an "AS IS" basis. APPLE MAKES NO - WARRANTIES, EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION THE IMPLIED - WARRANTIES OF NON-INFRINGEMENT, MERCHANTABILITY AND FITNESS FOR A PARTICULAR - PURPOSE, REGARDING THE APPLE SOFTWARE OR ITS USE AND OPERATION ALONE OR IN - COMBINATION WITH YOUR PRODUCTS. - - IN NO EVENT SHALL APPLE BE LIABLE FOR ANY SPECIAL, INDIRECT, INCIDENTAL OR - CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE - GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) - ARISING IN ANY WAY OUT OF THE USE, REPRODUCTION, MODIFICATION AND/OR DISTRIBUTION - OF THE APPLE SOFTWARE, HOWEVER CAUSED AND WHETHER UNDER THEORY OF CONTRACT, TORT - (INCLUDING NEGLIGENCE), STRICT LIABILITY OR OTHERWISE, EVEN IF APPLE HAS BEEN - ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - - Copyright © 2006 Apple Computer, Inc., All Rights Reserved -*/ - -/* This sample shows how to override the C++ global 'new' and 'delete' operators. */ -#include -#include -#include -#include -#include - -/* Some variables and code to make the example do something. */ -namespace { - unsigned long long gNewCounter; // number of times 'new' was called - unsigned long long gDeleteCounter; // number of times 'delete' was called - - void printCounters() // print the counters above - { - std::cout << "new was called " << gNewCounter << " times and delete was called " << gDeleteCounter << " times\n"; - } -} - -/* These are the overridden new and delete routines. - Most applications will want to override at least these four versions of new/delete if they override any of them. - - In Mac OS, it's not necessary to override the array versions of operator new and delete if all - they would do is call the non-array versions; the C++ standard library, as an extension - to the C++ standard, does this for you. +#endif - Developers should consult the section [lib.support.dynamic] in the C++ standard to see the requirements - on the generic operators new and delete; the system may expect that your overridden operators meet all these - requirements. +namespace nv { - Your operators may be called by the system, even early in start-up before constructors have been executed. */ -void* operator new(std::size_t sz) throw (std::bad_alloc) -{ - void *result = std::malloc (sz == 0 ? 1 : sz); - if (result == NULL) - throw std::bad_alloc(); - gNewCounter++; - return result; -} -void operator delete(void* p) throw() -{ - if (p == NULL) - return; - std::free (p); - gDeleteCounter++; -} + // C++ helpers. + template T * malloc(size_t count) { + return (T *)::malloc(sizeof(T) * count); + } -/* These are the 'nothrow' versions of the above operators. - The system version will try to call a std::new_handler if they - fail, but your overriding versions are not required to do this. */ -void* operator new(std::size_t sz, const std::nothrow_t&) throw() -{ - try { - void * result = ::operator new (sz); // calls our overridden operator new - return result; - } catch (std::bad_alloc &) { - return NULL; - } -} -void operator delete(void* p, const std::nothrow_t&) throw() -{ - ::operator delete (p); -} + template T * realloc(T * ptr, size_t count) { + return (T *)::realloc(ptr, sizeof(T) * count); + } -/* Bug 4067110 is that if your program has no weak symbols at all, the linker will not set the - WEAK_DEFINES bit in the Mach-O header and as a result the new and delete operators above won't - be seen by system libraries. This is mostly a problem for test programs and small examples, - since almost all real C++ programs complicated enough to override new and delete will have at - least one weak symbol. However, this is a small example, so: */ -void __attribute__((weak, visibility("default"))) workaroundFor4067110 () { } + template void free(const T * ptr) { + ::free((void *)ptr); + } -/* This is a simple test program that causes the runtime library to call new and delete. */ -int main() -{ - atexit (printCounters); - try { - std::locale example("does_not_exist"); - } catch (std::runtime_error &x) { - } - return 0; -} -#endif // 0 +} // nv namespace #endif // NV_CORE_MEMORY_H diff --git a/src/nvcore/StrLib.cpp b/src/nvcore/StrLib.cpp index 34cf992..34518d9 100644 --- a/src/nvcore/StrLib.cpp +++ b/src/nvcore/StrLib.cpp @@ -21,17 +21,17 @@ namespace { static char * strAlloc(uint size) { - return static_cast(mem::malloc(size)); + return static_cast(::malloc(size)); } static char * strReAlloc(char * str, uint size) { - return static_cast(mem::realloc(str, size)); + return static_cast(::realloc(str, size)); } static void strFree(const char * str) { - return mem::free(const_cast(str)); + return ::free(const_cast(str)); } /*static char * strDup( const char * str ) diff --git a/src/nvcore/StrLib.h b/src/nvcore/StrLib.h index 8012271..4164cf5 100644 --- a/src/nvcore/StrLib.h +++ b/src/nvcore/StrLib.h @@ -294,7 +294,7 @@ namespace nv const uint16 count = getRefCount(); setRefCount(count - 1); if (count - 1 == 0) { - mem::free(data - 2); + free(data - 2); data = NULL; } } @@ -323,7 +323,7 @@ namespace nv void allocString(const char * str, int len) { - const char * ptr = static_cast(mem::malloc(2 + len + 1)); + const char * ptr = static_cast(::malloc(2 + len + 1)); setData( ptr ); setRefCount( 0 ); diff --git a/src/nvimage/FloatImage.cpp b/src/nvimage/FloatImage.cpp index 90818ca..6e82ade 100644 --- a/src/nvimage/FloatImage.cpp +++ b/src/nvimage/FloatImage.cpp @@ -148,13 +148,13 @@ void FloatImage::allocate(uint c, uint w, uint h) m_height = h; m_componentNum = c; m_count = w * h * c; - m_mem = reinterpret_cast(nv::mem::malloc(m_count * sizeof(float))); + m_mem = reinterpret_cast(::malloc(m_count * sizeof(float))); } /// Free the image, but don't clear the members. void FloatImage::free() { - nv::mem::free( reinterpret_cast(m_mem) ); + ::free( reinterpret_cast(m_mem) ); m_mem = NULL; } diff --git a/src/nvimage/Image.cpp b/src/nvimage/Image.cpp index 2307d5c..53c0b5f 100644 --- a/src/nvimage/Image.cpp +++ b/src/nvimage/Image.cpp @@ -78,7 +78,7 @@ void Image::unwrap() void Image::free() { - nv::mem::free(m_data); + ::free(m_data); m_data = NULL; } diff --git a/src/nvimage/ImageIO.cpp b/src/nvimage/ImageIO.cpp index 0b24600..70949ff 100644 --- a/src/nvimage/ImageIO.cpp +++ b/src/nvimage/ImageIO.cpp @@ -954,7 +954,7 @@ FloatImage * nv::ImageIO::loadFloatTIFF(const char * fileName, Stream & s) fimage->allocate(spp, width, height); int linesize = TIFFScanlineSize(tif); - tdata_t buf = (::uint8 *)nv::mem::malloc(linesize); + tdata_t buf = (::uint8 *)::malloc(linesize); for (uint y = 0; y < height; y++) { @@ -991,7 +991,7 @@ FloatImage * nv::ImageIO::loadFloatTIFF(const char * fileName, Stream & s) } } - nv::mem::free(buf); + ::free(buf); TIFFClose(tif); diff --git a/src/nvtt/CompressRGB.cpp b/src/nvtt/CompressRGB.cpp index 35239c4..7a6564d 100644 --- a/src/nvtt/CompressRGB.cpp +++ b/src/nvtt/CompressRGB.cpp @@ -1,140 +1,140 @@ -// Copyright NVIDIA Corporation 2007 -- Ignacio Castano -// -// Permission is hereby granted, free of charge, to any person -// obtaining a copy of this software and associated documentation -// files (the "Software"), to deal in the Software without -// restriction, including without limitation the rights to use, -// copy, modify, merge, publish, distribute, sublicense, and/or sell -// copies of the Software, and to permit persons to whom the -// Software is furnished to do so, subject to the following -// conditions: -// -// The above copyright notice and this permission notice shall be -// included in all copies or substantial portions of the Software. -// -// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, -// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES -// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND -// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT -// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, -// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING -// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR -// OTHER DEALINGS IN THE SOFTWARE. - -#include - -#include -#include -#include - -#include "CompressRGB.h" -#include "CompressionOptions.h" -#include "OutputOptions.h" - -using namespace nv; -using namespace nvtt; - -namespace -{ - - inline uint computePitch(uint w, uint bitsize) - { - uint p = w * ((bitsize + 7) / 8); - - // Align to 32 bits. - return ((p + 3) / 4) * 4; - } - - inline void convert_to_a8r8g8b8(const void * src, void * dst, uint w) - { - memcpy(dst, src, 4 * w); - } - - inline void convert_to_x8r8g8b8(const void * src, void * dst, uint w) - { - memcpy(dst, src, 4 * w); - } - -} // namespace - - -// Pixel format converter. -void nv::compressRGB(const Image * image, const OutputOptions::Private & outputOptions, const CompressionOptions::Private & compressionOptions) -{ - nvCheck(image != NULL); - - const uint w = image->width(); - const uint h = image->height(); - - const uint bitCount = compressionOptions.bitcount; - nvCheck(bitCount == 8 || bitCount == 16 || bitCount == 24 || bitCount == 32); - - const uint byteCount = bitCount / 8; - - const uint rmask = compressionOptions.rmask; - uint rshift, rsize; - PixelFormat::maskShiftAndSize(rmask, &rshift, &rsize); - - const uint gmask = compressionOptions.gmask; - uint gshift, gsize; - PixelFormat::maskShiftAndSize(gmask, &gshift, &gsize); - - const uint bmask = compressionOptions.bmask; - uint bshift, bsize; - PixelFormat::maskShiftAndSize(bmask, &bshift, &bsize); - - const uint amask = compressionOptions.amask; - uint ashift, asize; - PixelFormat::maskShiftAndSize(amask, &ashift, &asize); - - // Determine pitch. - uint pitch = computePitch(w, compressionOptions.bitcount); - - uint8 * dst = (uint8 *)mem::malloc(pitch + 4); - - for (uint y = 0; y < h; y++) - { - const Color32 * src = image->scanline(y); - - if (bitCount == 32 && rmask == 0xFF0000 && gmask == 0xFF00 && bmask == 0xFF && amask == 0xFF000000) - { - convert_to_a8r8g8b8(src, dst, w); - } - else if (bitCount == 32 && rmask == 0xFF0000 && gmask == 0xFF00 && bmask == 0xFF && amask == 0) - { - convert_to_x8r8g8b8(src, dst, w); - } - else - { - // Generic pixel format conversion. - for (uint x = 0; x < w; x++) - { - uint c = 0; - c |= PixelFormat::convert(src[x].r, 8, rsize) << rshift; - c |= PixelFormat::convert(src[x].g, 8, gsize) << gshift; - c |= PixelFormat::convert(src[x].b, 8, bsize) << bshift; - c |= PixelFormat::convert(src[x].a, 8, asize) << ashift; - - // Output one byte at a time. - for (uint i = 0; i < byteCount; i++) - { - *(dst + x * byteCount + i) = (c >> (i * 8)) & 0xFF; - } - } - - // Zero padding. - for (uint x = w * byteCount; x < pitch; x++) - { - *(dst + x) = 0; - } - } - - if (outputOptions.outputHandler != NULL) - { - outputOptions.outputHandler->writeData(dst, pitch); - } - } - - mem::free(dst); -} - +// Copyright NVIDIA Corporation 2007 -- Ignacio Castano +// +// Permission is hereby granted, free of charge, to any person +// obtaining a copy of this software and associated documentation +// files (the "Software"), to deal in the Software without +// restriction, including without limitation the rights to use, +// copy, modify, merge, publish, distribute, sublicense, and/or sell +// copies of the Software, and to permit persons to whom the +// Software is furnished to do so, subject to the following +// conditions: +// +// The above copyright notice and this permission notice shall be +// included in all copies or substantial portions of the Software. +// +// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +// EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES +// OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND +// NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT +// HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +// WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR +// OTHER DEALINGS IN THE SOFTWARE. + +#include + +#include +#include +#include + +#include "CompressRGB.h" +#include "CompressionOptions.h" +#include "OutputOptions.h" + +using namespace nv; +using namespace nvtt; + +namespace +{ + + inline uint computePitch(uint w, uint bitsize) + { + uint p = w * ((bitsize + 7) / 8); + + // Align to 32 bits. + return ((p + 3) / 4) * 4; + } + + inline void convert_to_a8r8g8b8(const void * src, void * dst, uint w) + { + memcpy(dst, src, 4 * w); + } + + inline void convert_to_x8r8g8b8(const void * src, void * dst, uint w) + { + memcpy(dst, src, 4 * w); + } + +} // namespace + + +// Pixel format converter. +void nv::compressRGB(const Image * image, const OutputOptions::Private & outputOptions, const CompressionOptions::Private & compressionOptions) +{ + nvCheck(image != NULL); + + const uint w = image->width(); + const uint h = image->height(); + + const uint bitCount = compressionOptions.bitcount; + nvCheck(bitCount == 8 || bitCount == 16 || bitCount == 24 || bitCount == 32); + + const uint byteCount = bitCount / 8; + + const uint rmask = compressionOptions.rmask; + uint rshift, rsize; + PixelFormat::maskShiftAndSize(rmask, &rshift, &rsize); + + const uint gmask = compressionOptions.gmask; + uint gshift, gsize; + PixelFormat::maskShiftAndSize(gmask, &gshift, &gsize); + + const uint bmask = compressionOptions.bmask; + uint bshift, bsize; + PixelFormat::maskShiftAndSize(bmask, &bshift, &bsize); + + const uint amask = compressionOptions.amask; + uint ashift, asize; + PixelFormat::maskShiftAndSize(amask, &ashift, &asize); + + // Determine pitch. + uint pitch = computePitch(w, compressionOptions.bitcount); + + uint8 * dst = (uint8 *)::malloc(pitch + 4); + + for (uint y = 0; y < h; y++) + { + const Color32 * src = image->scanline(y); + + if (bitCount == 32 && rmask == 0xFF0000 && gmask == 0xFF00 && bmask == 0xFF && amask == 0xFF000000) + { + convert_to_a8r8g8b8(src, dst, w); + } + else if (bitCount == 32 && rmask == 0xFF0000 && gmask == 0xFF00 && bmask == 0xFF && amask == 0) + { + convert_to_x8r8g8b8(src, dst, w); + } + else + { + // Generic pixel format conversion. + for (uint x = 0; x < w; x++) + { + uint c = 0; + c |= PixelFormat::convert(src[x].r, 8, rsize) << rshift; + c |= PixelFormat::convert(src[x].g, 8, gsize) << gshift; + c |= PixelFormat::convert(src[x].b, 8, bsize) << bshift; + c |= PixelFormat::convert(src[x].a, 8, asize) << ashift; + + // Output one byte at a time. + for (uint i = 0; i < byteCount; i++) + { + *(dst + x * byteCount + i) = (c >> (i * 8)) & 0xFF; + } + } + + // Zero padding. + for (uint x = w * byteCount; x < pitch; x++) + { + *(dst + x) = 0; + } + } + + if (outputOptions.outputHandler != NULL) + { + outputOptions.outputHandler->writeData(dst, pitch); + } + } + + ::free(dst); +} + diff --git a/src/nvtt/cuda/CudaCompressDXT.cpp b/src/nvtt/cuda/CudaCompressDXT.cpp index c59bedd..6b45ceb 100644 --- a/src/nvtt/cuda/CudaCompressDXT.cpp +++ b/src/nvtt/cuda/CudaCompressDXT.cpp @@ -137,7 +137,7 @@ void CudaCompressor::compressDXT1(const CompressionOptions::Private & compressio const uint h = (m_image->height() + 3) / 4; uint imageSize = w * h * 16 * sizeof(Color32); - uint * blockLinearImage = (uint *) malloc(imageSize); + uint * blockLinearImage = (uint *) ::malloc(imageSize); convertToBlockLinear(m_image, blockLinearImage); // @@ Do this in parallel with the GPU, or in the GPU! const uint blockNum = w * h; @@ -207,14 +207,14 @@ void CudaCompressor::compressDXT3(const CompressionOptions::Private & compressio const uint h = (m_image->height() + 3) / 4; uint imageSize = w * h * 16 * sizeof(Color32); - uint * blockLinearImage = (uint *) malloc(imageSize); + uint * blockLinearImage = (uint *) ::malloc(imageSize); convertToBlockLinear(m_image, blockLinearImage); const uint blockNum = w * h; const uint compressedSize = blockNum * 8; AlphaBlockDXT3 * alphaBlocks = NULL; - alphaBlocks = (AlphaBlockDXT3 *)malloc(min(compressedSize, MAX_BLOCKS * 8U)); + alphaBlocks = (AlphaBlockDXT3 *)::malloc(min(compressedSize, MAX_BLOCKS * 8U)); setupCompressKernel(compressionOptions.colorWeight.ptr()); @@ -298,14 +298,14 @@ void CudaCompressor::compressDXT5(const CompressionOptions::Private & compressio const uint h = (m_image->height() + 3) / 4; uint imageSize = w * h * 16 * sizeof(Color32); - uint * blockLinearImage = (uint *) malloc(imageSize); + uint * blockLinearImage = (uint *) ::malloc(imageSize); convertToBlockLinear(m_image, blockLinearImage); const uint blockNum = w * h; const uint compressedSize = blockNum * 8; AlphaBlockDXT5 * alphaBlocks = NULL; - alphaBlocks = (AlphaBlockDXT5 *)malloc(min(compressedSize, MAX_BLOCKS * 8U)); + alphaBlocks = (AlphaBlockDXT5 *)::malloc(min(compressedSize, MAX_BLOCKS * 8U)); setupCompressKernel(compressionOptions.colorWeight.ptr()); debian/patches/06-fix-libpng1.5-build.patch0000644000000000000000000000112612212470454015442 0ustar DEP: 3 Subject: Fixed build with libpng1.5 Last-Update: 2012-03-31 Origin: upstream, http://code.google.com/p/nvidia-texture-tools/source/detail?r=1248 diff --git a/src/nvimage/ImageIO.cpp b/src/nvimage/ImageIO.cpp index 0b24600..22e920a 100644 --- a/src/nvimage/ImageIO.cpp +++ b/src/nvimage/ImageIO.cpp @@ -603,7 +603,7 @@ static void user_read_data(png_structp png_ptr, png_bytep data, png_size_t lengt { nvDebugCheck(png_ptr != NULL); - Stream * s = (Stream *)png_ptr->io_ptr; + Stream * s = (Stream *)png_get_io_ptr(png_ptr); s->serialize(data, (int)length); if (s->isError()) { debian/patches/08-fix-wordsize-warning.patch0000644000000000000000000000173712212470454016171 0ustar DEP: 3 Subject: Removes incompatible typedefs for amd64 builds Last-Update: 2012-09-20 Origin: http://code.google.com/p/nvidia-texture-tools/issues/detail?id=175 Bug: https://launchpadlibrarian.net/115652507/buildlog_ubuntu-quantal-amd64.nvidia-texture-tools_2.0.8-1%2Bdfsg-2build1_FAILEDTOBUILD.txt.gz diff --git a/src/nvcore/DefsGnucLinux.h b/src/nvcore/DefsGnucLinux.h index a8e2a29..84864cc 100644 --- a/src/nvcore/DefsGnucLinux.h +++ b/src/nvcore/DefsGnucLinux.h @@ -2,6 +2,8 @@ #error "Do not include this file directly." #endif +#include + // Function linkage #define DLL_IMPORT #if __GNUC__ >= 4 @@ -58,8 +60,13 @@ typedef signed short int16; typedef unsigned int uint32; typedef signed int int32; +#if __WORDSIZE == 32 typedef unsigned long long uint64; typedef signed long long int64; +#else +typedef unsigned long uint64; +typedef signed long int64; +#endif // Aliases typedef uint32 uint; debian/patches/10-fix-cxxflags.patch0000644000000000000000000000107212212470454014460 0ustar Title: Remove -march=athlon64 from CXXFLAGS DEP: 3 Last-Update: 2013-09-06 Forwarded: https://code.google.com/p/nvidia-texture-tools/issues/detail?id=188 --- a/cmake/OptimalOptions.cmake +++ b/cmake/OptimalOptions.cmake @@ -15,7 +15,7 @@ ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "i686") IF(NV_SYSTEM_PROCESSOR STREQUAL "x86_64") - SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=athlon64") + #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=athlon64") #SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -march=athlon64 -msse3") ENDIF(NV_SYSTEM_PROCESSOR STREQUAL "x86_64") debian/patches/02-multiarch.patch0000644000000000000000000000357512212470454014060 0ustar Title: Multiarch support DEP: 3 Last-Update: 2012-01-07 Author: Lennart Weller Forwarded: not-needed Abstract: Added multiarch support. This change is debian specific and was not forwarded. diff --git a/src/nvcore/CMakeLists.txt b/src/nvcore/CMakeLists.txt index 50ace0f..6bb7e4d 100644 --- a/src/nvcore/CMakeLists.txt +++ b/src/nvcore/CMakeLists.txt @@ -46,5 +46,5 @@ SET_TARGET_PROPERTIES(nvcore PROPERTIES INSTALL(TARGETS nvcore RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib/static) + LIBRARY DESTINATION ${LIB_DIR_PATH} + ARCHIVE DESTINATION ${LIB_DIR_PATH}/static) diff --git a/src/nvimage/CMakeLists.txt b/src/nvimage/CMakeLists.txt index bfcb576..b15ce65 100644 --- a/src/nvimage/CMakeLists.txt +++ b/src/nvimage/CMakeLists.txt @@ -66,6 +66,6 @@ SET_TARGET_PROPERTIES(nvimage PROPERTIES INSTALL(TARGETS nvimage RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib/static) + LIBRARY DESTINATION ${LIB_DIR_PATH} + ARCHIVE DESTINATION ${LIB_DIR_PATH}/static) diff --git a/src/nvmath/CMakeLists.txt b/src/nvmath/CMakeLists.txt index 5e42733..54060fb 100644 --- a/src/nvmath/CMakeLists.txt +++ b/src/nvmath/CMakeLists.txt @@ -32,5 +32,5 @@ SET_TARGET_PROPERTIES(nvmath PROPERTIES INSTALL(TARGETS nvmath RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib/static) + LIBRARY DESTINATION ${LIB_DIR_PATH} + ARCHIVE DESTINATION ${LIB_DIR_PATH}/static) diff --git a/src/nvtt/CMakeLists.txt b/src/nvtt/CMakeLists.txt index 1be4200..b676946 100644 --- a/src/nvtt/CMakeLists.txt +++ b/src/nvtt/CMakeLists.txt @@ -57,8 +57,8 @@ SET_TARGET_PROPERTIES(nvtt PROPERTIES INSTALL(TARGETS nvtt RUNTIME DESTINATION bin - LIBRARY DESTINATION lib - ARCHIVE DESTINATION lib/static) + LIBRARY DESTINATION ${LIB_DIR_PATH} + ARCHIVE DESTINATION ${LIB_DIR_PATH}/static) INSTALL(FILES nvtt.h DESTINATION include/nvtt) debian/patches/04-fix-gcc4.7-build.patch0000644000000000000000000000131212212470454014723 0ustar DEP: 3 Subject: Fix NVTT build on GCC 4.7 Last-Update: 2012-03-31 Origin: http://trac.wildfiregames.com/changeset/11379 diff --git a/src/nvcore/Debug.cpp b/src/nvcore/Debug.cpp index 922bce7..ec4790e 100644 --- a/src/nvcore/Debug.cpp +++ b/src/nvcore/Debug.cpp @@ -27,6 +27,10 @@ # include #endif +#if NV_OS_LINUX || NV_OS_DARWIN || NV_OS_FREEBSD +# include // getpid +#endif + #if NV_OS_LINUX && defined(HAVE_EXECINFO_H) # include // backtrace # if NV_CC_GNUC // defined(HAVE_CXXABI_H) @@ -35,7 +39,6 @@ #endif #if NV_OS_DARWIN || NV_OS_FREEBSD -# include // getpid # include # include // sysctl # include debian/patches/series0000644000000000000000000000036112212470454012033 0ustar 01-library-versioning.patch 02-multiarch.patch 03-kfreebsd-bfs.patch 04-fix-gcc4.7-build.patch 05-fix-aliasing-bug.patch 06-fix-libpng1.5-build.patch 07-fix-valgrind.patch 08-fix-wordsize-warning.patch 09-arm-fix.patch 10-fix-cxxflags.patch debian/patches/05-fix-aliasing-bug.patch0000644000000000000000000000311212212470454015204 0ustar DEP: 3 Subject: Fix aliasing bug Last-Update: 2012-03-31 Origin: upstream, http://code.google.com/p/nvidia-texture-tools/source/detail?r=1167 Bug: http://code.google.com/p/nvidia-texture-tools/issues/detail?id=139 diff --git a/src/nvmath/Vector.h b/src/nvmath/Vector.h index bffdfbe..f90bd57 100644 --- a/src/nvmath/Vector.h +++ b/src/nvmath/Vector.h @@ -68,7 +68,7 @@ public: scalar y() const; scalar z() const; - const Vector2 & xy() const; + Vector2 xy() const; scalar component(uint idx) const; @@ -111,8 +111,8 @@ public: scalar z() const; scalar w() const; - const Vector2 & xy() const; - const Vector3 & xyz() const; + Vector2 xy() const; + Vector3 xyz() const; scalar component(uint idx) const; @@ -231,9 +231,9 @@ inline scalar Vector3::x() const { return m_x; } inline scalar Vector3::y() const { return m_y; } inline scalar Vector3::z() const { return m_z; } -inline const Vector2 & Vector3::xy() const +inline Vector2 Vector3::xy() const { - return *(Vector2 *)this; + return Vector2(m_x, m_y); } inline scalar Vector3::component(uint idx) const @@ -332,14 +332,14 @@ inline scalar Vector4::y() const { return m_y; } inline scalar Vector4::z() const { return m_z; } inline scalar Vector4::w() const { return m_w; } -inline const Vector2 & Vector4::xy() const +inline Vector2 Vector4::xy() const { - return *(Vector2 *)this; + return Vector2(m_x, m_y); } -inline const Vector3 & Vector4::xyz() const +inline Vector3 Vector4::xyz() const { - return *(Vector3 *)this; + return Vector3(m_x, m_y, m_z); } inline scalar Vector4::component(uint idx) const debian/patches/03-kfreebsd-bfs.patch0000644000000000000000000000632112212470454014416 0ustar DEP: 3 Subject: Add support for FreeBSD Last-Update: 2012-03-31 Origin: upstream, http://code.google.com/p/nvidia-texture-tools/source/detail?r=907 http://code.google.com/p/nvidia-texture-tools/source/detail?r=1025 Bug-Debian: http://bugs.debian.org/666252 diff --git a/src/nvcore/Debug.cpp b/src/nvcore/Debug.cpp index 0babc0f..922bce7 100644 --- a/src/nvcore/Debug.cpp +++ b/src/nvcore/Debug.cpp @@ -34,7 +34,7 @@ # endif #endif -#if NV_OS_DARWIN +#if NV_OS_DARWIN || NV_OS_FREEBSD # include // getpid # include # include // sysctl @@ -199,6 +199,14 @@ namespace return (void *) ucp->uc_mcontext->ss.eip; # endif # endif +# elif NV_OS_FREEBSD +# if NV_CPU_X86_64 + ucontext_t * ucp = (ucontext_t *)secret; + return (void *)ucp->uc_mcontext.mc_rip; +# elif NV_CPU_X86 + ucontext_t * ucp = (ucontext_t *)secret; + return (void *)ucp->uc_mcontext.mc_eip; +# endif # else # if NV_CPU_X86_64 // #define REG_RIP REG_INDEX(rip) // seems to be 16 diff --git a/src/nvcore/nvcore.h b/src/nvcore/nvcore.h index 469f6ad..fe0eaeb 100644 --- a/src/nvcore/nvcore.h +++ b/src/nvcore/nvcore.h @@ -38,6 +38,9 @@ #if defined POSH_OS_LINUX # define NV_OS_LINUX 1 # define NV_OS_UNIX 1 +#elif defined POSH_OS_FREEBSD +# define NV_OS_FREEBSD 1 +# define NV_OS_UNIX 1 #elif defined POSH_OS_CYGWIN32 # define NV_OS_CYGWIN 1 #elif defined POSH_OS_MINGW @@ -158,7 +161,7 @@ #elif NV_CC_GNUC # if NV_OS_LINUX # include "DefsGnucLinux.h" -# elif NV_OS_DARWIN +# elif NV_OS_DARWIN || NV_OS_FREEBSD # include "DefsGnucDarwin.h" # elif NV_OS_MINGW # include "DefsGnucWin32.h" diff --git a/src/nvcore/poshlib/posh.h b/src/nvcore/poshlib/posh.h index 3a7c381..f37a764 100644 --- a/src/nvcore/poshlib/posh.h +++ b/src/nvcore/poshlib/posh.h @@ -293,6 +293,16 @@ Metrowerks: # define POSH_OS_STRING "Linux" #endif +#if defined __FreeBSD__ +# define POSH_OS_FREEBSD 1 +# define POSH_OS_STRING "FreeBSD" +#endif + +#if defined __FreeBSD_kernel__ +# define POSH_OS_FREEBSD 1 +# define POSH_OS_STRING "kFreeBSD" +#endif + #if defined __CYGWIN32__ # define POSH_OS_CYGWIN32 1 # define POSH_OS_STRING "Cygwin" diff --git a/src/nvmath/nvmath.h b/src/nvmath/nvmath.h index 0318d4e..bedf132 100644 --- a/src/nvmath/nvmath.h +++ b/src/nvmath/nvmath.h @@ -115,7 +115,7 @@ inline bool isFinite(const float f) { #if NV_OS_WIN32 return _finite(f) != 0; -#elif NV_OS_DARWIN +#elif NV_OS_DARWIN || NV_OS_FREEBSD return isfinite(f); #elif NV_OS_LINUX return finitef(f); @@ -130,7 +130,7 @@ inline bool isNan(const float f) { #if NV_OS_WIN32 return _isnan(f) != 0; -#elif NV_OS_DARWIN +#elif NV_OS_DARWIN || NV_OS_FREEBSD return isnan(f); #elif NV_OS_LINUX return isnanf(f); diff --git a/src/nvtt/CMakeLists.txt b/src/nvtt/CMakeLists.txt index 9ce93d0..e85ac75 100644 --- a/src/nvtt/CMakeLists.txt +++ b/src/nvtt/CMakeLists.txt @@ -44,6 +44,10 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_SOURCE_DIR}) ADD_DEFINITIONS(-DNVTT_EXPORTS) IF(NVTT_SHARED) + IF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + SET(CMAKE_SHARED_LINKER_FLAGS "${CMAKE_SHARED_LINKER_FLAGS} -Wl,-z,origin") + ENDIF(CMAKE_SYSTEM_NAME MATCHES "FreeBSD") + ADD_DEFINITIONS(-DNVTT_SHARED=1) ADD_LIBRARY(nvtt SHARED ${NVTT_SRCS}) ELSE(NVTT_SHARED) debian/control0000644000000000000000000000431512212470454010575 0ustar Source: nvidia-texture-tools Section: libs Priority: extra Maintainer: Lennart Weller Vcs-git: git://anonscm.debian.org/collab-maint/nvidia-texture-tools.git Vcs-Browser: http://anonscm.debian.org/gitweb/?p=collab-maint/nvidia-texture-tools.git Build-Depends: cmake, debhelper (>= 8.1.3), dpkg-dev (>= 1.16.1~), freeglut3-dev, libglew-dev, libilmbase-dev, libjpeg8-dev, libopenexr-dev, libpng-dev, libtiff-dev, zlib1g-dev Standards-Version: 3.9.4 Homepage: http://code.google.com/p/nvidia-texture-tools/ Package: libnvtt2 Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 powerpc ppc64 Multi-Arch: same Pre-Depends: multiarch-support, ${misc:Pre-Depends} Depends: ${misc:Depends}, ${shlibs:Depends} Description: NVIDIA Texture Tools NVIDIA Texture Tools is a collection of image processing and texture manipulation tools, designed to be integrated in game tools and asset conditioning pipelines. The primary features of the library are mipmap and normal map generation, format conversion and DXT compression. Package: libnvtt-bin Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 powerpc ppc64 Multi-Arch: foreign Depends: ${misc:Depends}, ${shlibs:Depends} Provides: nvidia-texture-tools Description: NVIDIA Texture Tools (Binaries) NVIDIA Texture Tools is a collection of image processing and texture manipulation tools, designed to be integrated in game tools and asset conditioning pipelines. The primary features of the library are mipmap and normal map generation, format conversion and DXT compression. . This package contains the nvidia texture tools. Package: libnvtt-dev Architecture: amd64 armel armhf i386 kfreebsd-amd64 kfreebsd-i386 powerpc ppc64 Section: libdevel Depends: libnvtt2 (= ${binary:Version}), ${misc:Depends} Description: NVIDIA Texture Tools (Header) NVIDIA Texture Tools is a collection of image processing and texture manipulation tools, designed to be integrated in game tools and asset conditioning pipelines. The primary features of the library are mipmap and normal map generation, format conversion and DXT compression. . This package contains the header and development files needed to build programs and packages using libnvtt. debian/libnvtt2.install0000644000000000000000000000002112212470454012314 0ustar usr/lib/*/*.so.* debian/manpages/0000755000000000000000000000000012212470454010762 5ustar debian/manpages/nvddsinfo.10000644000000000000000000000101612212470454013034 0ustar .TH NVDDSINFO 1 "January 10, 2012" .\" Please adjust this date whenever revising the manpage. .SH NAME nvddsinfo \-Outputs information about the given DDS file. .SH SYNOPSIS \fBnvddsinfo\fP \fIFILE\fP .SH DESCRIPTION nvddsinfo is part of the NVIDIA texture toolset. The tool shows available information about the DDS image file. .SH INPUT OPTIONS .SH AUTHOR nvddsinfo is part of the NVIDIA texture tools .PP This manual page was written by Lennart Weller , for the Debian project (but may be used by others). debian/manpages/nvdecompress.10000644000000000000000000000103312212470454013551 0ustar .TH NVDECOMPRESS 1 "January 10, 2012" .\" Please adjust this date whenever revising the manpage. .SH NAME nvdecompress \- Decompresses the given DDS file. .SH SYNOPSIS \fBnvdecompress\fP [\fIOPTION\fP] \fIINFILE\fP [\fIOUTFILE\fP] .SH DESCRIPTION nvdecompress is part of the NVIDIA texture toolset. The tool decompresses the given infile into an image file. .SH AUTHOR nvdecompress is part of the NVIDIA texture tools .PP This manual page was written by Lennart Weller , for the Debian project (but may be used by others). debian/manpages/nvzoom.10000644000000000000000000000166312212470454012402 0ustar .TH NVZOOM 1 "January 10, 2012" .\" Please adjust this date whenever revising the manpage. .SH NAME nvzoom \- Scales the given image. .SH SYNOPSIS \fBnvzoom\fP [\fIOPTION\fP] \fIINFILE\fP [\fIOUTFILE\fP] .SH DESCRIPTION nvzoom is part of the NVIDIA texture toolset. The tool scales the image file with support for scaling and some filters. .SH INPUT OPTIONS .TP .BI -color .TP .BI -s\ \fIvalue\fP Scale factor. Default is 0.5 .TP .BI -g\ \fIvalue\fP Gamma correction. Default is 2.2 .TP .BI -f\ \fIfilter\fP One of the following filters. Default is box: .RS .BI box .BI triangle .BI quadratic .BI bspline .BI mitchell .BI lanczos .BI kaiser .RE .TP .BI -w\ \fImode\fP One of the following modes. Default is mirror: .RS .BI mirror .BI repeat .BI clamp .RE .SH AUTHOR nvzoom is part of the NVIDIA texture tools .PP This manual page was written by Lennart Weller , for the Debian project (but may be used by others). debian/manpages/nvcompress.10000644000000000000000000000250412212470454013244 0ustar .TH NVCOMPRESS 1 "January 10, 2012" .\" Please adjust this date whenever revising the manpage. .SH NAME nvcompress \- Compresses the given image and produces a DDS file. .SH SYNOPSIS \fBnvcompress\fP [\fIOPTION\fP] \fIINFILE\fP [\fIOUTFILE\fP] .SH DESCRIPTION nvcompress is part of the NVIDIA texture toolset. The tool compresses the given infile into a dds file. .SH INPUT OPTIONS .TP .BI -color The input image is a color map (default). .TP .BI -alpha The input image has an alpha channel used for transparency. .TP .BI -normal The input image is a normal map. .TP .BI -tonormal Convert input to normal map. .TP .BI -clamp Clamp wrapping mode (default). .TP .BI -repeat Repeat wrapping mode. .TP .BI -nomips Disable mipmap generation. .SH COMPRESSION OPTIONS .TP .BI -fast Fast compression. .TP .BI -nocuda Do not use cuda compressor. .TP .BI -rgb RGBA format .TP .BI -bc1 BC1 format (DXT1) .TP .BI -bc1n BC1 normal map format (DXT1nm) .TP .BI -bc1a BC1 format with binary alpha (DXT1a) .TP .BI -bc2 BC2 format (DXT3) .TP .BI -bc3 BC3 format (DXT5) .TP .BI -bc3n BC3 normal map format (DXT5nm) .TP .BI -bc4 BC4 format (ATI1) .TP .BI -bc5 BC5 format (3Dc/ATI2) .SH AUTHOR nvcompress is part of the NVIDIA texture tools .PP This manual page was written by Lennart Weller , for the Debian project (but may be used by others). debian/manpages/nvimgdiff.10000644000000000000000000000122712212470454013017 0ustar .TH NVIMGDIFF 1 "January 10, 2012" .\" Please adjust this date whenever revising the manpage. .SH NAME nvimgdiff \- Creates a diff for the two provided images .SH SYNOPSIS \fBnvimgdiff\fP [\fIOPTION\fP] \fIFILE1\fP [\fIFILE2\fP] .SH DESCRIPTION nvimgdiff is part of the NVIDIA texture toolset. The tool is able to show the difference between the two provided images. .SH OPTIONS .TP .BI -normal Compare images as if they were normal maps. .TP .BI -alpha Compare alpha weighted images. .SH AUTHOR nvimgdiff is part of the NVIDIA texture tools .PP This manual page was written by Lennart Weller , for the Debian project (but may be used by others). debian/manpages/nvassemble.10000644000000000000000000000130712212470454013204 0ustar .TH NVASSEMBLE 1 "January 10, 2012" .\" Please adjust this date whenever revising the manpage. .SH NAME nvassemble \- Create cubemap DDS files from multiple images. .SH SYNOPSIS \fBnvassemble\fP [\fIOPTION\fP] [\fIFILE\fP]... .SH DESCRIPTION nvassemble is part of the NVIDIA texture toolset. It allows the creation of cubemaps as well as texture volumes and arrays from the images provided on the command line. .SH OPTIONS .TP .BI -cube create a cubemap .TP .BI -volume create a texture volume .TP .BI -array create a texture array .SH AUTHOR nvassemble is part of the NVIDIA texture tools .PP This manual page was written by Lennart Weller , for the Debian project (but may be used by others). debian/changelog0000644000000000000000000000205212212470454011040 0ustar nvidia-texture-tools (2.0.8-1+dfsg-4) unstable; urgency=low [ Fabio Pedretti ] * Add armel and armhf build support (Closes: #721972) * Remove -march=athlon64 from CXXFLAGS (Closes: #713966, #712956) -- Lennart Weller Sat, 07 Sep 2013 02:16:32 +0200 nvidia-texture-tools (2.0.8-1+dfsg-3) unstable; urgency=low * Fixed a warning for incompatible typedefs on amd64 builds (Closes: #689642) * Updated to newest debian standard version 3.9.4 * Enable hardening flags -- Lennart Weller Thu, 20 Sep 2012 11:01:21 +0200 nvidia-texture-tools (2.0.8-1+dfsg-2) unstable; urgency=low * Cherry picked some revisions from upstream * Fixed debian/watch file (Closes: #666259) * Replaced C++ symbols file with shlibdeps (Closes: #666254) * Fixed architecture build (Closes: #666252) -- Lennart Weller Sat, 31 Mar 2012 23:49:30 +0200 nvidia-texture-tools (2.0.8-1+dfsg-1) unstable; urgency=low * Initial release. (Closes: #666010) -- Lennart Weller Tue, 27 Mar 2012 22:01:03 +0200 debian/watch0000644000000000000000000000031112212470454010213 0ustar version=3 opts=dversionmangle=s/\+dfsg// \ http://code.google.com/p/nvidia-texture-tools/downloads/list?can=1 \ .*/nvidia-texture-tools-(\d[-\d\.]*)\.(?:tgz|tbz|txz|(?:tar\.(?:gz|bz2|xz))|zip) debian/copyright0000644000000000000000000001070212212470454011122 0ustar Format: http://www.debian.org/doc/packaging-manuals/copyright-format/1.0/ Upstream-Name: NVIDIA Texture Tools Source: http://code.google.com/p/nvidia-texture-tools/ Files: * Copyright: Copyright (c) 2007 NVIDIA Corporation License: Expat Files: debian/* Copyright: Copyright 2012 Lennart Weller License: Expat Files: src/nvtt/squish/* src/nvtt/SingleColorLookup.h Copyright: Copyright (c) 2006 Simon Brown License: Expat Files: src/nvcore/poshlib/posh.* Copyright: Copyright (c) 2004, Brian Hook License: BSD-2-clause Files: src/nvimage/Filter.h src/nvimage/ColorBlock.cpp src/nvimage/Image.h src/nvimage/NormalMipmap.cpp src/nvimage/Quantize.h src/nvimage/PsdFile.h src/nvimage/FloatImage.h src/nvimage/ImageIO.h src/nvimage/Image.cpp src/nvimage/ImageIO.cpp src/nvimage/Filter.cpp src/nvimage/nvimage.h src/nvimage/ColorBlock.h src/nvimage/TgaFile.h src/nvimage/NormalMipmap.h src/nvimage/HoleFilling.h src/nvimage/HoleFilling.cpp src/nvimage/FloatImage.cpp src/nvimage/Quantize.cpp src/nvmath/Triangle.cpp src/nvmath/Montecarlo.h src/nvmath/SphericalHarmonic.cpp src/nvmath/Plane.cpp src/nvmath/Plane.h src/nvmath/Random.cpp src/nvmath/Basis.h src/nvmath/Random.h src/nvmath/Box.h src/nvmath/Basis.cpp src/nvmath/Triangle.h src/nvmath/Color.h src/nvmath/Quaternion.h src/nvmath/nvmath.h src/nvmath/Vector.h src/nvmath/Montecarlo.cpp src/nvmath/SphericalHarmonic.h src/nvmath/Matrix.h src/nvcore/Debug.cpp src/nvcore/Memory.h src/nvcore/TextReader.h src/nvcore/Tokenizer.cpp src/nvcore/Stream.h src/nvcore/TextWriter.h src/nvcore/TextReader.cpp src/nvcore/Debug.h src/nvcore/StrLib.cpp src/nvcore/StrLib.h src/nvcore/TextWriter.cpp src/nvcore/Prefetch.h src/nvcore/Library.h src/nvcore/nvcore.h src/nvcore/Ptr.h src/nvcore/Tokenizer.h src/nvcore/Containers.h src/nvcore/BitArray.h src/nvcore/StdStream.h src/nvcore/Memory.cpp src/nvcore/Radix.h src/nvcore/Radix.cpp src/nvmath/TriBox.cpp Copyright: Ignacio Castano License: public-domain The license is not specified beyond public-domain. The line from the source code is the following: "This code is in the public domain -- castanyo@yahoo.es" License: Expat Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: . The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. . THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. License: BSD-2-clause Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. . THIS SOFTWARE IS PROVIDED BY AUTHORS AND CONTRIBUTORS ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHORS OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. debian/compat0000644000000000000000000000000212212470454010365 0ustar 8 debian/source/0000755000000000000000000000000012212470454010467 5ustar debian/source/format0000644000000000000000000000001412212470454011675 0ustar 3.0 (quilt)