VrSharp.SvrTexture.SvrTexture.Is C# (CSharp) Method

Is() public static method

Determines if this is a SVR texture.
public static Is ( byte source, int offset, int length ) : bool
source byte Byte array containing the data.
offset int The offset in the byte array to start at.
length int Length of the data (in bytes).
return bool
        public static bool Is(byte[] source, int offset, int length)
        {
            // GBIX and PVRT
            if (length >= 0x20 &&
                PTMethods.Contains(source, offset + 0x00, Encoding.UTF8.GetBytes("GBIX")) &&
                PTMethods.Contains(source, offset + 0x10, Encoding.UTF8.GetBytes("PVRT")) &&
                source[offset + 0x19] >= 0x60 && source[offset + 0x19] < 0x70 &&
                BitConverter.ToUInt32(source, offset + 0x14) == length - 24)
                return true;

            // PVRT (and no GBIX chunk)
            else if (length >= 0x10 &&
                PTMethods.Contains(source, offset + 0x00, Encoding.UTF8.GetBytes("PVRT")) &&
                source[offset + 0x19] >= 0x60 && source[offset + 0x19] < 0x70 &&
                BitConverter.ToUInt32(source, offset + 0x04) == length - 8)
                return true;

            return false;
        }

Same methods

SvrTexture::Is ( Stream source ) : bool
SvrTexture::Is ( Stream source, int length ) : bool
SvrTexture::Is ( byte source ) : bool
SvrTexture::Is ( string file ) : bool