docs: private void CalculateMap(IntRange inRange, IntRange outRange, int[] map) {
          double k = 0, b = 0;
  
          if (inRange.getMax() != inRange.getMin()) {
              k = (double) (outRange.getMax() - outRange.getMin()) / (double) (inRange.getMax() - inRange.getMin());
              b = (double) (outRange.getMin()) - k * inRange.getMin();
          }
  
          for (int i = 0; i < 256; i++) {
              int v = (int) i;
  
              if (v >= inRange.getMax())
                  v = outRange.getMax();
              else if (v <= inRange.getMin())
                  v = outRange.getMin();
              else
                  v = (int) (k * v + b);
  
              map[i] = v;
          }
      }