コード例 #1
0
ファイル: main.cpp プロジェクト: Sensasion/imguru
int main (int argc, char* const argv[]) 
{
	init();
	
	if (argc == 1 && usage())
		return 0;
	if (parseCmdLine(argc, argv) != 0)
		return 0;
	if (optShowHelp && showHelp())
		return 0;
	if (optShowVersion && showVersion())
		return 0;
    
    curl_global_init(CURL_GLOBAL_ALL);
	
	for (int i = 0; i < optFiles.size(); i++)
	{
		std::string processed = processImage(optFiles[i], optImageSize);
		if (processed == "") 
			continue;
		
		if (processed != optFiles[i])
			tempFiles.push_back(processed);
		
        std::string err;
		std::string output = uploadImage(processed.c_str(), err);
		if (!userOutput(output) || err.length() > 0)
			fprintf(stderr, "Upload failed for %s.\n%s\n", optFiles[i].c_str(), err.c_str());
	}
	
	for (int i = 0; i < tempFiles.size(); i++)
		remove(tempFiles[i].c_str());
	
    return 0;
}
コード例 #2
0
/**
    \fn fillSlot
    \brief upload the image to the slot. 
*/
bool vdpauVideoFilterDeint::fillSlot(int slot,ADMImage *image)
{
    VdpVideoSurface tgt;
    bool external=false;
    if(image->refType!=ADM_HW_VDPAU)
    {   // Need to allocate a surface
        ADM_assert(freeSurface.size());
        tgt=freeSurface.front();
        freeSurface.pop_front();  
        aprintf("FillSlot : Popped %d\n",tgt);
        //
        if(false==uploadImage(image,tgt)) 
        {
            return false;
        }
        external=false;
    }else
    {   // use the provided surface
        aprintf("Deint Image is already vdpau, slot %d \n",slot);
        ADMImage *img=xslots[slot].image;
        img->duplicateFull(image); // increment ref count
        // get surface
        img->hwDownloadFromRef();
        vdpau_render_state *render=(vdpau_render_state *)img->refDescriptor.refCookie;
        ADM_assert(render->refCount);
        tgt=render->surface;
        external=true;
    }
    nextPts=image->Pts;
    xslots[slot].pts=image->Pts;
    xslots[slot].surface=tgt;
    xslots[slot].isExternal=external;
    return true;
}
コード例 #3
0
ファイル: DatapickerImage.cpp プロジェクト: gerlachs/labplot
void DatapickerImagePrivate::updateFileName() {
	WAIT_CURSOR;
	q->isLoaded = false;
	const QString& address = fileName.trimmed();

	if ( !address.isEmpty() ) {
		if (uploadImage(address)) {
			q->initSceneParameters();
			fileName = address;
		}
	} else {
		//hide segments if they are visible
		q->m_segments->setSegmentsVisible(false);
	}

    QList<DatapickerPoint*> childPoints = q->parentAspect()->children<DatapickerPoint>(AbstractAspect::Recursive | AbstractAspect::IncludeHidden);
    if (childPoints.count()) {
        foreach(DatapickerPoint* point, childPoints)
            point->remove();
    }

    emit q->requestUpdate();
    emit q->requestUpdateActions();
	RESET_CURSOR;
}
コード例 #4
0
ファイル: animatedtexture.cpp プロジェクト: sque/o3engine
	//! Play next
	void AnimatedTexture::playNext(Real timepassed) {
		map<Real, const Image *>::iterator it;

		// Increase current time
		current_time += timepassed;

		// Check if we reached the end
		if (current_time > total_time) {
			switch (play_mode) {
			case PLAY_ONEWAY:
				return; // Bye!
			case PLAY_REPEATED:
				current_time -= total_time;
				break;
			case PLAY_FORWARDBACK: //! we will see it
				break;
			}
		}

		// Select new image
		for (it = playlist.begin(); it != playlist.end(); it++) {
			// Find 1st frame above desired time
			if (it->first > current_time) {
				it--; // Go back now

				// Check if it is already loaded
				if (current != it) {
					uploadImage(*it->second);
					current = it;
				}
				break;
			}
		}
	}
コード例 #5
0
//--------------------------------------------------------------
void saverScene::draw(){
	ofPushStyle();	

	ofFill();
	
	ofSetHexColor(0xFFFFFF);
	ofRect(SIDE_GUI_X, 0, ofGetWidth(), ofGetHeight());
	
	if( tmpGroups.size() ){
		ofPushStyle();
		ofEnableAlphaBlending();
		addTag.draw(50);
		clearLoaded.draw(50);
		ofPopStyle();
		
	}
	

	renderer.render(groups.getVector());
	renderer.render(tmpGroups);
	
	
	if( grabScreen ){
		ofImage img;
		img.grabScreen(SIDE_GUI_X, 0, ofGetWidth()-SIDE_GUI_X, ofGetHeight());
		img.saveImage(imagePath + imageFilename);
		
		if( !uploadImage(imagePath, imageFilename) ){
			printf("ERROR UPLOADING VIA FTP\n");
		}		
		
		grabScreen = false;
	}

	saveAndUpload.draw();
	clearTags.draw();
	loadPrevious.draw();
	loadNext.draw();
	
			
	if( mx < SIDE_GUI_X ){
		ofPushStyle();
			ofFill();
			ofSetColor(255, 255, 255);
			ofCircle(mx, my, 9);
			ofSetColor(0,0,0);
			ofCircle(mx, my, 6);
		ofPopStyle();
	}
	else{
		ofNoFill();
		ofCircle(mx, my, 9);
	}
	
	
	ofPopStyle();
}
コード例 #6
0
 virtual already_AddRefed<gfxImageSurface>
 GetImageForUpload(gfxASurface* aUpdateSurface)
 {
     NS_ASSERTION(gfxASurface::SurfaceTypeWin32 == aUpdateSurface->GetType(),
                  "unexpected surface type");
     nsRefPtr<gfxImageSurface> uploadImage(
         static_cast<gfxWindowsSurface*>(aUpdateSurface)->
         GetImageSurface());
     return uploadImage.forget();
 }