Hi,
simply put the following code generates the error
Code:
error C2664: 'vGetPixelValueIntoArray' : cannot convert parameter 1 from 'float **__w64 ' to 'float *'
Code:
int main(int argc, char **argv) {
float **ppfImageData;/* a pointer to a series of 2d arrays */
s_Filename *psFile;
s_Header *psHeader;
psFile = (struct s_Filename *) malloc(sizeof(s_Filename));
psHeader = (struct s_Header *) malloc(sizeof(s_Header));
if (argc < 2){strncpy(acFilename, "C:\\Documents and Settings\\matt smith\\Desktop\\example\\img0061.ppm", sizeof(acFilename));}
else {strncpy(acFilename,argv[1],sizeof(acFilename));}
psFile = psGetImageBase(acFilename, psFile); //not important
psHeader = psGetHeader(psFile->acNextFileName, psHeader); //not important
psHeader->nPhotosToBeCounted = psFile->nMaxImagenumber;
if(!(ppfImageData = (float **) malloc(psHeader->nPhotosToBeCounted))){
fprintf(stderr, "Failed to allocate memory for imageMatrix array!\n");
return NULL;
}
vGetPixelValueIntoArray(&ppfImageData[nCountI], psFile->acNextFileName, psHeader); //this is the line that causes the error (the &ppfImageData is the problem variable)
}
void vGetPixelValueIntoArray(float *pfImageData, const char* pccFilename, s_Header* psHeader ) {// returns NULL if error
size_t nCounter, nSecondCounter;
FILE *pFTemp_file;
psHeader->nWantedPixels = 5;
if (!(pfImageData = (float *) malloc(psHeader->nWantedPixels))){ //malloc array for image data
fprintf(stderr, "Failed to allocate memory in *pfGetPixelValueIntoArray");
exit(-1);
}
}
I have looked into this problem and it could be a win32 problem but I have tried all of the suggestions about pre-processing I could find, was wondering if anyone had any ideas where I was going wrong...
Cheers,
Giant