SDK: Get Images data
-
In the Sketchup c++ SDK:
What is the equivalent of SUTextureGetImageData for a SUImageRef? How can I access images pixel data?
Thank you
-
Hmm... it looks like this might be missing. I'll double check and file an issue if it's truly missing.
-
Any work around ?
-
Not that the API provides. You could extract to a temp file and read it.
-
@tt_su said:
Not that the API provides. You could extract to a temp file and read it.
I'm not sure how I am supposed to extract the image to a file, if I cannot read its data.
-
There are no methods to read (or modify) individual pixels, but you can export a material's texture image using
Sketchup::TextureWriter
.
Create a temporary group (so the material doesn't have any distortion), apply the texture and load it to the texture writer. -
@marc477 said:
What is the equivalent of SUTextureGetImageData for a SUImageRef? How can I access images pixel data?
Update -
SUImageGetData
should be equivalent.
http://www.sketchup.com/intl/en/developer/su-api/image_8h.html#aedb99aee21a39619602866fc400766cb
Advertisement