Skip to main content
Participant
Mar 4, 2022 6:58 PM UTC
Question

Color Mode Validation

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 is closed to new replies. Start a new post to keep the conversation going.

4 replies

Participating Frequently
Mar 8, 2022 8:55 AM UTC

Hi,

 

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

 

Translate
Known Participant
Mar 8, 2022 4:58 PM UTC

Hi there,

We are looking to query color versus grayscale.

 

Thank you!

Translate
Participating Frequently
Mar 11, 2022 8:52 AM UTC

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.

Translate