[Bf-blender-cvs] SVN commit: /data/svn/bf-blender [49365] branches/soc-2011-tomato/source/ blender/compositor/operations/COM_InpaintOperation.cpp: - fix incorrect array delete use.
Campbell Barton
ideasman42 at gmail.com
Sun Jul 29 21:11:01 CEST 2012
Revision: 49365
http://projects.blender.org/scm/viewvc.php?view=rev&root=bf-blender&revision=49365
Author: campbellbarton
Date: 2012-07-29 19:11:00 +0000 (Sun, 29 Jul 2012)
Log Message:
-----------
- fix incorrect array delete use.
- replace 1.0f / sqrt(2) with M_SQRT1_2 define.
- use mini rather then MIN2.
Modified Paths:
--------------
branches/soc-2011-tomato/source/blender/compositor/operations/COM_InpaintOperation.cpp
Modified: branches/soc-2011-tomato/source/blender/compositor/operations/COM_InpaintOperation.cpp
===================================================================
--- branches/soc-2011-tomato/source/blender/compositor/operations/COM_InpaintOperation.cpp 2012-07-29 19:02:23 UTC (rev 49364)
+++ branches/soc-2011-tomato/source/blender/compositor/operations/COM_InpaintOperation.cpp 2012-07-29 19:11:00 UTC (rev 49365)
@@ -126,12 +126,12 @@
for (int j = 0; j < height; j++) {
for (int i = 0; i < width; i++) {
int r = 0;
- if (get(i, j, 3) < 1.0) {
+ if (get(i, j, 3) < 1.0f) {
r = width + height;
if (i > 0)
- r = MIN2(r, m[j * width + i - 1] + 1);
+ r = mini(r, m[j * width + i - 1] + 1);
if (j > 0)
- r = MIN2(r, m[(j - 1) * width + i] + 1);
+ r = mini(r, m[(j - 1) * width + i] + 1);
}
m[j * width + i] = r;
}
@@ -142,9 +142,9 @@
int r = m[j * width + i];
if (i + 1 < width)
- r = MIN2(r, m[j * width + i + 1] + 1);
+ r = mini(r, m[j * width + i + 1] + 1);
if (j + 1 < height)
- r = MIN2(r, m[(j + 1) * width + i] + 1);
+ r = mini(r, m[(j + 1) * width + i] + 1);
m[j * width + i] = r;
@@ -182,10 +182,10 @@
for (int dy = -1; dy <= 1; dy++) {
if (dx != 0 && dy != 0 &&
this->mdist(x + dx, y + dy) < d) {
- float weight = 1.0f / sqrt(2);
+ float weight = M_SQRT1_2; /* 1.0f / sqrt(2) */
if (dx == 0 || dy == 0) {
- weight = 1;
+ weight = 1.0f;
}
for (int c = 0; c < 3; c++) {
@@ -244,17 +244,17 @@
this->m_inputImageProgram = NULL;
this->deinitMutex();
if (this->m_cached_buffer) {
- delete this->m_cached_buffer;
+ delete [] this->m_cached_buffer;
this->m_cached_buffer = NULL;
}
if (this->m_pixelorder) {
- delete this->m_pixelorder;
+ delete [] this->m_pixelorder;
this->m_pixelorder = NULL;
}
if (this->m_manhatten_distance) {
- delete this->m_manhatten_distance;
+ delete [] this->m_manhatten_distance;
this->m_manhatten_distance = NULL;
}
this->m_cached_buffer_ready = false;
More information about the Bf-blender-cvs
mailing list