functional BMP reader / writer

This commit is contained in:
Ponj 2024-06-24 00:09:16 +02:00
parent f4910dba19
commit b0bcaa43ce
Signed by: p6nj
GPG key ID: CEAB625B75A836B2
5 changed files with 29 additions and 2 deletions

1
.gitignore vendored
View file

@ -1,2 +1,3 @@
/target /target
*.lock *.lock
bmp/out.bmp

View file

@ -1,6 +1,6 @@
[workspace] [workspace]
resolver = "2" resolver = "2"
members = ["bent", "bingus", "bong"] members = ["bent", "bent-funny-zone", "bingus", "bong"]
package.edition = "2021" package.edition = "2021"
package.license = "Unlicense" package.license = "Unlicense"
package.description = "databending made easy" package.description = "databending made easy"

View file

@ -0,0 +1,16 @@
[package]
name = "bent-funny-zone"
version = "0.1.0"
edition.workspace = true
license.workspace = true
description.workspace = true
authors.workspace = true
repository.workspace = true
keywords.workspace = true
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
anyhow = "1.0.86"
bmp = "0.5.0"
synfx-dsp = "0.5.6"

View file

@ -0,0 +1,10 @@
use std::fs::File;
use anyhow::Result;
use bmp::open;
fn main() -> Result<()> {
let bmp = open("bmp/sample_640×426.bmp")?;
bmp.to_writer(&mut File::create("bmp/out.bmp")?)?;
Ok(())
}

BIN
bmp/sample_640×426.bmp Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 799 KiB