mirror of
https://github.com/baldurk/renderdoc.git
synced 2026-08-25 07:56:33 +00:00
Add TextureViewer.GetChannelVisibility that returns a tuple
* This is more natural to access and use from python. The old function could probably be removed but since we also changed the name we'll keep it.
This commit is contained in:
@@ -891,6 +891,13 @@ etc.
|
||||
)");
|
||||
virtual uint32_t GetChannelVisibilityBits() = 0;
|
||||
|
||||
DOCUMENT(R"(Return which channels are currently displayed, as a four-component tuple.
|
||||
|
||||
:return: The current channel visibility per component.
|
||||
:rtype: Tuple[bool,bool,bool,bool]
|
||||
)");
|
||||
virtual rdcfixedarray<bool, 4> GetChannelVisibility() = 0;
|
||||
|
||||
DOCUMENT(R"(Set the visibility of each channel.
|
||||
|
||||
:param bool red: Whether the red channel should be visible.
|
||||
|
||||
@@ -981,6 +981,10 @@ struct ITextureViewerInvoker : UIThreadInvoker<ITextureViewer>
|
||||
{
|
||||
return InvokeRetFunction<uint32_t>(&ITextureViewer::GetChannelVisibilityBits);
|
||||
}
|
||||
rdcfixedarray<bool, 4> GetChannelVisibility()
|
||||
{
|
||||
return InvokeRetFunction<rdcfixedarray<bool, 4>>(&ITextureViewer::GetChannelVisibility);
|
||||
}
|
||||
void SetChannelVisibility(bool red, bool green, bool blue, bool alpha)
|
||||
{
|
||||
return InvokeVoidFunction(&ITextureViewer::SetChannelVisibility, red, green, blue, alpha);
|
||||
|
||||
@@ -2294,6 +2294,11 @@ uint32_t TextureViewer::GetChannelVisibilityBits()
|
||||
return ret;
|
||||
}
|
||||
|
||||
rdcfixedarray<bool, 4> TextureViewer::GetChannelVisibility()
|
||||
{
|
||||
return {m_TexDisplay.red, m_TexDisplay.green, m_TexDisplay.blue, m_TexDisplay.alpha};
|
||||
}
|
||||
|
||||
void TextureViewer::SetChannelVisibility(bool red, bool green, bool blue, bool alpha)
|
||||
{
|
||||
ui->channelRed->setChecked(red);
|
||||
|
||||
@@ -155,6 +155,7 @@ public:
|
||||
void SetHistogramRange(float blackpoint, float whitepoint) override;
|
||||
|
||||
uint32_t GetChannelVisibilityBits() override;
|
||||
rdcfixedarray<bool, 4> GetChannelVisibility() override;
|
||||
void SetChannelVisibility(bool red, bool green, bool blue, bool alpha) override;
|
||||
|
||||
// ICaptureViewer
|
||||
|
||||
Reference in New Issue
Block a user