Correction of a little bug in the Slicer class (OpenMP) + code cleanup

This commit is contained in:
Hombre
2010-08-24 19:52:58 +02:00
parent 77d561513b
commit 57ecf0d6ba
2 changed files with 6 additions and 14 deletions

View File

@@ -18,8 +18,11 @@
*/
#include <math.h>
#ifdef _OPENMP
#include <omp.h>
#endif
#include <slicer.h>
#include <gtkmm.h>
using namespace rtengine;
@@ -67,9 +70,9 @@ Slicer::Slicer(unsigned int imageWidth, unsigned int imageHeight, Block *subRegi
//total number of core/processor
#ifdef _OPENMP
procNumber = omp_get_num_procs();
unsigned int procNumber = omp_get_num_procs();
#else
procNumber = 1;
unsigned int procNumber = 1;
#endif
//calculate the number of block
@@ -88,9 +91,6 @@ Slicer::Slicer(unsigned int imageWidth, unsigned int imageHeight, Block *subRegi
}
Slicer::~Slicer() {
}
// return the absolute position and size of the requested block
void Slicer::get_block(unsigned int numBlock, Block *block) {
double roundingTradeOff = (hBlockNumber - (double)((int)hBlockNumber)) == 0.5 ? 2.1 : 2.0;

View File

@@ -21,13 +21,7 @@
//The image is divided in blocks even on single processor machine, mainly to decrease memory consumption
//maximum number of pixel per block
#define PIXELS_PER_BLOCK 1000000
// DEBUG!
#include <glibmm.h>
#include <stdio.h>
//#include <glib/gstdio.h>
#define PIXELS_PER_BLOCK 250000
namespace rtengine {
@@ -52,7 +46,6 @@ class Block {
class Slicer {
protected:
bool portrait; // Orientation of the sub-region
unsigned int procNumber; // Number of processor
unsigned int imWidth; // Image width
unsigned int imHeight; // Image height
Block region; // Sub-region to process
@@ -64,7 +57,6 @@ class Slicer {
unsigned int blockNumber; // number of block for the sub-region
unsigned int maxPixelNumber; // number of pixel of the biggest block (for memory allocation purpose)
Slicer(unsigned int imageWidth, unsigned int imageHeight, Block *subRegion, unsigned int pixels, const char* nomFichier);
~Slicer(void);
void get_block(unsigned int blockId, Block *block);
};