private RGBImage(final int width, final int height, final int type, final PixelSupplier supplier) {
        this.width = width;
        this.height = height;
        this.type = type;

        this.pixelValues = new int[width * height * 3];

        final ErrorHandler errorHandler = new ErrorHandler();
        final ExecutorService service = Executors.newWorkStealingPool();
        for (int y = 0; (y < height) && errorHandler.isClean(); ++y) {
//            for (int x = 0; x < width; ++x) {
//                setPixel(x, y, supplier.supply(x, y));
//            }
            service.execute(new LineWise(y, supplier, errorHandler));
            if (0 == (y % 64)) {
                System.out.print('.');
            }
        }
        try {
            if (errorHandler.isDirty()) {
                service.shutdownNow();
            } else {
                service.shutdown();
            }
            if (!service.awaitTermination(2, TimeUnit.MINUTES)) {
                throw new InterruptedException("timeout occurred");
            }
        } catch (final InterruptedException e) {
            errorHandler.accept(e);
        }
        if (errorHandler.isDirty()) {
            //noinspection ProhibitedExceptionThrown,AccessingNonPublicFieldOfAnotherObject
            throw new Error(errorHandler.caught);
        }
    }