GithubHelp home page GithubHelp logo

dove6 / rgb-triangle-generator-x86-64 Goto Github PK

View Code? Open in Web Editor NEW
1.0 1.0 0.0 231 KB

Hybrid C/assembly triangle drawing tool (x86-64 edition)

License: MIT License

Makefile 1.30% Assembly 16.38% C 82.32%

rgb-triangle-generator-x86-64's Introduction

RGB triangle generator (hybrid x86-64)

Mini-project for exploring x86-64 assembly language.

The program provides an interactive console line interface for drawing colorful triangles on RGB24 pixelmap and saving it to file.
By default, program runs in non-interactive mode drawing the testing set of triangles and exiting. Interactive mode can be entered by supplying --interactive program argument.
Pixelmap dimensions and output file name can be specified as program's arguments. Triangle's color and position are to be supplied using the CLI (draw command). Additionally, output file name can be supplied in the same manner (as an argument to save command).
In order to determine boundaries of the triangle and correctly mix colors, linear interpolation is used:
Linear interpolation principles

Non-interactive program execution should result in the following image:
Output image obtained as the result of execution of rgb_triangle_test.txt commands

The project was carried out as an assignment for CPU architecture-related subject.
Make sure to check out its other incarnations: MIPS-32 version, x86/C version.

Building

The tool can be easily built using make. It requires GCC (MinGW on Windows) compiler and NASM assembler.

Usage

SSE2 instruction support is needed in order to successfully run the program.
For starting the program use:
rgb_triangle [--interactive] [output_filename [bitmap_width bitmap_height]]
where output_filename specifies the default output file and bitmap_width and bitmap_height defines the bitmap dimensions.
By using --interactive switch you can enter the interactive mode where the following internal CLI instructions are supported:

Instruction Arguments Description
help - shows help message
draw x y color x y color x y color draws a triangle
clear [color] fills the bitmap using a color (default: #ffffff)
save [filename] saves the bitmap to a file (default: specified as program argument)
kill - exits the program without saving the bitmap
quit - exits the program saving the bitmap to the default file

color can be provided as #rrggbb hex value or rrr ggg bbb decimal value set.

rgb-triangle-generator-x86-64's People

Contributors

dove6 avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.