animcodec 0.1.0 copy "animcodec: ^0.1.0" to clipboard
animcodec: ^0.1.0 copied to clipboard

Animated raster codecs built on Imcodec for editable frame sequences.

example/main.dart

import 'dart:developer';
import 'dart:typed_data';

import 'package:animcodec/animcodec.dart';
import 'package:imcodec/imcodec.dart' as imcodec;

/// Creates, edits, and encodes a small two-frame GIF animation.
void main() {
  final RasterAnimation animation = RasterAnimation(
    width: 2,
    height: 1,
    loopCount: 0,
    frames: [
      RasterAnimationFrame(
        image: imcodec.Image(width: 2, height: 1)..setPixelRgb(0, 0, 255, 0, 0),
        duration: const Duration(milliseconds: 120),
      ),
      RasterAnimationFrame(
        image: imcodec.Image(width: 2, height: 1)..setPixelRgb(1, 0, 0, 255, 0),
        duration: const Duration(milliseconds: 240),
      ),
    ],
  );

  animation.frames.last.image.setPixelRgb(0, 0, 0, 0, 255);
  final Uint8List encoded = encodeGifAnimation(animation);
  final GifAnimationInfo information = inspectGifAnimation(encoded);

  log(
    'Encoded ${information.frameCount} frames over '
    '${information.duration.inMilliseconds} ms into '
    '${encoded.lengthInBytes} GIF bytes.',
    name: 'animcodec.example',
  );
}
0
likes
160
points
--
downloads
screenshot

Documentation

API reference

Publisher

verified publisherfocale-editor.app

Weekly Downloads

Animated raster codecs built on Imcodec for editable frame sequences.

Repository (GitHub)
View/report issues
Contributing

Topics

#image #animation #gif #codec #flutter

License

MIT (license)

Dependencies

flutter, imcodec

More

Packages that depend on animcodec