/**
 * Given an image and an exposure change value, this function adjusts the exposure of the image.
 *
 * @param image A list of pixel values representing the image.
 * @param exposureChange The amount of exposure to change. Positive values increase exposure, negative values decrease exposure.
 * @return The list of pixel values representing the adjusted image.
 */
fun changeExposure(image: List<List<Int>>, exposureChange: Float): List<List<Int>> {

    val adjustedImage = mutableListOf<List<Int>>()

    for (pixel in image) {
        val adjustedPixel = mutableListOf<Int>()

        for (channel in pixel) {
            var adjustedChannel = (channel * exposureChange).toInt()  // Adjust the channel according to the exposure change
            adjustedChannel = adjustedChannel.coerceIn(0, 255)  // Clamp the channel value between 0 and 255
            adjustedPixel.add(adjustedChannel)
        }

        adjustedImage.add(adjustedPixel)
    }

    return adjustedImage
}
/**
 * Given an image and an exposure change value, this function adjusts the exposure of the image.
 *
 * @param image A list of pixel values representing the image.
 * @param exposureChange The amount of exposure to change. Positive values increase exposure, negative values decrease exposure.
 * @return The list of pixel values representing the adjusted image.
 */
fun changeExposure(image: List<List<Int>>, exposureChange: Float): List<List<Int>> {
/**
 * Given an image and an exposure change value, this function adjusts the exposure of the image.
 *
 * @param image A list of pixel values representing the image.
 * @param exposureChange The amount of exposure to change. Positive values increase exposure, negative values decrease exposure.
 * @return The list of pixel values representing the adjusted image.
 */
fun changeExposure(image: List<List<Int>>, exposureChange: Float): List<List<Int>> {

    val adjustedImage = mutableListOf<List<Int>>()

    for (pixel in image) {
        val adjustedPixel = mutableListOf<Int>()

        for (channel in pixel) {
            var adjustedChannel = (channel * exposureChange).toInt()  // Adjust the channel according to the exposure change
            adjustedChannel = adjustedChannel.coerceIn(0, 255)  // Clamp the channel value between 0 and 255
            adjustedPixel.add(adjustedChannel)
        }

        adjustedImage.add(adjustedPixel)
    }

    return adjustedImage
}