summaryrefslogtreecommitdiff
path: root/src/resources/dye.cpp
diff options
context:
space:
mode:
authorAndrei Karas <akaras@inbox.ru>2013-12-17 17:55:43 +0300
committerAndrei Karas <akaras@inbox.ru>2013-12-17 17:55:43 +0300
commit07c3814e5e9c15dc0d5bdba9ba9a591e56116d7c (patch)
tree2dcff26849f6133d9a1e08e2601a2b2ec8cc9d2d /src/resources/dye.cpp
parentfa1bd85d4461a0a35f8843ac0965e2de5fd6b27e (diff)
downloadmv-07c3814e5e9c15dc0d5bdba9ba9a591e56116d7c.tar.gz
mv-07c3814e5e9c15dc0d5bdba9ba9a591e56116d7c.tar.bz2
mv-07c3814e5e9c15dc0d5bdba9ba9a591e56116d7c.tar.xz
mv-07c3814e5e9c15dc0d5bdba9ba9a591e56116d7c.zip
add restrict keyword into dye class.
Diffstat (limited to 'src/resources/dye.cpp')
-rw-r--r--src/resources/dye.cpp18
1 files changed, 11 insertions, 7 deletions
diff --git a/src/resources/dye.cpp b/src/resources/dye.cpp
index 5817f66b8..68364dc52 100644
--- a/src/resources/dye.cpp
+++ b/src/resources/dye.cpp
@@ -197,7 +197,7 @@ void DyePalette::getColor(double intensity, int color[3]) const
color[2] = static_cast<int>(rest * b1 + intensity * b2);
}
-void DyePalette::replaceSColor(uint32_t *pixels, const int bufSize) const
+void DyePalette::replaceSColor(uint32_t *restrict pixels, const int bufSize) const
{
std::vector<DyeColor>::const_iterator it_end = mColors.end();
const int sz = mColors.size();
@@ -253,7 +253,8 @@ void DyePalette::replaceSColor(uint32_t *pixels, const int bufSize) const
}
}
-void DyePalette::replaceAColor(uint32_t *pixels, const int bufSize) const
+void DyePalette::replaceAColor(uint32_t *restrict pixels,
+ const int bufSize) const
{
std::vector<DyeColor>::const_iterator it_end = mColors.end();
const int sz = mColors.size();
@@ -296,7 +297,8 @@ void DyePalette::replaceAColor(uint32_t *pixels, const int bufSize) const
}
}
-void DyePalette::replaceSOGLColor(uint32_t *pixels, const int bufSize) const
+void DyePalette::replaceSOGLColor(uint32_t *restrict pixels,
+ const int bufSize) const
{
std::vector<DyeColor>::const_iterator it_end = mColors.end();
const int sz = mColors.size();
@@ -345,7 +347,8 @@ void DyePalette::replaceSOGLColor(uint32_t *pixels, const int bufSize) const
}
}
-void DyePalette::replaceAOGLColor(uint32_t *pixels, const int bufSize) const
+void DyePalette::replaceAOGLColor(uint32_t *restrict pixels,
+ const int bufSize) const
{
std::vector<DyeColor>::const_iterator it_end = mColors.end();
const int sz = mColors.size();
@@ -444,7 +447,8 @@ Dye::~Dye()
}
}
-void Dye::instantiate(std::string &target, const std::string &palettes)
+void Dye::instantiate(std::string &restrict target,
+ const std::string &restrict palettes)
{
size_t next_pos = target.find('|');
@@ -503,7 +507,7 @@ int Dye::getType() const
return 0;
}
-void Dye::normalDye(uint32_t *pixels, const int bufSize) const
+void Dye::normalDye(uint32_t *restrict pixels, const int bufSize) const
{
for (uint32_t *p_end = pixels + bufSize; pixels != p_end; ++ pixels)
{
@@ -556,7 +560,7 @@ void Dye::normalDye(uint32_t *pixels, const int bufSize) const
}
}
-void Dye::normalOGLDye(uint32_t *pixels, const int bufSize) const
+void Dye::normalOGLDye(uint32_t *restrict pixels, const int bufSize) const
{
for (uint32_t *p_end = pixels + bufSize; pixels != p_end; ++ pixels)
{