|
From: Herton R. K. <he...@us...> - 2005-07-01 00:37:40
|
Update of /cvsroot/kimageprocess/kimageprocess/src/methods/glcm In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6681/src/methods/glcm Modified Files: glcm.cpp glcm.h Log Message: - Cosmetics. - Added code to save current selected method and its features on the project file that is saved. Index: glcm.cpp =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/glcm/glcm.cpp,v retrieving revision 1.12 retrieving revision 1.13 diff -u -d -r1.12 -r1.13 --- glcm.cpp 30 Jun 2005 02:37:48 -0000 1.12 +++ glcm.cpp 1 Jul 2005 00:37:20 -0000 1.13 @@ -18,6 +18,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ + #include "glcm.h" #include <kgenericfactory.h> @@ -32,7 +33,7 @@ K_EXPORT_COMPONENT_FACTORY( kimageprocess_glcm, KGenericFactory<KTGLCM>( "kimageprocess_glcm" ) ) - + KTGLCM::KTGLCM(QObject *parent, const char* name, const QStringList&) : KTMethod() { @@ -49,7 +50,6 @@ if (256 % m_quantization != 0) m_glcmSize++; } - KTGLCM::~KTGLCM() { } @@ -57,18 +57,18 @@ void KTGLCM::calculate(KTImage *img, int imgClass) { m_img = img; - + // create matrices - for (int i=0; i < 4; i++) + for (int i=0; i < 4; ++i) { m_glcm[i] = new float*[m_glcmSize]; - for (int j=0;j < m_glcmSize; j++) + for (int j=0;j < m_glcmSize; ++j) m_glcm[i][j] = new float[m_glcmSize]; } - + calculateGLCM(); - int i,j,k; + int i, j, k; QValueList<float> results[4]; /* FIXME: Hardcoded values just for testing */ int begin = 0, end = 3; Index: glcm.h =================================================================== RCS file: /cvsroot/kimageprocess/kimageprocess/src/methods/glcm/glcm.h,v retrieving revision 1.7 retrieving revision 1.8 diff -u -d -r1.7 -r1.8 --- glcm.h 23 Jun 2005 23:19:42 -0000 1.7 +++ glcm.h 1 Jul 2005 00:37:20 -0000 1.8 @@ -1,5 +1,5 @@ /*************************************************************************** - * Copyright (C) 2004-2005 by * + * Copyright (C) 2004-2005 by * * Gustavo Pichorim Boiko <gus...@kd...> * * Herton Ronaldo Krzesinski <he...@my...> * * * @@ -18,6 +18,7 @@ * Free Software Foundation, Inc., * * 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. * ***************************************************************************/ + #ifndef KIMAGEPROCESS_GLCM_H #define KIMAGEPROCESS_GLCM_H @@ -36,22 +37,21 @@ KTGLCM(QObject *parent, const char *name, const QStringList&); ~KTGLCM(); - - void calculate(KTImage *img, int imgClass = 0); - + + void calculate(KTImage *img, int imgClass = 0); + void *data(int direction) const; int dataSize(int index = 0) { return m_glcmSize; } private: void calculateGLCM(); - + KTImage *m_img; int m_quantization; int m_glcmSize; /** the glcm in 4 directions */ float **m_glcm[4]; - }; #endif |