< Summary

Class:DCLFeatures.ScreencaptureCamera.CameraObject.ScreenFrameData
Assembly:ScreencaptureCamera
File(s):/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLServices/ScreencaptureCamera/CameraObject/Scripts/ScreenFrameData.cs
Covered lines:0
Uncovered lines:8
Coverable lines:8
Total lines:38
Line coverage:0% (0 of 8)
Covered branches:0
Total branches:0
Covered methods:0
Total methods:8
Method coverage:0% (0 of 8)

Metrics

MethodBranch coverage Crap Score Cyclomatic complexity NPath complexity Sequence coverage
CalculateFrameCorners()0%2100%
operator*(...)0%2100%

File(s)

/tmp/workspace/unity-renderer/unity-renderer/Assets/DCLServices/ScreencaptureCamera/CameraObject/Scripts/ScreenFrameData.cs

#LineLine coverage
 1using UnityEngine;
 2
 3namespace DCLFeatures.ScreencaptureCamera.CameraObject
 4{
 5    public struct ScreenFrameData
 6    {
 7        public float ScreenWidth;
 8        public float ScreenHeight;
 9
 10        public float FrameWidth;
 11        public float FrameHeight;
 12
 013        public int ScreenWidthInt => Mathf.RoundToInt(ScreenWidth);
 014        public int ScreenHeightInt => Mathf.RoundToInt(ScreenHeight);
 15
 016        public int FrameWidthInt => Mathf.RoundToInt(FrameWidth);
 017        public int FrameHeightInt => Mathf.RoundToInt(FrameHeight);
 18
 019        public float ScreenAspectRatio => ScreenWidth / ScreenHeight;
 020        public float FrameAspectRatio => FrameWidth / FrameHeight;
 21
 22        public Vector2Int CalculateFrameCorners() =>
 023            new ()
 24            {
 25                x = Mathf.RoundToInt((ScreenWidth - FrameWidth) / 2f),
 26                y = Mathf.RoundToInt((ScreenHeight - FrameHeight) / 2f),
 27            };
 28
 29        public static ScreenFrameData operator *(ScreenFrameData frame, int factor) =>
 030            new()
 31            {
 32                FrameWidth = frame.FrameWidth * factor,
 33                FrameHeight = frame.FrameHeight * factor,
 34                ScreenWidth = frame.ScreenWidth * factor,
 35                ScreenHeight = frame.ScreenHeight * factor
 36            };
 37    }
 38}