Coder Social home page Coder Social logo

img2hack's Introduction

img2hack example workflow

This project is a small desktop program that converts image files to Hack assembly files. The assembly file is to be run on a Hack simulator/computer, where the code will output the original image to its screen. For more information on the Hack computer, take a look at nand2tetris.

Since the Hack screen has only two possible values for each pixel, it can basically output binary images to it. So once you load an image to img2hack, the program will give you the possibility to fine-tune the conversion from non-binary to binary image over a graphical user interface.

Watch this video to see img2hack in action! ๐Ÿ“บ

...and if you want to assemble the generated code into a Hack binary you can also use my assembler.

Building img2hack from source

The following list enumerates the tools and dependencies' minimum requirements:

  • C++11 compiler
  • CMake 3.2
  • Magick++ 7.0
  • Qt5 Widgets

Configuring and Compiling

Run cmake to configure the native tools (preferably an out of source configuration) and then run the build. Here is an example in Linux:

img2hack$ mkdir build
img2hack$ cd build
img2hack/build$ cmake ..
img2hack/build$ cmake --build .

img2hack's People

Contributors

benvenutti avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar

img2hack's Issues

Enable drag image around canvas

When an image bigger than 512 x 256 (the Hack screen size) is loaded, the image is trimmed to these dimensions and it snaps to reference position p(0, 0). This feature aims to enable the user to drag the image around the canvas in such a way that he/she can position the image at will before generating the assembly code.

  • update cursor icon when the image can be dragged
  • maybe show offset information

Update README

Update README file with proper markdown syntax and styling:

  • add GPL license badge
  • Travis CI build status badge
  • add information regarding building the project
  • dependencies list

Create CMake project

Create a (modern) CMake project for img2hack and drop everything related to QtCreator IDE. An initial monolithic approach is fine for now.

Add multi language support

Right now the application is all in English. Add support to Portuguese (and German? ...hm, warum nicht?).

Create Travis CI project

Create a CI project with the following minimal configuration:

  • Linux: clang and gcc
  • OSX: clang (xcode)

This depends on #1.

Optimize size of assembly output

What could be done to optimize the size of the assembly output? Remember, the hack machine has a pretty restricted memory size...

Separate img2hack from GUI

Separate the project into modules:

  • img2hack: module to transform images into hack assembly
  • app: holds the GUI executable that depends/uses img2hack

The main concern here is to make sure img2hack is completely independent of the GUI.

GUI images and icons are not displayed

The images and icons of the GUI are not being displayed. Probably the resources must be included in the CMake project using qt5_add_resources (more info here).

This issue started after #1.

Redesign GUI

Refactor/redesign the GUI, making sure it looks nice on OSX and Linux (and in the future, Windows?).

This should be done after #5 and #6.

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.