lua -> how to modify these arguments to be const, or what should I do?
snippet in lua

lua -> how to modify these arguments to be const, or what should I do?

user9208

createNew_keepOld = function (oldImgData, oldImgDraw)
    local newImgData = oldImgData:clone()

    for x = 0, newImgData:getWidth()-1 do
        for y = 0, newImgData:getHeight()-1 do
            local r, g, b, a = newImgData:getPixel(x, y)
            r = 2*r
            g = 2*g
            b = 0.5*b
            a = 2*a
            newImgData:setPixel(x, y, r, g, b, a)
        end
    end

    local newImgDraw = love.graphics.newImage(newImgData, oldImgDraw:getFlags())

    return newImgData, newImgDraw
end