예제 #1
0
 public RV <float, Color> MakeRectangle(P2V <int, T> v)
 {
     return(new RV <float, Color>(
                minX: v.X,
                minY: v.Y,
                maxX: v.X + 1.0f,
                maxY: v.Y + 1.0f,
                v: ColorSets.GetLegColor(ColorLeg, v.V)
                ));
 }
예제 #2
0
        private object UpDato(P2 <int> dataLoc, R <double> imagePatch, object data)
        {
            var offset = dataLoc.X + dataLoc.Y * DataSz2.X;
            var color  = ColorSets.GetLegColor(ColorSets.RedBlueSFLeg, _testArray[offset]);

            return(new RV <float, Color>(
                       minX: (float)imagePatch.MinX,
                       maxX: (float)imagePatch.MaxX,
                       minY: (float)imagePatch.MinY,
                       maxY: (float)imagePatch.MaxY,
                       v: color));
        }
예제 #3
0
 private List <RV <float, Color> > MakePlotRectangles(
     ColorLeg <int> colorLeg,
     IEnumerable <P2V <int, RV <float, int> > > hist)
 {
     return(hist.Select(
                v => new RV <float, Color>(
                    minX: v.V.MinX,
                    minY: v.V.MinY,
                    maxX: v.V.MaxX,
                    maxY: v.V.MaxY,
                    v: ColorSets.GetLegColor(colorLeg, v.V.V)
                    )).ToList());
 }
예제 #4
0
        private TileVm UpDato(P2 <int> dataLoc, R <double> imagePatch)
        {
            var offset = dataLoc.X + dataLoc.Y * DataSz2.X;
            var vmRet  = new TileVm
            {
                BoundingRect = new R <float>(
                    minX: (float)imagePatch.MinX,
                    maxX: (float)imagePatch.MaxX,
                    minY: (float)imagePatch.MinY,
                    maxY: (float)imagePatch.MaxY
                    ),
                Color = ColorSets.GetLegColor(ColorSets.RedBlueSFLeg, _testArray[offset]),
                TextA = $"({dataLoc.X}, {dataLoc.Y})"
            };

            return(vmRet);
        }
예제 #5
0
        private TileVm MakeTileVm(P2 <int> dataLoc, R <double> imagePatch)
        {
            var offset  = dataLoc.X + dataLoc.Y * (LatticeBounds.MaxX - LatticeBounds.MinX);
            var gpuData = GpuArrayWrite.GetGpuData(offset)[0];
            var vmRet   = new TileVm
            {
                BoundingRect = new R <float>(
                    minX: (float)imagePatch.MinX,
                    maxX: (float)imagePatch.MaxX,
                    minY: (float)imagePatch.MinY,
                    maxY: (float)imagePatch.MaxY
                    ),
                Color = ColorSets.GetLegColor(ColorSets.RedBlueSFLeg, gpuData.Value),
                TextA = $"({gpuData.Block.X}, {gpuData.Block.Y}, {gpuData.Block.Z})",
                TextB = $"",
                TextC = $"({gpuData.Thread.X}, {gpuData.Thread.Y}, {gpuData.Thread.Z})"
            };

            return(vmRet);
        }
예제 #6
0
 public Func <LS2V <int, T>, RV <float, Color> > MakeFilledRectangle()
 {
     if (X1Y1)
     {
         return(v => new RV <float, Color>(
                    minX: v.X2,
                    minY: v.Y2,
                    maxX: v.X2 + 1.0f,
                    maxY: v.Y2 + 1.0f,
                    v: ColorSets.GetLegColor(ColorLeg, v.V)
                    ));
     }
     if (X1X2)
     {
         return(v => new RV <float, Color>(
                    minX: v.Y1,
                    minY: v.Y2,
                    maxX: v.Y1 + 1.0f,
                    maxY: v.Y2 + 1.0f,
                    v: ColorSets.GetLegColor(ColorLeg, v.V)
                    ));
     }
     if (X1Y2)
     {
         return(v => new RV <float, Color>(
                    minX: v.Y1,
                    minY: v.X2,
                    maxX: v.Y1 + 1.0f,
                    maxY: v.X2 + 1.0f,
                    v: ColorSets.GetLegColor(ColorLeg, v.V)
                    ));
     }
     if (Y1X2)
     {
         return(v => new RV <float, Color>(
                    minX: v.X1,
                    minY: v.Y2,
                    maxX: v.X1 + 1.0f,
                    maxY: v.Y2 + 1.0f,
                    v: ColorSets.GetLegColor(ColorLeg, v.V)
                    ));
     }
     if (Y1Y2)
     {
         return(v => new RV <float, Color>(
                    minX: v.X1,
                    minY: v.X2,
                    maxX: v.X1 + 1.0f,
                    maxY: v.X2 + 1.0f,
                    v: ColorSets.GetLegColor(ColorLeg, v.V)
                    ));
     }
     if (X2Y2)
     {
         return(v => new RV <float, Color>(
                    minX: v.X1,
                    minY: v.Y1,
                    maxX: v.X1 + 1.0f,
                    maxY: v.Y1 + 1.0f,
                    v: ColorSets.GetLegColor(ColorLeg, v.V)
                    ));
     }
     throw new Exception("case not handled in FilterByCursor");
 }