Skip to content

Conversation

rdumusc
Copy link

@rdumusc rdumusc commented Nov 15, 2016

No description provided.

@@ -0,0 +1,247 @@
/*********************************************************************/
/* Copyright (c) 2016, EPFL/Blue Brain Project */
/* Raphael Dumusc <raphael.dumusc@epfl.ch> */
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I did 80% of this file, for shame :)

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

you did it for my glory, for which I am grateful :-)

connect( _qmlComponent.get(), &QQmlComponent::statusChanged,
this, &OffscreenQuickView::_setupRootItem );

// Now hook up the signals. For simplicy we don't differentiate between
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo 'simplicy'

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done


QImage OffscreenQuickView::getImage() const
{
return _quickRenderer->fbo()->toImage();
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

no check if fbo() is valid?

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It has no reason to be invalid at this point and I don't know what to do if it is not... throw?return an empty image?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After constructor or if render target is not FBO this will be nullptr, so at least empty image to not crash. Maybe also add more documentation in the header in which cases this is actually valid.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You're right, and I realize it is also not very safe that this can only be called from a Qt::DirectConnection (while the FBO is bound). A better way would be to get the image internally just afterRender() and always keep a copy, so that class users don't risk making any mistake.

connect( this, &QQuickWindow::heightChanged,
_rootItem.get(), &QQuickItem::setHeight );

// also bind view to root object, to allow progamatic resize of the rootItem
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo 'progamatic'

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

QmlStreamer::Impl::Impl( const QString& qmlFile, const std::string& streamHost,
const std::string& streamId )
: _renderControl( new QQuickRenderControl )
// Create a QQuickWindow that is associated with out render control. Note
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

that comment does not apply here anymore

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@rdumusc rdumusc merged commit 69d703b into BlueBrain:master Nov 16, 2016
@rdumusc rdumusc deleted the offscreen branch November 16, 2016 16:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants