< Summary - ReFlex - Library

Information
Class: ReFlex.Core.Common.Util.DepthImageFormatTools
Assembly: ReFlex.Core.Common
File(s): D:\a\reflex\reflex\library\src\Core\Common\Util\DepthImageFormatTools.cs
Line coverage
0%
Covered lines: 0
Uncovered lines: 16
Coverable lines: 16
Total lines: 45
Line coverage: 0%
Branch coverage
0%
Covered branches: 0
Total branches: 12
Branch coverage: 0%
Method coverage

Feature is only available for sponsors

Upgrade to PRO version

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity Line coverage
NumChannels(...)0%2040%
BytesPerChannel(...)0%2040%
GetFileExtension(...)0%2040%

File(s)

D:\a\reflex\reflex\library\src\Core\Common\Util\DepthImageFormatTools.cs

#LineLine coverage
 1namespace ReFlex.Core.Common.Util
 2{
 3    public static class DepthImageFormatTools
 4    {
 5        public static uint NumChannels(DepthImageFormat format)
 06        {
 07            switch (format)
 8            {
 9                case DepthImageFormat.Rgb24bpp:
 10                case DepthImageFormat.Greyccale48bpp:
 011                    return 3;
 12                case DepthImageFormat.Greyscale8bpp:
 013                    return 1;
 14                default:
 015                    return 1;
 16            }
 017        }
 18
 19        public static uint BytesPerChannel(DepthImageFormat format)
 020        {
 021            switch (format)
 22            {
 23                case DepthImageFormat.Greyccale48bpp:
 024                    return 2;
 25                case DepthImageFormat.Rgb24bpp:
 26                case DepthImageFormat.Greyscale8bpp:
 27                default:
 028                    return 1;
 29            }
 030        }
 31
 32        public static string GetFileExtension(DepthImageFormat format)
 033        {
 034            switch (format)
 35            {
 36                case DepthImageFormat.Greyccale48bpp:
 037                    return "png";
 38                case DepthImageFormat.Rgb24bpp:
 39                case DepthImageFormat.Greyscale8bpp:
 40                default:
 041                    return "jpg";
 42            }
 043        }
 44    }
 45}