Esempio n. 1
0
 public virtual Func <Tr> PixStack(PixStack ps, Func <Tr>[] subArray)
 {
     return(() =>
     {
         var typedOther = Other as PixStack;
         if (typedOther == null)
         {
             throw new ArgumentException();
         }
         var length = subArray.Length;
         if (length != typedOther.PixArray.Length)
         {
             throw new ArgumentException();
         }
         var result = ProductOp.PixStack(ps, typedOther,
                                         subArray.ProductArray(typedOther.PixArray, length,
                                                               (fp0, p1) => { Other = p1; return fp0(); }));
         Other = typedOther;
         return result;
     });
 }
Esempio n. 2
0
 public Func <PixImage[]> PixStack(PixStack ps, Func <PixImage[]>[] subArray)
 {
     return(() => { ++Level; var subImages = subArray.Map(f => f()); --Level; return subImages.FlatCopy(); });
 }
Esempio n. 3
0
 public virtual int PixStack(PixStack is0, PixStack is1, int[] subArray)
 {
     return(subArray.Sum());
 }
Esempio n. 4
0
 public int PixStack(PixStack ps, int[] subArray)
 {
     return(subArray.Sum());
 }
Esempio n. 5
0
 public bool PixStack(PixStack ps0, PixStack ps1, bool[] subArray)
 {
     return(subArray.FoldLeft(true, (s, b) => s && b));
 }
Esempio n. 6
0
 public virtual IPix PixStack(PixStack ps, params IPix[] subArray)
 {
     return(subArray.AllEqual(ps.PixArray, (a, b) => a == b)
                     ? ps : new PixStack(subArray));
 }