fast image operations
bendn 7 months ago
parent be631ac · commit 38966ea
-rw-r--r--Cargo.toml2
-rw-r--r--src/drawing/poly.rs6
-rw-r--r--src/term/sixel.rs4
3 files changed, 6 insertions, 6 deletions
diff --git a/Cargo.toml b/Cargo.toml
index e06a7cd..59e208d 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "fimg"
-version = "0.4.45"
+version = "0.4.46"
authors = ["bend-n <[email protected]>"]
license = "MIT"
edition = "2024"
diff --git a/src/drawing/poly.rs b/src/drawing/poly.rs
index 31632f3..2ef27ed 100644
--- a/src/drawing/poly.rs
+++ b/src/drawing/poly.rs
@@ -1,11 +1,11 @@
//! draw polygons
-use crate::math::{madd, FExt};
+use crate::Image;
+use crate::math::{FExt, madd};
+use array_chunks::*;
use std::cmp::{max, min};
use std::f32::consts::TAU;
use vecto::Vec2;
-use crate::Image;
-
impl<T: AsMut<[u8]> + AsRef<[u8]>, const CHANNELS: usize> Image<T, CHANNELS> {
/// Draws a filled polygon from a slice of points. Please close your poly. (first == last)
///
diff --git a/src/term/sixel.rs b/src/term/sixel.rs
index 608b72b..a1fca2f 100644
--- a/src/term/sixel.rs
+++ b/src/term/sixel.rs
@@ -1,7 +1,7 @@
use core::intrinsics::transmute_unchecked as transmute;
use std::fmt::{Debug, Display, Formatter, Result, Write};
-use crate::{pixels::convert::PFrom, Image};
+use crate::{Image, pixels::convert::PFrom};
use super::Basic;
@@ -117,7 +117,7 @@ impl<T: AsRef<[u8]>, const N: usize> Sixel<T, N> {
let mut last = -1;
for (x, byte) in Grouped(samples, |(_, (x, _))| x).map(|v| {
(
- v[0].1 .0 as i32,
+ v[0].1.0 as i32,
v.iter()
.map(|&(_, (_, y))| (1 << y))
.fold(0, |acc, x| acc | x),