/* * makemovie read image names from stdin and create a movie * Copyright (c) 2009 Sam Hocevar * All Rights Reserved * * $Id$ * * This program is free software. It comes without any warranty, to * the extent permitted by applicable law. You can redistribute it * and/or modify it under the terms of the Do What The Fuck You Want * To Public License, Version 2, as published by Sam Hocevar. See * http://sam.zoy.org/wtfpl/COPYING for more details. */ #include "config.h" #include #include #include #include #define WIDTH 1280 #define HEIGHT 720 #define FPS 30 int main(int argc, char *argv[]) { char file[1024]; pipi_image_t *image; pipi_sequence_t *seq; pipi_pixels_t *p; int f; if(argc < 2) return EXIT_FAILURE; seq = pipi_open_sequence(argv[1], WIDTH, HEIGHT, FPS); if(!seq) return EXIT_FAILURE; for(f = 0; ; f++) { uint8_t *start; int w = 0, h = 0; if(!fgets(file, sizeof(file), stdin)) break; file[strlen(file) - 1] = '\0'; image = pipi_load(file); if(!image) return EXIT_FAILURE; p = pipi_get_pixels(image, PIPI_PIXELS_RGBA_U8); start = (uint8_t *)p->pixels; pipi_feed_sequence(seq, start, p->w, p->h); pipi_free(image); fprintf(stderr, "frame %d\r", f); } fprintf(stderr, "\n"); pipi_close_sequence(seq); return EXIT_SUCCESS; }