Exemplo n.º 1
0
        public void CCTReader(string file)
        {
            CCTs   = default;
            _IO    = File.OpenReader(file + ".cct", true);
            header = _IO.ReadHeader();
            if (header.Signature != 0x54524343 || header.InnerSignature != 0x3)
            {
                return;
            }
            _IO.P -= 0x4;

            CCTs = _IO.RCPE <CCT>();
            if (CCTs.C < 1)
            {
                _IO.C(); CCTs.C = -1; return;
            }

            if (CCTs.C > 0 && CCTs.O == 0)
            {
                _IO.C(); CCTs.C = -1; return;
            }

            /*{
             *  _IO.Format = Header.Format = Format.X;
             *  _IO.Offset = Header.Length;
             *  _IO.Position = CCTs.Offset;
             *  CCTs = _IO.ReadCountPointerX<CCT>();
             * }*/

            _IO.P = CCTs.O;
            for (i = 0; i < CCTs.C; i++)
            {
                ref CCT cct = ref CCTs.E[i];
                _IO.RI32E();
                cct.Hue        = _IO.RF32E();
                cct.Saturation = _IO.RF32E();
                cct.Lightness  = _IO.RF32E();
                cct.Exposure   = _IO.RF32E();
                cct.Gamma.X    = _IO.RF32E();
                cct.Gamma.Y    = _IO.RF32E();
                cct.Gamma.Z    = _IO.RF32E();
                cct.Contrast   = _IO.RF32E();
            }
Exemplo n.º 2
0
        public void CCTReader(string file)
        {
            IsX  = false;
            CCTs = default;
            byte[] ccData = File.ReadAllBytes(file + ".cct");
            Struct _CCRT  = ccData.RSt(); ccData = null;

            if (_CCRT.Header.Signature != 0x54524343)
            {
                return;
            }

            s      = File.OpenReader(_CCRT.Data);
            s.IsBE = _CCRT.Header.UseBigEndian;

            CCTs = s.RCPE <CCT>();
            if (CCTs.C < 1)
            {
                s.C(); CCTs.C = -1; return;
            }

            if (!(CCTs.C > 0 && CCTs.O == 0))
            {
                s.PI64 = CCTs.O - _CCRT.Header.Length;
                for (i = 0; i < CCTs.C; i++)
                {
                    ref CCT cct = ref CCTs.E[i];
                    cct.Flags      = (Flags)s.RI32E();
                    cct.Hue        = s.RF32E();
                    cct.Saturation = s.RF32E();
                    cct.Lightness  = s.RF32E();
                    cct.Exposure   = s.RF32E();
                    cct.Gamma.X    = s.RF32E();
                    cct.Gamma.Y    = s.RF32E();
                    cct.Gamma.Z    = s.RF32E();
                    cct.Contrast   = s.RF32E();
                }
            }
Exemplo n.º 3
0
 private System.Drawing.Point MapToScreen(Point point, CCT.NUI.Core.Size originalSize)
 {
     int border = 50;
     return new System.Drawing.Point(-border + (int)(point.X / originalSize.Width * (Screen.PrimaryScreen.Bounds.Width + 2 * border)), - border + (int)(point.Y / originalSize.Height * (Screen.PrimaryScreen.Bounds.Height + 2 * border)));
 }
 private Point3D Map(CCT.NUI.Core.Point point)
 {
     return new Point3D(point.X, (this.imageSource.Height - point.Y), 800 - point.Z);
 }
 private void CalcTimeSpan(CCT.NUI.Core.Point point)
 {
     var startTime = moveStartTime.TotalMilliseconds;
     var newTime = Math.Abs(startTime + (point.X - moveStart.X) * 100);
     this.slider.Value = newTime;;
 }
 private void ExecuteOnHitResult(CCT.NUI.Core.Point fingerTip, Action<RayMeshGeometry3DHitTestResult> action)
 {
     this.Dispatcher.Invoke(new Action(() =>
     {
         var hitTestResult = VisualTreeHelper.HitTest(this.viewPort, this.canvas.TranslatePoint(new System.Windows.Point(fingerTip.X, fingerTip.Y), this.canvas));
         if (hitTestResult is RayMeshGeometry3DHitTestResult)
         {
             action(hitTestResult as RayMeshGeometry3DHitTestResult);
         }
     }));
 }