MCPcopy Create free account
hub / github.com/Kitware/VTK / CopyToFrameBuffer

Method CopyToFrameBuffer

Rendering/OpenGL2/vtkTextureObject.cxx:2007–2023  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

2005
2006//------------------------------------------------------------------------------
2007void vtkTextureObject::CopyToFrameBuffer(vtkShaderProgram* program, vtkOpenGLVertexArrayObject* vao)
2008{
2009 // the following math really only works when texture
2010 // and viewport are of the same dimensions
2011 float minXTexCoord = static_cast<float>(0.5 / this->Width);
2012 float minYTexCoord = static_cast<float>(0.5 / this->Height);
2013
2014 float maxXTexCoord = static_cast<float>(static_cast<double>(this->Width - 0.5) / this->Width);
2015 float maxYTexCoord = static_cast<float>(static_cast<double>(this->Height - 0.5) / this->Height);
2016
2017 float tcoords[] = { minXTexCoord, minYTexCoord, maxXTexCoord, minYTexCoord, maxXTexCoord,
2018 maxYTexCoord, minXTexCoord, maxYTexCoord };
2019
2020 float verts[] = { -1.0f, -1.0f, 0.0f, 1.0f, -1.0f, 0.0f, 1.0f, 1.0f, 0.0f, -1.0f, 1.0f, 0.0f };
2021
2022 this->CopyToFrameBuffer(tcoords, verts, program, vao);
2023}
2024
2025//------------------------------------------------------------------------------
2026void vtkTextureObject::CopyToFrameBuffer(int srcXmin, int srcYmin, int srcXmax, int srcYmax,

Callers 13

RenderMethod · 0.80
RenderMethod · 0.80
DrawPixelsMethod · 0.80
SetZbufferDataMethod · 0.80
RenderMethod · 0.80
RenderMethod · 0.80
EDLComposeMethod · 0.80
RenderMethod · 0.80
RenderMethod · 0.80
RequestDataMethod · 0.80
RenderMethod · 0.80
RenderMethod · 0.80

Calls 15

ActivateMethod · 0.95
GetTextureUnitMethod · 0.95
DeactivateMethod · 0.95
RenderQuadFunction · 0.85
vtkglViewportMethod · 0.80
GetShaderCacheMethod · 0.80
ShaderProgramChangedMethod · 0.80
assertFunction · 0.50
GetWidthMethod · 0.45
GetHeightMethod · 0.45
GetStateMethod · 0.45
ReadyShaderProgramMethod · 0.45

Tested by

no test coverage detected