Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

All functions should have single table parameter #148

Open
shrubb opened this issue Aug 17, 2016 · 0 comments
Open

All functions should have single table parameter #148

shrubb opened this issue Aug 17, 2016 · 0 comments

Comments

@shrubb
Copy link
Contributor

shrubb commented Aug 17, 2016

Many single-parameter class setters still have one explicit parameter instead of a table that wraps it. This breaks design uniformity.

Do not want:

function GeneralizedHough:setCannyHighThresh(cannyHighThresh)
    C.GeneralizedHough_setCannyHighThresh(self.ptr, cannyHighThresh)
end

function CLAHE:setClipLimit(clipLimit)
    C.CLAHE_setClipLimit(self.ptr, clipLimit)
end

Do want:

function GeneralizedHough:setCannyHighThresh(t)
    local argRules = {
        {"val", required = true}
    }
    C.GeneralizedHough_setCannyHighThresh(self.ptr, cv.argcheck(t, argRules))
end

function CLAHE:setClipLimit(t)
    local argRules = {
        {"val", required = true}
    }
    C.CLAHE_setClipLimit(self.ptr, cv.argcheck(t, argRules))
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant