Skip to main content
Participant
March 4, 2022
Question

Color Mode Validation

  • March 4, 2022
  • 1 reply
  • 345 views

Hi, 

We are trying to find a way to query a given output's color mode. It, however, is not obvious on how to do that, because the output inherits its color mode from its input. In the previous approach that we tried, we were assuming that there was a bitmap feeding into that channel, but we learned that it is not always the case. Ideally, we don't want to have to traverse the graph upstream from the output node at all. Is there is a direct way to query the output color mode? Thank you!

This topic has been closed for replies.

1 reply

Participating Frequently
March 8, 2022

Hi,

 

I am not sure what do you mean by output color mode. Is it color / grayscale or 8 / 16 / 32 bits per channel?

 

Known Participant
March 8, 2022

Hi there,

We are looking to query color versus grayscale.

 

Thank you!

Participating Frequently
March 11, 2022

Hi,

 

I think that there is no direct way to find this information using the API at the moment.
One possible (somewhat wasteful) way to do it would be to call compute on the graph to make sure that all 

outputs are rendered and after that you can retrieve the output results as SDTextures and use SDTexture.getPixelFormat() to query the pixel format.

 

Est.