パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.0.1-dev.7

fast_blurhash

高速な処理を実現するため、Rust を活用した BlurHash のデコードに適した高性能な Dart FFI パッケージ。

AndroidiOSmacOSWindowsLinux
30日間ダウンロード
53
いいね数
34
Pub ポイント
150

パッケージをインストール

flutter pub add fast_blurhash

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

fast_blurhash は、効率的な計算に Rust を活用することで、BlurHash のデコードを高速化する高性能な Dart FFI パッケージです。低解像度のプレースホルダー画像の高速生成とレンダリングを可能にし、画像読み込みワークフローにおける認識されるパフォーマンス向上に最適です。重い処理をネイティブな Rust コードにオフロードすることで、純粋な Dart 実装と比較して CPU オーバーヘッドを大幅に削減します。このパッケージは Android、iOS、macOS、Windows、Linux など複数のプラットフォームをサポートしており、画像読み込み中に滑らかな視覚フィードバックが必要なクロスプラットフォームアプリケーションに適しています。

用途

  • 高速画像プレースホルダーレンダリング
  • 改善されたアプリの認識パフォーマンス
  • リモート画像の効率的な読み込み
  • リアルタイムプレビューの生成
  • 背景画像処理
  • クロスプラットフォーム互換性

主な機能

  • Rustで駆動されるパフォーマンス
  • Dart FFI 統合
  • マルチプラットフォーム対応
  • メモリ使用量が小さい
  • 高速デコーディング
  • スムーズな Flutter 統合

適している対象

  • 大量の画像を読み込むアプリ
  • パフォーマンスが重要なUI
  • 画像中心のダッシュボード
  • プレースホルダーを使用したプロトタイピング
  • ネイティブスピードを求める開発者

注意事項

  • ローカルビルドにはRustツールチェーンが必要です
  • BlurHash のデコードに限定(エンコーディングは不可)
  • プラットフォーム固有のネイティブ依存関係
  • CI/CDにおけるビルドの複雑さの可能性
  • アプリのバイナリーサイズがわずかに増加する可能性があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

fast_blurhash

A Dart FFI package project that uses Rust to decode the blurhash and encode the final image, utilizing FFI to call these functions. This package exists because it works +20x faster on average than the common Dart implementation and can be tested in release mode by running the benchmarks.dart demo.

It only works with the latest version of Flutter on the main branch and requires the following feature to be enabled: flutter config --enable-native-assets. For more details, refer to this issue.

Status

  • Uses experimental APIs which might change in the future.
  • The first time call takes longer than the average time so I have added a setup function to do a warmup call.
  • Tested only on iOS and MacOs in release mode.
  • Significant performance difference between release mode and debug mode; do not rely on debug mode results.

Project structure

This template uses the following structure:

  • rust: Contains the rust source code.

  • lib: Contains the Dart code that defines the API of the plugin, and which calls into the native code using dart:ffi.

Benchmarks

To test the performance of the package in release mode, run the benchmarks.dart demo.

So far I have tried this one iOS and macos release mode, don't run the benchmarks on debug mode.

Run the benchmark using : flutter run -t lib/benchmarks.dart --release

iPhone 15 pro:
screenshot from the benchmarks demo on iPhone 15 pro
M1 Macbook Pro:
screenshot from the benchmarks demo on macbook pro

カテゴリー

依存関係

依存関係一覧 5 件

ソースリポジトリ

このパッケージを使用しているプロジェクト

データはまだありません。