Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKent Mein <mein@cs.umn.edu>2007-12-27 00:46:30 +0300
committerKent Mein <mein@cs.umn.edu>2007-12-27 00:46:30 +0300
commitae976e087a7110c6b25a0fee4f663185b5e4319d (patch)
tree836c8b93de2b6f726ce5ea64914e3945cd60a4ae /source/blender/imbuf/intern/dds/ColorBlock.h
parent8e84f64c3daa5cd2cafc7fd14d7d0fad472298cf (diff)
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
Diffstat (limited to 'source/blender/imbuf/intern/dds/ColorBlock.h')
-rw-r--r--source/blender/imbuf/intern/dds/ColorBlock.h23
1 files changed, 12 insertions, 11 deletions
diff --git a/source/blender/imbuf/intern/dds/ColorBlock.h b/source/blender/imbuf/intern/dds/ColorBlock.h
index eba372768ad..72049be5f3c 100644
--- a/source/blender/imbuf/intern/dds/ColorBlock.h
+++ b/source/blender/imbuf/intern/dds/ColorBlock.h
@@ -45,16 +45,17 @@ struct ColorBlock
{
ColorBlock();
ColorBlock(const ColorBlock & block);
- ColorBlock(const Image * img, unsigned int x, unsigned int y);
+ ColorBlock(const Image * img, uint x, uint y);
- void init(const Image * img, unsigned int x, unsigned int y);
+ void init(const Image * img, uint x, uint y);
void swizzleDXT5n();
void splatX();
void splatY();
- unsigned int countUniqueColors() const;
+ uint countUniqueColors() const;
Color32 averageColor() const;
+ bool hasAlpha() const;
void diameterRange(Color32 * start, Color32 * end) const;
void luminanceRange(Color32 * start, Color32 * end) const;
@@ -69,11 +70,11 @@ struct ColorBlock
// Accessors
const Color32 * colors() const;
- Color32 color(unsigned int i) const;
- Color32 & color(unsigned int i);
+ Color32 color(uint i) const;
+ Color32 & color(uint i);
- Color32 color(unsigned int x, unsigned int y) const;
- Color32 & color(unsigned int x, unsigned int y);
+ Color32 color(uint x, uint y) const;
+ Color32 & color(uint x, uint y);
private:
@@ -89,25 +90,25 @@ inline const Color32 * ColorBlock::colors() const
}
/// Get block color.
-inline Color32 ColorBlock::color(unsigned int i) const
+inline Color32 ColorBlock::color(uint i) const
{
return m_color[i];
}
/// Get block color.
-inline Color32 & ColorBlock::color(unsigned int i)
+inline Color32 & ColorBlock::color(uint i)
{
return m_color[i];
}
/// Get block color.
-inline Color32 ColorBlock::color(unsigned int x, unsigned int y) const
+inline Color32 ColorBlock::color(uint x, uint y) const
{
return m_color[y * 4 + x];
}
/// Get block color.
-inline Color32 & ColorBlock::color(unsigned int x, unsigned int y)
+inline Color32 & ColorBlock::color(uint x, uint y)
{
return m_color[y * 4 + x];
}