dart_lut 0.0.1

  • README.md
  • CHANGELOG.md
  • Example
  • Installing
  • Versions
  • 44

Dart LUT3D #

The library for working with LUTs.

License #

project under MIT license

Changelogs #

full changelog

Task List #

  • [x] Basic impl.
  • [x] Read .cube files
  • [x] Read another formats
  • [x] Store 3DLUT
  • [ ] Generate LUTs by expression
  • [ ] Verifying LUTs
  • [x] Applying 3D LUTs
  • [ ] Applying 1D LUTs
  • [ ] Optimize perfomance
  • [ ] Clean up code
  • [x] Trilinear interpolation
  • [ ] More tests
  • [ ] Documentation
  • [ ] Publish to PUB

0.0.1 #

  • initial release

Instalation #

add dependency in pubsec.yaml

from pub.dartlang.org:

dependencies:
  dart_lut: ^0.0.1

latest from github.com:

dependencies:
  dart_lut:
      git: git://github.com/NiKoTron/dart-lut.git

Usage #

generic example:

var lut = LUT.fromFile(File('example.cube'));
await lut.awaitLoading();

Image image = decodeImage(imageFile.readAsBytesSync());

var v = lut.applySync(image.getBytes());

var image2 = Image.fromBytes(image.width, image.height, v);
var outputFile = File('out.jpg')..writeAsBytesSync(encodeJpg(image2));

CHANGELOG #

0.0.1 initial release

example/main.dart

import 'dart:io';

import 'package:dart_lut/src/lut.dart';
import 'package:image/image.dart';
import 'package:args/args.dart';
import 'package:path/path.dart' as path;

void main(List<String> args) {
  final parser = ArgParser()
    ..addOption('lut-file', abbr: 'l', allowMultiple: false)
    ..addOption('in-img', abbr: 'i', allowMultiple: true)
    ..addOption('out-dir', abbr: 'o', defaultsTo: 'out', allowMultiple: false);

  _run(parser.parse(args));
}

void _run(final ArgResults argResult) {
  for (var img in argResult['in-img']) {
    final imageFile = new File(img);

    final lutFile = new File(argResult['lut-file']);

    var l = LUT.fromFile(lutFile);

    l.isLoaded.listen((data) async {
      Image image = decodeImage(imageFile.readAsBytesSync());
      final sw = Stopwatch()..start();
      var interp = InterpolationType.trilinear;
      var v = l.applySync(image.getBytes(), interp);

      print('lut apply in ${sw.elapsed}');
      sw.stop();
      var image2 = Image.fromBytes(image.width, image.height, v);
      var outputFile = new File(
          '${argResult['out-dir']}/${path.basename(imageFile.path)}_${path.basename(lutFile.path)}_$interp.jpg')
        ..writeAsBytesSync(encodeJpg(image2));
      print('output image write to: ${outputFile.path}');
    });
  }
}

Use this package as a library

1. Depend on it

Add this to your package's pubspec.yaml file:


dependencies:
  dart_lut: ^0.0.1

2. Install it

You can install packages from the command line:

with pub:


$ pub get

with Flutter:


$ flutter pub get

Alternatively, your editor might support pub get or flutter pub get. Check the docs for your editor to learn more.

3. Import it

Now in your Dart code, you can use:


import 'package:dart_lut/dart_lut.dart';
  
Version Uploaded Documentation Archive
0.0.4 Dec 26, 2018 Go to the documentation of dart_lut 0.0.4 Download dart_lut 0.0.4 archive
0.0.3 Dec 19, 2018 Go to the documentation of dart_lut 0.0.3 Download dart_lut 0.0.3 archive
0.0.2 Dec 18, 2018 Go to the documentation of dart_lut 0.0.2 Download dart_lut 0.0.2 archive
0.0.1 Dec 17, 2018 Go to the documentation of dart_lut 0.0.1 Download dart_lut 0.0.1 archive
Popularity:
Describes how popular the package is relative to other packages. [more]
0
Health:
Code health derived from static analysis. [more]
100
Maintenance:
Reflects how tidy and up-to-date the package is. [more]
71
Overall:
Weighted score of the above. [more]
44
Learn more about scoring.

We analyzed this package on May 8, 2019, and provided a score, details, and suggestions below. Analysis was completed with status completed using:

  • Dart: 2.3.0
  • pana: 0.12.15

Platforms

Detected platforms: Flutter, other

Primary library: package:dart_lut/dart_lut.dart with components: io.

Health suggestions

Fix lib/src/lut.dart. (-0.50 points)

Analysis of lib/src/lut.dart reported 1 hint:

line 58 col 5: Future results in async function bodies must be awaited or marked unawaited using package:pedantic.

Maintenance suggestions

The package description is too short. (-19 points)

Add more detail to the description field of pubspec.yaml. Use 60 to 180 characters to describe the package, what it does, and its target use case.

Package is pre-v0.1 release. (-10 points)

While nothing is inherently wrong with versions of 0.0.*, it might mean that the author is still experimenting with the general direction of the API.

Dependencies

Package Constraint Resolved Available
Direct dependencies
Dart SDK >=2.0.0 <3.0.0
Dev dependencies
args ^1.5.1
image ^2.0.4
path ^1.6.2
test ^1.3.0