Beispiel #1
0
void CameraWidget::createActions() {

    //--- On menu selection, window will show with preferred size
    _windowSelectAction = new QAction(windowTitle(), this);
    connect(_windowSelectAction, SIGNAL(triggered()), this, SLOT(showNormal()));
    connect(_windowSelectAction, SIGNAL(triggered()), this, SLOT(setFocus()));

    //--- Video Actions
    if(!_videoController->getCamera()->getCameraType())
    {
        _loadVideoAction = new QAction(QIcon("Resources/imageGUI/icons/configure64.png"), "Load video", this);
        connect(_loadVideoAction, SIGNAL(triggered()), this, SLOT(loadVideo()));
    }

    _saveFrameAction = new QAction(QIcon("Resources/imageGUI/icons/configure64.png"), "Save frame as...", this);
    connect(_saveFrameAction, SIGNAL(triggered()), this, SLOT(saveCurrentFrame()));

    _recordVideoAction = new QAction(QIcon("Resources/imageGUI/icons/configure64.png"), "Record video... (Click inside image to stop!)", this);
    connect(_recordVideoAction, SIGNAL(triggered()), this, SLOT(recordVideo()));

    //--- Settings
    _cameraInfoAction = new QAction(QIcon("Resources/imageGUI/icons/configure64.png"),
                                    "Camera...", this);
    connect(_cameraInfoAction, SIGNAL(triggered()), this, SLOT(openCameraInformationDialog()));

    _POISettingsAction = new QAction(QIcon("Resources/imageGUI/icons/configure64.png"), "POI Algorithm...",
                                     this);

    _trackingSettingsAction = new QAction(QIcon("Resources/imageGUI/icons/configure64.png"),
                                          "Tracking Algorithm...", this);

    _clearPOIsAction = new QAction(QIcon("Resources/imageGUI/icons/configure64.png"), "Clear initialized POIs", this);
    connect(_clearPOIsAction, SIGNAL(triggered()), this, SLOT(clearInitializedPOIs()));

}
Beispiel #2
0
void VideoLayerChromium::updateContentsIfDirty()
{
    if (!m_contentsDirty)
        return;

    RenderLayerBacking* backing = static_cast<RenderLayerBacking*>(m_owner->client());
    if (!backing || backing->paintingGoesToWindow())
        return;

    ASSERT(drawsContent());

    m_skipsDraw = false;
    VideoFrameChromium* frame = m_provider->getCurrentFrame();
    if (!frame) {
        m_skipsDraw = true;
        m_provider->putCurrentFrame(frame);
        return;
    }

    m_frameFormat = frame->format();
    unsigned textureFormat = determineTextureFormat(frame);
    if (textureFormat == GraphicsContext3D::INVALID_VALUE) {
        // FIXME: Implement other paths.
        notImplemented();
        m_skipsDraw = true;
        m_provider->putCurrentFrame(frame);
        return;
    }

    if (frame->surfaceType() == VideoFrameChromium::TypeTexture) {
        releaseCurrentFrame();
        saveCurrentFrame(frame);
        m_dirtyRect.setSize(FloatSize());
        m_contentsDirty = false;
        return;
    }

    // Allocate textures for planes if they are not allocated already, or
    // reallocate textures that are the wrong size for the frame.
    GraphicsContext3D* context = layerRendererContext();
    bool texturesAllocated = allocateTexturesIfNeeded(context, frame, textureFormat);
    if (!texturesAllocated) {
        m_skipsDraw = true;
        m_provider->putCurrentFrame(frame);
        return;
    }

    // Update texture planes.
    for (unsigned plane = 0; plane < frame->planes(); plane++) {
        ASSERT(frame->requiredTextureSize(plane) == m_textureSizes[plane]);
        updateTexture(context, m_textures[plane], frame->requiredTextureSize(plane), textureFormat, frame->data(plane));
    }

    m_dirtyRect.setSize(FloatSize());
    m_contentsDirty = false;

    m_provider->putCurrentFrame(frame);
}
Beispiel #3
0
void SyntroReview::saveButtonClicked(QAbstractButton *button)
{
	QFileDialog *fileDialog;

	if (m_CFSState != SYNTROREVIEW_CFS_STATE_OPEN)
		return;												// no open file anyway

	if (button == m_saveFrame){
		fileDialog = new QFileDialog(this, "JPEG (.jpg) file name");
		fileDialog->setAcceptMode(QFileDialog::AcceptSave);
		fileDialog->setFileMode(QFileDialog::AnyFile);
		fileDialog->selectFile(m_saveFilePath);
		fileDialog->setNameFilter("*.jpg");
		fileDialog->setDefaultSuffix("jpg");
		if (fileDialog->exec()) {
			m_saveFilePath = fileDialog->selectedFiles().at(0);
			saveCurrentFrame();
		}
	}
}
Beispiel #4
0
static gint timeout_CB (gpointer data)
{
	if ( (!_freezed) && getImage() )
	{
		int imageWidth, imageHeight, pixbufWidth, pixbufHeight;
		imageWidth = _inputImg.GetWidth();
		imageHeight = _inputImg.GetHeight();
		pixbufWidth = gdk_pixbuf_get_width(frame);
		pixbufHeight = gdk_pixbuf_get_height(frame);
		if ( (imageWidth != pixbufWidth) || (imageHeight != pixbufHeight) )
		{
			g_object_unref(frame);
			frame = gdk_pixbuf_new (GDK_COLORSPACE_RGB, FALSE, 8, imageWidth, imageHeight);
		}
		_frameN++;	
		gtk_widget_queue_draw (da);
		if (_savingSet)
			saveCurrentFrame();
	}

	return TRUE;
}
Beispiel #5
0
static gint saveSingleClicked_CB(GtkWidget *widget, gpointer data)
{
	saveCurrentFrame();
	
	return (TRUE);
}