import java.awt.image.BufferedImage
import java.io.File
import javax.imageio.ImageIO

internal class ArrayData(val dataArray: IntArray, val width: Int, val height: Int) {

    constructor(width: Int, height: Int) : this(IntArray(width * height), width, height)

    operator fun get(x: Int, y: Int) = dataArray[y * width + x]

    operator fun set(x: Int, y: Int, value: Int) {
        dataArray[y * width + x] = value
    }

    operator fun invoke(thetaAxisSize: Int, rAxisSize: Int, minContrast: Int): ArrayData {
        val maxRadius = Math.ceil(Math.hypot(width.toDouble(), height.toDouble())).toInt()
        val halfRAxisSize = rAxisSize.ushr(1)
        val outputData = ArrayData(thetaAxisSize, rAxisSize)