- March 28, 2014 at 6:58 am #31655
Similar to getting “getSurfaceData” is there an API available to get the mipmap data? by specifying the mipmap level.March 31, 2014 at 8:52 am #38571
Are you asking about PVRTexLib?
If so, CPVRTexture::getDataPtr will retrieve a pointer to the top of the data usually, but takes optional arguments to specify which surface you wish to retrieve. This should be what you’re looking for?
If you are asking about something else, could you let me know what that is?
TobiasMarch 31, 2014 at 9:15 am #38572
First sorry for asking such a vague question. I appreciate you effort to answer all possible ones. Yes I was asking about the PVRTexLib.
Suppose I have a cube map with data on all six sides. And my cubemap has mipmaps (Level0, Level1, Level2).
So If I use the API “uint8* getSurfaceData(unsigned int u32SurfaceNum);” with values from 0 to 6, I will get the image data of all the the faces in the Level0, right? Please correct me If I am wrong.
If my understanding is correct, How can I get the data of all the faces in Level1 and Level2.
Please let me know if you still don’t get me.
Saneesh.April 7, 2014 at 12:41 pm #38573
Ah! Which version of PVRTexLib are you using? The current version of PVRTexLib doesn’t have a function called getSurfaceData, so I believe you’ve got version 3 or earlier? In the old library I’m not sure off the top of my head – unfortunately I’m out of the office at the moment so it’ll take me a little while to check.
Would upgrading to the current version of the library be a possibility for you at any point? Whilst we can support the old version still, support requests will generally take longer to resolve simply due to it now being a legacy interface. Also if there are any bugs we won’t be able to provide you with fixes at this point.
I’ll let you know as soon as I know the answer to your question.
TobiasApril 7, 2014 at 2:25 pm #38574
Ok so I dug through the old library, and found a function called “findStartMipDataOffset” in PVRTextureUtilities. You can use this function with the face and mip level you require to figure out what the offset into your texture’s data should be.
So you can add the offset value returned from this function to the data pointer you get from: “CPVRTexture::getData().getData()”. Iterating through all the faces and MIP levels will give you the various surfaces and mip map levels.
Let me know if you need more information. Hope that helps!
TobiasApril 8, 2014 at 2:24 am #38575
Thanks for finding time to answer my question. As you guessed I am using an old version of PVRTexLibVersion. My version is 3.20. Unfortunately I can’t upgrade to latest library at this point.
I understand that you guys stopped support for the old version of the library. It is OK 🙂 .
I think the function “findStartMipDataOffset” is not available in the “PVRTextureUtilities” of version 3.20. So I wrote a function to get the mipmap data required from the data pointer I got from: “CPVRTexture::getData().getData()”.
I really appreciate your sincere effort to answer all the questions.
Saneesh.April 8, 2014 at 12:18 pm #38576
Ah right – if I remember correctly, that’s a function I added after realising that there wasn’t anything to do it, so earlier versions wouldn’t have it. If you’ve got your own function then that’s great, if you run into any problems with it though I’ll be happy to share the source code of the our function with you.
If you have any further issues, please let me know!