Get Mipmap data from uncompressed PVR file

Tagged: 

This topic contains 7 replies, has 2 voices, and was last updated by  saneesh 3 years, 6 months ago.

Viewing 8 posts - 1 through 8 (of 8 total)
  • Author
    Posts
  • #31655

    saneesh
    Member

    Hi,
    Similar to getting “getSurfaceData” is there an API available to get the mipmap data? by specifying the mipmap level.

    #38571

    Hi Saneesh,

    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?

    Thanks,
    Tobias

    #38572

    saneesh
    Member

    Hi Tobias,

    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.

    Regards,
    Saneesh.

    #38573

    Hi Saneesh,

    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.

    Thanks,
    Tobias

    #38574

    Hi Saneesh,

    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!

    Thanks,
    Tobias

    #38575

    saneesh
    Member

    Hi Tobias,
    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.

    Many Thanks,
    Saneesh.

    #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!

    Thanks,
    Tobias

    #38577

    saneesh
    Member

    Thank you Tobias.

    Saneesh.

Viewing 8 posts - 1 through 8 (of 8 total)
You must be logged in to reply to this topic.