Skip to content

ドットアニメーションに特化したラスタ画像軽量マークアップ言語

License

Notifications You must be signed in to change notification settings

Ablaze-MIRAI/pixdown

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

20 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pixdown

ドットアニメーションに特化したラスタ画像軽量マークアップ言語

Crates.io Version

How to write

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

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

ヘッダー

[size]
w = 2 #
h = 2 # 高さ
scale = 256 # 拡大(縦, 横ともにscale倍)
frames = 8 # フレームの数
rate = [1, 4] # フレーム間隔 ([0]/[1] s)

[colors] # 色の定義
"0" = "#000000"
"1" = "#ffffff"

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

内容

# 0
## 0
10
01

## 1
01
10

#: レイヤー番号

##: フレーム番号

出力画像

出力画像

サンプル

サンプル

ソースコード

How to use

Rust project

Install

cargo add pixdown

Use

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

fn main() {
    let text = read_to_string("example.pixdown").unwrap();
    if let Ok(b) = compile(&text) {
        let mut file = File::create("image.png").unwrap();
        file.write_all(&b).unwrap();
        file.flush().unwrap();
    }
}

Demo

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

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

Donation

僕に寄付するくらいなら僕の曲聴いてほしい

License

BRONSEELE-WARE LICENSEで公開しています

About

ドットアニメーションに特化したラスタ画像軽量マークアップ言語

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Sponsor this project

 

Packages

No packages published

Languages