Skip to content

Add a cross #24

@yakir12

Description

@yakir12

I often need to mark something in the image without obscuring it so much. A cross does exactly that.

I'll therefor try to PR something like this:

struct Cross <: Drawable
    c::Point
    arm::Int
end

function draw!(img::AbstractArray{T, 2}, cross::Cross, color::T) where T<:Colorant
    for x in -cross.arm:cross.arm
        img[cross.c.y, cross.c.x + x] = color
    end
    for y in -cross.arm:cross.arm
        img[cross.c.y + y, cross.c.x] = color
    end
    img
end

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions