dist/test/examples-gh-pages/required/plugins/pixi-compressed-textures.js
// Calcualates the size of a compressed texture level in bytes
Calcualates the size of a compressed texture level in bytes
Calcualates the size of a compressed texture level in bytes
function textureLevelSize(format, width, height) {
    switch (format) {
        case COMPRESSED_RGB_S3TC_DXT1_EXT:
        case COMPRESSED_RGB_ATC_WEBGL:
        case COMPRESSED_RGB_ETC1_WEBGL:
            return ((width + 3) >> 2) * ((height + 3) >> 2) * 8;
        case COMPRESSED_RGBA_S3TC_DXT3_EXT:
        case COMPRESSED_RGBA_S3TC_DXT5_EXT:
        case COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL:
        case COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL:
            return ((width + 3) >> 2) * ((height + 3) >> 2) * 16;
        case COMPRESSED_RGB_PVRTC_4BPPV1_IMG:
        case COMPRESSED_RGBA_PVRTC_4BPPV1_IMG:
            return Math.floor((Math.max(width, 8) * Math.max(height, 8) * 4 + 7) / 8);
        case COMPRESSED_RGB_PVRTC_2BPPV1_IMG:
        case COMPRESSED_RGBA_PVRTC_2BPPV1_IMG:
            return Math.floor((Math.max(width, 16) * Math.max(height, 8) * 2 + 7) / 8);
        default:
            return 0;
    }
}
function textureLevelSize ( format , width , height ) { switch ( format ) { case COMPRESSED_RGB_S3TC_DXT1_EXT : case COMPRESSED_RGB_ATC_WEBGL : case COMPRESSED_RGB_ETC1_WEBGL : return ( ( width + 3 ) >> 2 ) * ( ( height + 3 ) >> 2 ) * 8 ; case COMPRESSED_RGBA_S3TC_DXT3_EXT : case COMPRESSED_RGBA_S3TC_DXT5_EXT : case COMPRESSED_RGBA_ATC_EXPLICIT_ALPHA_WEBGL : case COMPRESSED_RGBA_ATC_INTERPOLATED_ALPHA_WEBGL : return ( ( width + 3 ) >> 2 ) * ( ( height + 3 ) >> 2 ) * 16 ; case COMPRESSED_RGB_PVRTC_4BPPV1_IMG : case COMPRESSED_RGBA_PVRTC_4BPPV1_IMG : return Math . floor ( ( Math . max ( width , 8 ) * Math . max ( height , 8 ) * 4 + 7 ) / 8 ) ; case COMPRESSED_RGB_PVRTC_2BPPV1_IMG : case COMPRESSED_RGBA_PVRTC_2BPPV1_IMG : return Math . floor ( ( Math . max ( width , 16 ) * Math . max ( height , 8 ) * 2 + 7 ) / 8 ) ; default : return 0 ; } }
Calcualates the size of a compressed texture level in bytes
Calcualates the size of a compressed texture level in bytes