CSharpImageLibrary.ImageFormats.GetBlockSize C# (CSharp) Method

GetBlockSize() public static method

Gets block size of DDS format. Number of channels if not compressed. 1 if not a DDS format.
public static GetBlockSize ( ImageEngineFormat format ) : int
format ImageEngineFormat DDS format to test.
return int
        public static int GetBlockSize(ImageEngineFormat format)
        {
            int blocksize = 1;
            switch (format)
            {
                case ImageEngineFormat.DDS_ATI1:
                case ImageEngineFormat.DDS_DXT1:
                    blocksize = 8;
                    break;
                case ImageEngineFormat.DDS_DXT2:
                case ImageEngineFormat.DDS_DXT3:
                case ImageEngineFormat.DDS_DXT4:
                case ImageEngineFormat.DDS_DXT5:
                case ImageEngineFormat.DDS_ATI2_3Dc:
                    blocksize = 16;
                    break;
                case ImageEngineFormat.DDS_V8U8:
                case ImageEngineFormat.DDS_A8L8:
                    blocksize = 2;
                    break;
                case ImageEngineFormat.DDS_ARGB:
                    blocksize = 4;
                    break;
                case ImageEngineFormat.DDS_RGB:
                    blocksize = 3;
                    break;
                case ImageEngineFormat.DDS_CUSTOM:
                    blocksize = 4;
                    break;
            }
            return blocksize;
        }