示例#1
0
void FileFrameWriter::notifyNewImage(eq::Channel& channel,
                                     const eq::Image& image)
{
    const std::string& prefix =
        channel.getSAttribute(eq::Channel::SATTR_DUMP_IMAGE);
    LBASSERT(!prefix.empty());
    const std::string fileName = prefix + channel.getDumpImageFileName();
    if (!image.writeImage(fileName, eq::Frame::Buffer::color))
        LBWARN << "Could not write file " << fileName << std::endl;
}
示例#2
0
    void _textureDownload()
    {
        if( !_texture )
            _texture = new util::Texture( GL_TEXTURE_RECTANGLE_ARB,
                            _channel->getObjectManager().glewGetContext( ));

        const PixelViewport& pvp = _channel->getPixelViewport();
        _texture->copyFromFrameBuffer( GL_RGBA, pvp );
        // Needed as copyFromFrameBuffer only grows the texture!
        _texture->resize( pvp.w, pvp.h );
        _texture->download( buffer.getData( ));
    }
示例#3
0
    bool _fboDownload()
    {
        const SystemWindow* sysWindow = _channel->getWindow()->getSystemWindow();
        const util::FrameBufferObject* fbo = sysWindow->getFrameBufferObject();
        if( !fbo || fbo->getColorTextures().size() != 1 )
            return false;

        const util::Texture* texture = fbo->getColorTextures().front();
        const PixelViewport& pvp = _channel->getPixelViewport();
        if( texture->getWidth() != pvp.w || texture->getHeight() != pvp.h )
            return false;

        texture->download( buffer.getData( ));
        return true;
    }
示例#4
0
 int height() { return _channel->getPixelViewport().h; }
示例#5
0
 int width() { return _channel->getPixelViewport().w; }
示例#6
0
 float screen_pixel_aspect_ratio()
 {
     float pixels_per_unit_x = _channel->getPixelViewport().w / (_canvas_width * _channel->getViewport().w);
     float pixels_per_unit_y = _channel->getPixelViewport().h / (_canvas_height * _channel->getViewport().h);
     return pixels_per_unit_y / pixels_per_unit_x;
 }
示例#7
0
 int screen_height() { return _channel->getPixelViewport().h / _channel->getViewport().h; }
示例#8
0
 int screen_width() { return _channel->getPixelViewport().w / _channel->getViewport().w; }
示例#9
0
 void make_context_current() { _channel->getWindow()->makeCurrent(); }