public static unsafe Int32 Count(this UnmanagedImage<TPixel> src, PredicateOnPixel handler)
 {
     TPixel* start = (TPixel*)src.StartIntPtr;
     TPixel* end = start + src.Length;
     Int32 count = 0;
     while (start != end)
     {
         if (handler(start) == true) count++;
         ++start;
     }
     return count;
 }
Exemplo n.º 2
0
        public unsafe static Int32 Count(this UnmanagedImage <TPixel> src, PredicateOnPixel handler)
        {
            TPixel *start = (TPixel *)src.StartIntPtr;
            TPixel *end   = start + src.Length;
            Int32   count = 0;

            while (start != end)
            {
                if (handler(start) == true)
                {
                    count++;
                }
                ++start;
            }
            return(count);
        }
Exemplo n.º 3
0
        public unsafe static List <TPixel> Where(this UnmanagedImage <TPixel> src, PredicateOnPixel handler)
        {
            List <TPixel> list = new List <TPixel>();

            TPixel *start = (TPixel *)src.StartIntPtr;
            TPixel *end   = start + src.Length;

            while (start != end)
            {
                if (handler(start) == true)
                {
                    list.Add(*start);
                }
                ++start;
            }

            return(list);
        }
        public static unsafe List<TPixel> Where(this UnmanagedImage<TPixel> src, PredicateOnPixel handler)
        {
            List<TPixel> list = new List<TPixel>();

            TPixel* start = (TPixel*)src.StartIntPtr;
            TPixel* end = start + src.Length;
            while (start != end)
            {
                if (handler(start) == true) list.Add(*start);
                ++start;
            }

            return list;
        }