#include "cieimage.h" #include namespace rtengine { CieImage::CieImage (int w, int h) : fromImage(false), W(w), H(h) { J_p = new float*[H]; Q_p = new float*[H]; M_p = new float*[H]; C_p = new float*[H]; sh_p = new float*[H]; // ch_p = new float*[H]; h_p = new float*[H]; // Initialize the pointers to zero for (unsigned int c=0; c<6; ++c) data[c] = NULL; // Trying to allocate all in one block data[0] = new (std::nothrow) float [W*H*6]; if (data[0]) { float * index = data[0]; for (int i=0; idata, W*H*6*sizeof(float)); else // Separate allocation for (unsigned int c=0; c<6; ++c) memcpy(data[c], Img->data[c], W*H*sizeof(float)); } }