Esempio n. 1
0
bool DrawAbstract::loadImages(){

    //Generate and set current image ID
    ILuint *imgID = new ILuint[videoduration];
    ilGenImages( videoduration, imgID );

    mTextureIDs = new GLuint[videoduration];
    glGenTextures( videoduration, mTextureIDs );

    for(int i = 0; i < videoduration; i++){
    	ilBindImage( imgID[i] );

        //Load image
        char *path;
        generateImagePath(&path,i+1);//array from 0, images on hdd from 1
        std::cout << "Path:" << path << std::endl;
        ILboolean success = ilLoadImage( path );
        //delete path;
        std::cout << "bla" << success <<  std::endl;

        //Image loaded successfully
        if( success == IL_TRUE )
        {
            success = ilConvertImage( IL_RGBA, IL_UNSIGNED_BYTE );
            if( success == IL_TRUE )
            {
                //Create texture from file pixels
                loadTextureFromPixels32( (GLuint*)ilGetData(), (GLuint)ilGetInteger( IL_IMAGE_WIDTH ), (GLuint)ilGetInteger( IL_IMAGE_HEIGHT ),i);
            }
        }

     }

    return true;
}
// -----------------------------------------------------------------------------
//
// -----------------------------------------------------------------------------
void WritePoleFigure::writeImage(QImage image, QString label)
{
  QString filename = generateImagePath(label);
  QString ss = QObject::tr("Writing Image %1").arg(filename);
  notifyStatusMessage(getMessagePrefix(), getHumanLabel(), ss);
  bool saved = image.save(filename);
  if (!saved)
  {
    setErrorCondition(-90011);
    QString ss = QObject::tr("The Pole Figure image file '%1' was not saved").arg(filename);
    notifyErrorMessage(getHumanLabel(), ss, getErrorCondition());
  }
}
Esempio n. 3
0
bool DrawAbstract::drawmanager(){

	if(processedframe < videoduration){

		processedframe++;

		char *path;
		generateImagePath(&path,processedframe);
		imagepath = std::string(path);

		delete path;
		return true;
	}

	return false;
}