mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-28 01:16:31 +00:00
Add a python extension function to access picked location. Refs #2065
This commit is contained in:
@@ -1815,6 +1815,7 @@ void TextureViewer::UI_UpdateChannels()
|
||||
|
||||
INVOKE_MEMFN(RT_UpdateAndDisplay);
|
||||
INVOKE_MEMFN(RT_UpdateVisualRange);
|
||||
UI_UpdateStatusText();
|
||||
}
|
||||
|
||||
void TextureViewer::SetupTextureTabs()
|
||||
@@ -3791,6 +3792,30 @@ void TextureViewer::on_locationGoto_clicked()
|
||||
ShowGotoPopup();
|
||||
}
|
||||
|
||||
rdcpair<int32_t, int32_t> TextureViewer::GetPickedLocation()
|
||||
{
|
||||
TextureDescription *texptr = GetCurrentTexture();
|
||||
|
||||
if(texptr)
|
||||
{
|
||||
QPoint p = m_PickedPoint;
|
||||
|
||||
p.setX(p.x() >> (int)m_TexDisplay.subresource.mip);
|
||||
p.setY(p.y() >> (int)m_TexDisplay.subresource.mip);
|
||||
|
||||
uint32_t mipHeight = qMax(1U, texptr->height >> (int)m_TexDisplay.subresource.mip);
|
||||
|
||||
if(ShouldFlipForGL())
|
||||
p.setY((int)(mipHeight - 1) - p.y());
|
||||
if(m_TexDisplay.flipY)
|
||||
p.setY((int)(mipHeight - 1) - p.y());
|
||||
|
||||
return {p.x(), p.y()};
|
||||
}
|
||||
|
||||
return {-1, -1};
|
||||
}
|
||||
|
||||
void TextureViewer::ShowGotoPopup()
|
||||
{
|
||||
TextureDescription *texptr = GetCurrentTexture();
|
||||
|
||||
Reference in New Issue
Block a user