Skip to content

Ablaze-MIRAI/micro-pixdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

microPixdown

ドットアニメーションに特化したラスタ画像軽量マークアップ言語のマイコンLED向けエディション

Crates.io Version

How to write

microPixdownのデータ構造はヘッダーと内容の2つに分けられます

---
(ヘッダ部分)
---
(内容)

ヘッダー

mix = "!(0 ^ 1)" # 論理式でレイヤー合成を書く

[size]
w = 2 #
h = 2 # 高さ
frames = 8 # フレームの数
rate = [1, 4] # フレーム間隔 ([0]/[1] s)

[binaries] # 点灯/消灯の定義
"0" = false
"1" = true

[options] # オプション(なくてもよい)
order = [1, 0, 1, 0, 0, 1, 0, 0] # 順序指定

内容

# 0
10
01

# 1
## 0
10
01

## 1
01
10

#: レイヤー番号

##: フレーム番号

出力結果(整形済み)

{
  "width": 2,
  "height": 2,
  "rate": [1, 4],
  "frames": [
    [
      [false, false],
      [false, false]
    ],
    [
      [true, true],
      [true, true]
    ],
    [
      [false, false],
      [false, false]
    ],
    [
      [true, true],
      [true, true]
    ],
    [
      [true, true],
      [true, true]
    ],
    [
      [false, false],
      [false, false]
    ],
    [
      [true, true],
      [true, true]
    ],
    [
      [true, true],
      [true, true]
    ]
  ]
}

How to use

Rust project

Install

cargo add micro-pixdown

Use

use micro_pixdown::compile;
use std::fs::{File, read_to_string};
use std::io::Write;

fn main() {
    let text = read_to_string("example.mpxd").unwrap();
    let b = compile(&text) {
    let mut file = File::create("example.json").unwrap();
    file.write_all(b.as_bytes()).unwrap();
    file.flush().unwrap();
}

Demo

リファレンス実装が動かせます

cargo run -- [Pixdownファイル] [出力先]

Donation

私に寄付するくらいなら私のファンアートを描くか私の曲を聴くかしてください

それでも寄付したい人はAblazeに寄付してあげてください

License

Rion Hobby License (ほぼISC)で公開しています

About

ドットアニメーションに特化したラスタ画像軽量マークアップ言語PixdownのマイコンLED向けエディション

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors