1 Star 1 Fork 1

shirne / buffer_image

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
README.zh_CN.md 1.71 KB
一键复制 编辑 原始数据 按行查看 历史
shirne 提交于 2022-09-14 00:35 . 0.3.10

buffer_image

pub package

用于编辑及显示原始像素格式(rgba)图片的库.

效果预览

完整代码参考example

// 生成ImageProvider
BufferImage bufferImage = BufferImage(100, 100);
for (int i = 0; i < 100; i++) {
    for (int j = 0; j < 100; j++) {
    bufferImage.setColor(
        i, j, Colors.primaries[(i * 100 + j) % Colors.primaries.length]);
    }
}
image = RgbaImage.fromBufferImage(bufferImage, scale: 1);
bufferImage.resize(2);
scaleImage = RgbaImage.fromBufferImage(bufferImage, scale: 1);


// 显示Image
Center(
    child: Column(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children: <Widget>[
        Image(
            image: image,
        ),
        Image(
            image: scaleImage,
        ),
        ],
    ),
)

预览图

功能

  • ✅ 处理原始图像格式的类(像素设置,图片缩放)
  • ✅ 处理图片显示的provider
  • ✅ 图片缩放的插值算法 (实现了邻近算法和二次插值)
  • ✅ 颜色,帖图混合模式
  • ✅ 旋转图像(还需要增加抗锯齿算法)
  • ✅ 画方块 画图像
  • ✅ 路径裁剪 画路径
  • ✅ 灰度图 以及 多种灰度算法
  • 🚧 ImageProvider 优化
  • 🚧 更多图像编辑方法

Flutter

This project is a starting point for a Dart package, a library module containing code that can be shared easily across multiple Flutter or Dart projects.

For help getting started with Flutter, view our online documentation, which offers tutorials, samples, guidance on mobile development, and a full API reference.

1
https://gitee.com/shirne/buffer_image.git
git@gitee.com:shirne/buffer_image.git
shirne
buffer_image
buffer_image
master

搜索帮助