summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 29487a8)
raw | patch | inline | side by side (parent: 29487a8)
author | sgimenez <sgimenez@users.sourceforge.net> | |
Fri, 23 Jan 2009 21:55:34 +0000 (21:55 +0000) | ||
committer | sgimenez <sgimenez@users.sourceforge.net> | |
Fri, 23 Jan 2009 21:55:34 +0000 (21:55 +0000) |
src/trace/siox.cpp | patch | blob | history | |
src/trace/siox.h | patch | blob | history |
diff --git a/src/trace/siox.cpp b/src/trace/siox.cpp
index adddd5f4465a8f54ee632e8eda522d60d485a77b..b3404fc007e050b091ea31d2f7fff5dd88c44721 100644 (file)
--- a/src/trace/siox.cpp
+++ b/src/trace/siox.cpp
_clab_inited_ = true;
}
}
-
+
/**
/**
* Error logging
*/
-void SioxImage::error(char *fmt, ...)
+void SioxImage::error(const char *fmt, ...)
{
char msgbuf[256];
va_list args;
return;
}
unsigned long offset = width * y + x;
- pixdata[offset] = pixval;
+ pixdata[offset] = pixval;
}
/**
* If the coordinates are out of range, do nothing.
*/
void SioxImage::setPixel(unsigned int x, unsigned int y,
- unsigned int a,
- unsigned int r,
+ unsigned int a,
+ unsigned int r,
unsigned int g,
unsigned int b)
{
return 0L;
}
unsigned long offset = width * y + x;
- return pixdata[offset];
+ return pixdata[offset];
}
/**
return;
}
unsigned long offset = width * y + x;
- cmdata[offset] = confval;
+ cmdata[offset] = confval;
}
/**
return 0.0;
}
unsigned long offset = width * y + x;
- return cmdata[offset];
+ return cmdata[offset];
}
/**
*/
const float Siox::FOREGROUND_CONFIDENCE=0.8f;
-/**
+/**
* Confidence for foreground or background type being equally likely.
*/
const float Siox::UNKNOWN_REGION_CONFIDENCE=0.5f;
/**
* Error logging
*/
-void Siox::error(char *fmt, ...)
+void Siox::error(const char *fmt, ...)
{
char msgbuf[256];
va_list args;
/**
* Trace logging
*/
-void Siox::trace(char *fmt, ...)
+void Siox::trace(const char *fmt, ...)
{
char msgbuf[256];
va_list args;
trace("### Analyzing image");
std::map<unsigned int, Tupel> hs;
-
+
unsigned int progressResolution = pixelCount / 10;
for (unsigned int i=0; i<pixelCount; i++)
{
if (i % progressResolution == 0)
{
- float progress =
+ float progress =
30.0 + 60.0 * (float)i / (float)pixelCount;
//trace("### progress:%f", progress);
if (!progressReport(progress))
const float threshold,
const unsigned int dims)
{
-
-
unsigned int currentDim = recursionDepth % dims;
CieLab point = points[leftBase];
float min = point(currentDim);
{
error("Could not allocate buffer for signature");
return false;
- }
+ }
for (unsigned int i=0 ; i < length ; i++)
input[i] = inputVec[i];
float max= -1000000.0f;
for (int i=0; i<cmSize; i++)
if (cm[i] > max) max=cm[i];
-
+
//good to use STL, but max() is not iterative
//float max = *std::max(cm, cm + cmSize);
diff --git a/src/trace/siox.h b/src/trace/siox.h
index 42fd304219237be2f1772d9a30efeb9eec6bc0ff..6b7256fe0f37a7b2b6bfd587e3c6a253797a1362 100644 (file)
--- a/src/trace/siox.h
+++ b/src/trace/siox.h
/**
* Error logging
*/
- void error(char *fmt, ...) G_GNUC_PRINTF(2,3);
+ void error(const char *fmt, ...) G_GNUC_PRINTF(2,3);
};
/**
* Error logging
*/
- void error(char *fmt, ...) G_GNUC_PRINTF(2,3);
+ void error(const char *fmt, ...) G_GNUC_PRINTF(2,3);
/**
* Trace logging
*/
- void trace(char *fmt, ...) G_GNUC_PRINTF(2,3);
+ void trace(const char *fmt, ...) G_GNUC_PRINTF(2,3);
/**
* Stage 1 of the color signature work. 'dims' will be either