From ae976e087a7110c6b25a0fee4f663185b5e4319d Mon Sep 17 00:00:00 2001 From: Kent Mein Date: Wed, 26 Dec 2007 21:46:30 +0000 Subject: This is patch: [#7975] imbuf for DDS textures: improved read support and a few bugs fixed Kent Notes From the author: The attached patch syncs the DDS code in Blender with the latest revision (324) of the nvidia texture tools. This fixes a few minor issues and adds support for a more types of DDS textures, in particular uncompressed textures that don't have the standard 16, 24, or 32 bits per pixel. Note: I have started using the nvidia texture tools convention for naming integer types (uint, uint16, uint8, uint64 etc.) because doing so makes it much easier to merge patches from upstream. Since the code is compiled separately from the rest of Blender, this likely does not pose a problem. However, if there turns out to be a good reason for avoiding those nvidia type names from upstream, I'd be happy to fix it. Regards, Amorilia --- source/blender/imbuf/intern/dds/Image.h | 29 +++++++++++++++-------------- 1 file changed, 15 insertions(+), 14 deletions(-) (limited to 'source/blender/imbuf/intern/dds/Image.h') diff --git a/source/blender/imbuf/intern/dds/Image.h b/source/blender/imbuf/intern/dds/Image.h index 10356774777..0241839d01d 100644 --- a/source/blender/imbuf/intern/dds/Image.h +++ b/source/blender/imbuf/intern/dds/Image.h @@ -37,6 +37,7 @@ #ifndef _DDS_IMAGE_H #define _DDS_IMAGE_H +#include #include /// 32 bit RGBA image. @@ -53,28 +54,28 @@ public: Image(); ~Image(); - void allocate(unsigned int w, unsigned int h); + void allocate(uint w, uint h); /* bool load(const char * name); - void wrap(void * data, unsigned int w, unsigned int h); + void wrap(void * data, uint w, uint h); void unwrap(); */ - unsigned int width() const; - unsigned int height() const; + uint width() const; + uint height() const; - const Color32 * scanline(unsigned int h) const; - Color32 * scanline(unsigned int h); + const Color32 * scanline(uint h) const; + Color32 * scanline(uint h); const Color32 * pixels() const; Color32 * pixels(); - const Color32 & pixel(unsigned int idx) const; - Color32 & pixel(unsigned int idx); + const Color32 & pixel(uint idx) const; + Color32 & pixel(uint idx); - const Color32 & pixel(unsigned int x, unsigned int y) const; - Color32 & pixel(unsigned int x, unsigned int y); + const Color32 & pixel(uint x, uint y) const; + Color32 & pixel(uint x, uint y); Format format() const; void setFormat(Format f); @@ -83,19 +84,19 @@ private: void free(); private: - unsigned int m_width; - unsigned int m_height; + uint m_width; + uint m_height; Format m_format; Color32 * m_data; }; -inline const Color32 & Image::pixel(unsigned int x, unsigned int y) const +inline const Color32 & Image::pixel(uint x, uint y) const { return pixel(y * width() + x); } -inline Color32 & Image::pixel(unsigned int x, unsigned int y) +inline Color32 & Image::pixel(uint x, uint y) { return pixel(y * width() + x); } -- cgit v1.2.3