AnsweredAssumed Answered

Problem with reading the .bmp format images in openCL

Question asked by cyndwith on May 30, 2012
Latest reply on Jun 7, 2012 by Wenju

this is the code i have written to load an image (bmp) into openCL for basic image processisng operation but it give some errors like:

 

error LNK2019: unresolved external symbol "public: bool __thiscall streamsdk::SDKBitMap::write(char const *)" (?write@SDKBitMap@streamsdk@@QAE_NPBD@Z) referenced in function "int __cdecl writeOutputImage(class std::basic_string<char,struct std::char_traits<char>,class std::allocator<char> >)" (?writeOutputImage@@YAHV?$basic_string@DU?$char_traits@D@std@@V?$allocator@D@2@@std@@@Z)

 

 

how can i remove it??

 

int readInputImage(std::string inputImageName)//, cl_uchar4 *inputImageData)

{

 

    /*load input bitmap image */

    inputBitmap.load(inputImageName.c_str());

   

    if(!inputBitmap.isLoaded())

    {

        cout<<"Failed to load input image!"<<endl;

        //return -1;

    }

 

    //get the height and width of the input image

    /*height*/H=inputBitmap.getHeight();

    /*width*/W=inputBitmap.getWidth();

 

    //allocate memory to the input image

    inputImageData=(cl_uchar4*)malloc(W*H*sizeof(cl_uchar4));

 

    //error check

    if(inputImageData=NULL)

    {

        cout<<"Failed to allocate the memory!( input IMAGE DATA)"<<endl;

    }

 

    //allocate memory for out put image data

    outputImageData=(cl_uchar4*)malloc(W*H*sizeof(cl_uchar4));

 

    //error check

 

    if(outputImageData=NULL)

    {

        cout<<"FAILED TO ALLOCATE MEMORY TO THE OUTPUT IMAGE!!!"<<endl;

        //return -1;

    }

   

    //initialize the image data to null

    memset(outputImageData,0,W*H*pixelSize);

 

    //get the pointer to the pixel data

    pixelData=inputBitmap.getPixels();

 

    //error check

 

    if(pixelData=NULL)

    {

        cout<<"FAILED TO READ PIXEL DATA!!"<<endl;

 

    }

 

    //copy pixel data into inputImageData

 

    memcpy(inputImageData,pixelData,W*H*pixelSize);

 

    //allocate memory for verification output

   

    verificationOutput=(cl_uchar*)malloc(W*H*pixelSize);

    //error check

    if(verificationOutput==NULL)

    {

        cout<<"allocation of memory to verification failed!!"<<endl;

    }

 

    //intialisation the data to NULL

    memset(verificationOutput,0,W*H*pixelSize);

    return SDK_SUCCESS;

}

Outcomes