Skip to content

a FPGA based pixel art drawing platform 基于FPGA的像素画绘制平台

License

Notifications You must be signed in to change notification settings

longfish-sama/pixel-art-drawing

Repository files navigation

pixel-art-drawing

a FPGA based pixel art drawing platform

一个基于FPGA系统的像素画绘制平台

start up

  • 开发板平台:ALINX AX4010 with Cyclone IV EP4CE10F17C8N

  • PS/2键盘输入,VGA/HDMI均可输出显示

system structure

  1. ps/2 keyboard read & decode: decode key up, down, left, right, space and more

  2. color select: press key space to choose color

  3. coordinate pointer: indicate the active area

  4. draw control & storage: use key up, down, left, right to select the area, press key space to paint it

  5. LED digital display: display the pointer location and the current color No.

  6. contral infomation buffer: for clock domain crossing problem

  7. generate VGA signal (in RGB888): raw image signal ready to display on the screen

  8. VGA signal out: RGB888 to RGB565

  9. DVI (HDMI) signal out: TMDS encode

    1--> 2

     --> 3

     --> 4

    2--> 5

     --> 6

    3--> 5

     --> 6

    4--> 7

    6--> 7

    7--> 8

     --> 9

    prototype design

    UI layout design

    see prototype/layout-Model.png

    layout-img

    HTML based prototype

    see prototype/html/page_1.html

    html-img

    系统功能

    1. 网格显示

      在绘制区域显示辅助网格,使用 G 开启或者关闭网格显示

      • 网格颜色由 vga_signal_gen.vhd: constant color_grid_r, constant color_grid_g, constant color_grid_b [here] 定义
      • 网格线宽由 vga_signal_gen.vhd: signal line_w [here] 定义,在 vga_signal_gen.vhd: line_w_ctrl [here] 进程中控制线宽大小以实现开启或者关闭网格显示功能
    2. 光标显示

      在当前活动区域显示红色矩形光标

      • 光标颜色由 vga_signal_gen.vhd: constant color_sel_r, constant color_sel_g, constant color_sel_b [here] 定义
      • 光标相对大小于 vga_signal_gen.vhd: img_gen [here] 进程中控制
    3. 光标位置控制

      使用 UP ARROW, DOWN ARROW, LEFT ARROW, RIGHT ARROW 控制光标每次移动1格,使用 W, A, S, D 控制光标每次移动5格

      • 光标行为于 pointer.vhd: point [here] 进程中控制
    4. 颜色选择

      当活动区域位于颜色选择区域时,使用 SPACE 或 B 指定当前光标下颜色为画笔颜色(前景色),使用 E 指定当前光标下颜色为橡皮擦颜色(背景色)

      • 颜色选择行为于 color_ctrl.vhd: color_sel [here]进程中控制
    5. 绘制

      当活动区域位于绘制区域时,使用 B 选择使用画笔(前景色),使用 E 选择使用橡皮擦(背景色),使用 SPACE 向当前光标下区域绘制颜色,使用 CTRL + D (其中 CTRL 为粘滞键模式)用当前颜色覆写整个绘制区域

      • 绘制行为于 img_ctrl.vhd: img_ctrl [here] 进程中控制
    6. 绘制信息保存(未实现)

    7. 绘制信息加载(未实现)

    Reference

About

a FPGA based pixel art drawing platform 基于FPGA的像素画绘制平台

Topics

Resources

License

Stars

Watchers

Forks