Reduce peak memory usage of queue processing, Issue 2527

This commit is contained in:
Ingo
2014-10-20 16:46:41 +02:00
parent ee8ef7813e
commit 2a660e1965
11 changed files with 159 additions and 179 deletions

View File

@@ -24,7 +24,23 @@ namespace rtengine {
class LabImage {
private:
bool fromImage;
void allocLab(int w, int h) {
L = new float*[H];
a = new float*[H];
b = new float*[H];
data = new float [W*H*3];
float * index = data;
for (int i=0; i<H; i++)
L[i] = index + i*W;
index+=W*H;
for (int i=0; i<H; i++)
a[i] = index + i*W;
index+=W*H;
for (int i=0; i<H; i++)
b[i] = index + i*W;
};
public:
int W, H;
float * data;
@@ -38,6 +54,16 @@ public:
//Copies image data in Img into this instance.
void CopyFrom(LabImage *Img);
void getPipetteData (float &L, float &a, float &b, int posX, int posY, int squareSize);
void deleteLab( ) {
if (!fromImage) {
delete [] L;
delete [] a;
delete [] b;
delete [] data;
}
}
void reallocLab( ) { allocLab(W,H); };
};
}