protected byte GetGreyscaleLevel(int x, int y) { if (!_cache.IsCached(x, y)) { _cache.Update(x, y, _shape.GetValue(x, y).Red); } return(_cache.level); }
/// <summary> /// Get greyscale level. /// </summary> /// <param name="x">X.</param> /// <param name="y">Y.</param> /// <returns>Value.</returns> protected byte GetGreyscaleLevel(int x, int y) { // Is this position is stored in cache ? if (!Cache.IsCached(x, y)) { // Assuming controlColor is a greyscale value // just test the red channel Cache.Update(x, y, PShape.GetValue(x, y).Red); } return(Cache.Level); }