-
Notifications
You must be signed in to change notification settings - Fork 17
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
Thickness and In Bounds check - keyword args #31
Open
Codyk12
wants to merge
16
commits into
JuliaImages:master
Choose a base branch
from
Codyk12:thickness
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
16 commits
Select commit
Hold shift + click to select a range
502d6a5
Added checkbounds() testing to all draw!() functions as to not throw …
Codyk12 40bda80
Changed Test Files to no longer check for Exception thrown for drawin…
Codyk12 de36083
Fixed spacing and deleted unnecessary code
Codyk12 d90b811
Merge remote-tracking branch 'upstream/master'
Codyk12 d84042d
Fix
Codyk12 108996c
Added ability to draw lines with thickness
Codyk12 f0b0b3b
Updated Version Number
Codyk12 8b2c592
Made in bounds and thickness into keyword args
Codyk12 ff5c7f9
Added keywords to multi drawable function
Codyk12 9e936c9
thickness changed to Union{Integer,Nothing}. Changed multiple object …
Codyk12 3c0b12e
Added thickness and in_bounds keyargs to draw() function. Fixed thick…
Codyk12 2a898cb
Adjusted default for in_bounds and thickness.
Codyk12 dc607a3
draw function more flexible without keyword args
Codyk12 33aebc7
Added thickness and in_bounds tests. Made draw logic more clear
Codyk12 f5cac40
Indent fix
Codyk12 2b9cb4f
Thickness algorithm takes care of thickness=1
Codyk12 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,15 +1,15 @@ | ||
""" | ||
cross = Cross(c, arm::Int) | ||
cross = Cross(c, arm::Int, color; in_bounds, thickness)) | ||
A `Drawable` cross passing through the point `c` with arms that are `arm` pixels long. | ||
""" | ||
Cross(c, arm::Int) = Cross(c, -arm:arm) | ||
|
||
function draw!(img::AbstractArray{T, 2}, cross::Cross, color::T) where T<:Colorant | ||
function draw!(img::AbstractArray{T, 2}, cross::Cross, color::T; in_bounds::Bool=false, thickness::Union{Integer, Nothing}=nothing) where T<:Colorant | ||
for Δx in cross.range | ||
drawifinbounds!(img, cross.c.y, cross.c.x + Δx, color) | ||
draw!(img, cross.c.y, cross.c.x + Δx, color, in_bounds=in_bounds, thickness=thickness) | ||
end | ||
for Δy in cross.range | ||
drawifinbounds!(img, cross.c.y + Δy, cross.c.x, color) | ||
draw!(img, cross.c.y + Δy, cross.c.x, color, in_bounds=in_bounds, thickness=thickness) | ||
end | ||
img | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What's the usage of this? I can't find anywhere this struct is used in your PR.