Imagination PowerVR SDK Blog

pvr file format specification 2


#1

Hi I am trying add an older pvr file format to my image loader code, the pvr header is not version 3 but version 2



uint32_t headerLength;

uint32_t height;

uint32_t width;

uint32_t numMipmaps;

uint32_t flags;

uint32_t dataLength;

uint32_t bpp;

uint32_t bitmaskRed;

uint32_t bitmaskGreen;

uint32_t bitmaskBlue;

uint32_t bitmaskAlpha;

uint32_t pvrTag;

uint32_t numSurfs;



can someone point me in the direction to the rest of the file format?



thanks in advance.


#2

Hi Chris,



There’s not really one available at present. We never wrote a specification that is quite as complete as the PVR v3 version, but there was something tucked away in the old PVRTexLib documents which should be suitable. I assume you’ve already looked at the code in the tools to get as far as you can.



So there’s two ways you can get the document, either you can visit our legacy SDK page and download one of the legacy packages from there (2.8 will still be entirely PVR v1/2), or if you send an email to DevTech@imgtec.com we can send you the document directly.



Thanks,

Tobias


#3

thanks for the help Tobias :slight_smile:


#4

I found the legacy page but I can’t see which v2.8 you mean, I’ve downloaded a couple but lost.



https://www.imgtec.com/powervr/insider/sdkdownloads/legacy.asp



I’ve emailed your team too in case they can point me to it sooner.



I’ve found code here

http://developer.apple.com/library/ios/#samplecode/PVRTextureLoader/Listings/Classes_PVRTexture_m.html#//apple_ref/doc/uid/DTS40008121-Classes_PVRTexture_m-DontLinkElementID_12



which does a mask on the flag header element and expects either

kPVRTextureFlagTypePVRTC_2 = 24,

kPVRTextureFlagTypePVRTC_4 = 25



(version 2?)



but I get neither of those I get a flag value of 18 which means the pvr files I’ve been given are a different version, maybe version 1.



(note the rest of the header is correct, and get the PVR! identifier and correct values for height / width etc )



Any help much appreciated.











#5

Hi Chris,



Sorry I haven’t gotten back to this sooner, I was off with the flu last week and wasn’t able to get back to you. So I’m afraid your email hasn’t actually come through - could you try resending? Alternatively, did you sign up to the forum with an email address I can send the document to? I can send something to that address if you like?



As for the texture flag type, that actually refers to the texture compression format, not the file version, and they are actually enum values which are laid out in the old document, or in PVRTTexture.h in the PVRTools. These values are consistent through PVRv1 and PVRv2 files, only PVRv3 uses a new type system.



Regards,

Tobias


#6

I suspect you may be getting a flag value of 0x18, which is 24, which is consistent with Apple’s code and the enum in PVRTTexture.h.