private static void processIDATChunks(IHDRChunk ihdrChunk, byte[] decompressedResult)
			throws PNGFormatException {
		int width;
		int height;
		if (ihdrChunk.getInterlaceMethod() == CrushedPNGConstants.ADAM7_INTERLACE) {
			//Msg.debug(this, "Checking Adam7 unpacking");
			int y = 0;
			for (int pass = 0; pass < CrushedPNGConstants.STARTING_COL.length; pass++) {
				width =
					(ihdrChunk.getImgWidth() - CrushedPNGConstants.STARTING_COL[pass] +
						CrushedPNGConstants.COL_INCREMENT[pass] - 1) /
						CrushedPNGConstants.COL_INCREMENT[pass];
				height =
					(ihdrChunk.getImgHeight() - CrushedPNGConstants.STARTING_ROW[pass] +
						CrushedPNGConstants.ROW_INCREMENT[pass] - 1) /
						CrushedPNGConstants.ROW_INCREMENT[pass];

				int row = 0;
				while (row < height) {
					if (decompressedResult[y] > 4) {
						throw new PNGFormatException("Unknown row filter type " +
							decompressedResult[y]);
					}

					//Skip row filter byte
					y++;

					//skip rest of row
					y += width * ihdrChunk.getBytesPerPalette();
					row++;
				}
			}

			y = 0;
			for (int pass = 0; pass < CrushedPNGConstants.STARTING_COL.length; pass++) {

				//Formula taken from pngcheck
				width =
					(ihdrChunk.getImgWidth() - CrushedPNGConstants.STARTING_COL[pass] +
						CrushedPNGConstants.COL_INCREMENT[pass] - 1) /
						CrushedPNGConstants.COL_INCREMENT[pass];
				height =
					(ihdrChunk.getImgHeight() - CrushedPNGConstants.STARTING_ROW[pass] +
						CrushedPNGConstants.ROW_INCREMENT[pass] - 1) /
						CrushedPNGConstants.ROW_INCREMENT[pass];

				int startAt = y;
				int row = 0;
				while (row < height) {

					//skip row filter byte
					y++;

					//Swap all bytes in this row
					int x = 0;
					while (x < width) {
						byte tmpByte = decompressedResult[y + 2];
						decompressedResult[y + 2] = decompressedResult[y];
						decompressedResult[y] = tmpByte;
						y += ihdrChunk.getBytesPerPalette();
						x++;
					}
					row++;
				}

				//RGBA
				if (ihdrChunk.getColorType() == 6) {
					removeRowFilters(width, height, decompressedResult, startAt);
					demultiplyAlpha(width, height, decompressedResult, startAt);
					applyRowFilters(width, height, decompressedResult, startAt);
				}
			}
		}
		else {

			//check row filters
			int y = 0;
			while (y < (ihdrChunk.getBytesPerLine() * ihdrChunk.getImgHeight() + ihdrChunk.getRowFilterBytes())) {
				if (decompressedResult[y] > 4) {
					throw new PNGFormatException("Unkown row filter type " + decompressedResult[y]);
				}

				//skip row filter byte
				y++;

				//skip entire row
				y += ihdrChunk.getBytesPerLine();
			}
			y = 0;
			while (y < (ihdrChunk.getBytesPerLine() * ihdrChunk.getImgHeight() + ihdrChunk.getRowFilterBytes())) {

				//skip row filter byte
				y++;

				//swap all bytes in this row
				int x = 0;
				while (x < ihdrChunk.getImgWidth()) {
					byte tmpByte = decompressedResult[y + 2];
					decompressedResult[y + 2] = decompressedResult[y];
					decompressedResult[y] = tmpByte;
					y += ihdrChunk.getBytesPerPalette();
					x++;
				}
			}
			if (ihdrChunk.getColorType() == 6) { //RGBA
				removeRowFilters(ihdrChunk.getImgWidth(), ihdrChunk.getImgHeight(),
					decompressedResult, 0);
				demultiplyAlpha(ihdrChunk.getImgWidth(), ihdrChunk.getImgHeight(),
					decompressedResult, 0);
				applyRowFilters(ihdrChunk.getImgWidth(), ihdrChunk.getImgHeight(),
					decompressedResult, 0);
			}
		}

	}
Does the processing to uncrushify the PNG IDAT chunks
@param ihdrChunk the IHDR chunk to pull meta deta from
@param decompressedResult result of the zlib decompression
@throws PNGFormatException
Ghidra/Features/FileFormats/src/main/java/ghidra/file/formats/ios/png/CrushedPNGUtil.java