gulesh / canvas-drawer

Implements a simple drawing api

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

canvas-drawer

Implements a simple drawing api

TODO: Add a representative image for your project here

How to build

Windows

Open git bash to the directory containing this repository.

canvas-drawer $ mkdir build
canvas-drawer $ cd build
canvas-drawer/build $ cmake -G "Visual Studio 16 2019" ..
canvas-drawer/build $ start Draw-2D.sln

Your solution file should contain two projects: pixmap_art and pixmap_test. To run from the git bash command shell,

canvas-drawer/build $ ../bin/Debug/draw_test
canvas-drawer/build $ ../bin/Debug/draw_art

macOS

Open terminal to the directory containing this repository.

canvas-drawer $ mkdir build
canvas-drawer $ cd build
canvas-drawer/build $ cmake ..
canvas-drawer/build $ make

To run each program from build, you would type

canvas-drawer/build $ ../bin/draw_test
canvas-drawer/build $ ../bin/draw_art

Supported primitives

  1. Lines
  2. Triangles
  3. Circle
  4. Rectangles
  5. Star
  6. Curve (these are modification for circle like roses)
  7. Point

Filters Implemented

  1. drwaing different shapes like rectangle, circle, star, and flowers
  2. draw lines with width
  3. Point Primitive
  4. Support Filled and outlined Shapes

Future implementation

  1. Support different blend modes, such as add, difference, and multiply
  2. make it easy for users to specify gradients
  3. Support alpha blending

Results

TODO: Show artworks using your class

  1. Lines draw (Simple)

diagonal-line-2 diagonal-line-1 h-lessthan-w-line-1 h-lessthan-w-line-2 horizontal-line vertical-line w-lessthan-h-line-1 w-lessthan-h-line-2

  1. Lines with Interpolation

line-color-interpolation with-interpolation-lessthan-h-line-1 with-interpolation-w-lessthan-h-line-2 with-interpolation-h-lessthan-w-line-1 with-interpolation-h-lessthan-w-line-2 with-interpolation-w-lessthan-h-line-2 vertical-with-interpolation-line

  1. Lines with Width

vertical-with-width-line with-width-diagonal-line-2 with-width-h-lessthan-w-line-1 with-width-h-lessthan-w-line-2 with-width-horizontal-line with-width-w-lessthan-h-line-2

  1. Triangles with interpolation

triangle-interpolation two sideways triangle

4.Triangle Outlined

outlined unfilled-triangle

  1. Rectangle Filled

rectangle-color-interpolation rectangle-filled-interpolation

  1. Rectangle Outlined

rectangle-unfilled-interpolation

  1. Circle Filled

circle-color-interpolation

  1. Circle Outlined

circle-unfilled

  1. Star Filled

star-draw

  1. Star UnFilled

unfilled-star-draw

  1. curves filled

curves-color-interpolation curves-k-2 7-interpolation

  1. Curve Outlined

curves-unfilled-interpolation

  1. Point Primitive

points-draw

##Unique Images

  1. I first drew Interpolated vertical lines. Then, on top of that, I drew a circle in the middle , on top of circle I drew a outlined star, and outlined it with rectangles of varying widths.

drawing-rectangles-circles

2.For this one, I created four isosceles tringles with their tip sharing one point. Then I randomly created many copies of the same image.

spiral-using-triangles

  1. Finally, For this last image, I created both horizontal and vertical interpolated lines. On top of this background I drew a curve in the middle of a square. Then I created multiple copies of the same image.

mixFilters

About

Implements a simple drawing api

License:MIT License


Languages

Language:C++ 96.5%Language:CMake 3.0%Language:C 0.5%