resize problem

This topic contains 2 replies, has 2 voices, and was last updated by  Jjay 5 years, 6 months ago.

Viewing 3 posts - 1 through 3 (of 3 total)
  • Author
    Posts
  • #30875

    Jjay
    Member

    hi all,

    i got a problem while calling the function pvrtexture::Resize in PVRTexLib.lib
    code here:
    pvrtexture theTexture( filename );
    pvrtexture::Resize( theTexture, Width, Height, theTexture.getHeader().getDepth(), pvrtexture::EResizeMode::eResizeNearest );
    pvrtexture::PixelType PVRTC4BPP( ePVRTPF_PVRTCI_4bpp_RGBA ); // Compress to PVRTC 4bpp.
    pvrtexture::Transcode( theTexture, PVRTC4BPP, ePVRTVarTypeUnsignedInteger, ePVRTCSpacelRGB );
    theTexture.saveFile(  sTheDstFilename.c_str() ); // Save the file
    but the resize function return false;
    is there anything i should set before Resize??
    but Resize in PVRTexTool.exe works well.
    besides, there seems some flaw appear while read dds file into the pvrtextool gui version, looks like black spots,
    but TGA file doesn’t, any idea will be grateful!
    #35847

    Hi Jjay,

    TexTool will automatically decompress an image to a standard format before it works on it. TexLib simply loads it into memory, so you’ll need to transcode it to a standard format before working on it  – (See: PVRTextureFormat.h which contains identifiers for standard formats, which need to be used alongside unsigned, normalised variable types. E.g.
     “Transcode( theTexture, PVRStandard8PixelType, ePVRTVarTypeUnsignedByteNorm, ePVRTCSpacelRGB );”).

    Once you’ve done this it should work assuming the texture load worked alright – this can be checked by calling “theTexture.getTextureFormat()” which will be equal to “ePVRTPF_NumCompressedPFs” if it’s invalid.

    As for the DDS files – this is a bug in previous versions with the dxt decompression routine – if you update to the latest version on the website this issue has been fixed.

    Thanks,

    Tobias

    #35848

    Jjay
    Member

    Thanks for your reply, its useful!

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