renderResult(code, width /*int*/, height /*int*/, quietZone /*int*/) {
			const input = code.getMatrix();
			if (input === null) {
				throw new IllegalStateException();
			}
			const inputWidth = input.getWidth();
			const inputHeight = input.getHeight();
			const qrWidth = inputWidth + (quietZone * 2);
			const qrHeight = inputHeight + (quietZone * 2);
			const outputWidth = Math.max(width, qrWidth);
			const outputHeight = Math.max(height, qrHeight);
			const multiple = Math.min(Math.floor(outputWidth / qrWidth), Math.floor(outputHeight / qrHeight));
			// Padding includes both the quiet zone and the extra white pixels to accommodate the requested
			// dimensions. For example, if input is 25x25 the QR will be 33x33 including the quiet zone.
			// If the requested size is 200x160, the multiple will be 4, for a QR of 132x132. These will
			// handle all the padding from 100x100 (the actual QR) up to 200x160.
			const leftPadding = Math.floor((outputWidth - (inputWidth * multiple)) / 2);
			const topPadding = Math.floor((outputHeight - (inputHeight * multiple)) / 2);
			const svgElement = this.createSVGElement(outputWidth, outputHeight);
			for (let inputY = 0, outputY = topPadding; inputY < inputHeight; inputY++, outputY += multiple) {
				// Write the contents of this row of the barcode
				for (let inputX = 0, outputX = leftPadding; inputX < inputWidth; inputX++, outputX += multiple) {
					if (input.get(inputX, inputY) === 1) {
						const svgRectElement = this.createSvgRectElement(outputX, outputY, multiple, multiple);
						svgElement.appendChild(svgRectElement);
					}
				}
			}
			return svgElement;
		}
Note that the input matrix uses 0 == white, 1 == black.
The output matrix uses 0 == black, 255 == white (i.e. an 8 bit greyscale bitmap).