@Test public void executeTest_equalSize() { BufferedImage img1 = BufferedImageHelper.createSolidImage(new Color(0, 0, 0)); BufferedImage img2 = BufferedImageHelper.createSolidImage(new Color(0, 0, 0)); ScaleToNearestFactorPreprocessor pp = new ScaleToNearestFactorPreprocessor(img1, img2, 500); pp.process(); Assert.assertEquals(img1, pp.getResult1()); Assert.assertEquals(img2, pp.getResult2()); }
@Override public void process() { if (widthFactor1 < THRESHOLD || heightFactor1 < THRESHOLD || widthFactor2 < THRESHOLD || heightFactor2 < THRESHOLD) { LOGGER.info("Scaling image with factors [{}], [{}]", widthFactor1, heightFactor1); super.process(); } else { LOGGER.info("All scale factors [{}], [{}], [{}], [{}] are above threshold [{}]", widthFactor1, heightFactor1, widthFactor2, heightFactor2, THRESHOLD); result1 = img1; result2 = img2; } }
ScaleToNearestFactorPreprocessor extends ScalePreprocessor { @Override public void process() { if (widthFactor1 < THRESHOLD || heightFactor1 < THRESHOLD || widthFactor2 < THRESHOLD || heightFactor2 < THRESHOLD) { LOGGER.info("Scaling image with factors [{}], [{}]", widthFactor1, heightFactor1); super.process(); } else { LOGGER.info("All scale factors [{}], [{}], [{}], [{}] are above threshold [{}]", widthFactor1, heightFactor1, widthFactor2, heightFactor2, THRESHOLD); result1 = img1; result2 = img2; } } }
ScaleToNearestFactorPreprocessor extends ScalePreprocessor { @Override public void process() { if (widthFactor1 < THRESHOLD || heightFactor1 < THRESHOLD || widthFactor2 < THRESHOLD || heightFactor2 < THRESHOLD) { LOGGER.info("Scaling image with factors [{}], [{}]", widthFactor1, heightFactor1); super.process(); } else { LOGGER.info("All scale factors [{}], [{}], [{}], [{}] are above threshold [{}]", widthFactor1, heightFactor1, widthFactor2, heightFactor2, THRESHOLD); result1 = img1; result2 = img2; } } ScaleToNearestFactorPreprocessor(final BufferedImage img1, final BufferedImage img2, int targetSize); }
ScaleToNearestFactorPreprocessor extends ScalePreprocessor { @Override public void process() { if (widthFactor1 < THRESHOLD || heightFactor1 < THRESHOLD || widthFactor2 < THRESHOLD || heightFactor2 < THRESHOLD) { LOGGER.info("Scaling image with factors [{}], [{}]", widthFactor1, heightFactor1); super.process(); } else { LOGGER.info("All scale factors [{}], [{}], [{}], [{}] are above threshold [{}]", widthFactor1, heightFactor1, widthFactor2, heightFactor2, THRESHOLD); result1 = img1; result2 = img2; } } ScaleToNearestFactorPreprocessor(final BufferedImage img1, final BufferedImage img2, int targetSize); @Override void process(); }
ScaleToNearestFactorPreprocessor extends ScalePreprocessor { @Override public void process() { if (widthFactor1 < THRESHOLD || heightFactor1 < THRESHOLD || widthFactor2 < THRESHOLD || heightFactor2 < THRESHOLD) { LOGGER.info("Scaling image with factors [{}], [{}]", widthFactor1, heightFactor1); super.process(); } else { LOGGER.info("All scale factors [{}], [{}], [{}], [{}] are above threshold [{}]", widthFactor1, heightFactor1, widthFactor2, heightFactor2, THRESHOLD); result1 = img1; result2 = img2; } } ScaleToNearestFactorPreprocessor(final BufferedImage img1, final BufferedImage img2, int targetSize); @Override void process();  }