initial commit
BIN
bitmap.png
Normal file
After Width: | Height: | Size: 284 KiB |
438
drawing.svg
Normal file
After Width: | Height: | Size: 273 KiB |
70
lain-rainbow.c
Normal file
@ -0,0 +1,70 @@
|
||||
#include <stdio.h>
|
||||
#include <cairo.h>
|
||||
#define M_PI 3.14159265358979323846
|
||||
|
||||
static double width, height;
|
||||
static char path_output[512];
|
||||
static cairo_t *cr;
|
||||
static cairo_surface_t *surface;
|
||||
|
||||
struct rgb {
|
||||
double r, g, b;
|
||||
} values[] = {
|
||||
{0, .7, .9},
|
||||
{.5, .9, .5},
|
||||
{1., 1., .4},
|
||||
{1., .8, .5},
|
||||
{1., .6, .65},
|
||||
{1., .4, .9},
|
||||
};
|
||||
#define NVALUES 6
|
||||
|
||||
int start = 0;
|
||||
|
||||
void lain_rainbow(cairo_t * cr) {
|
||||
unsigned ii, jj;
|
||||
double dy, dx, x0, y0, x1, y1, red, green, blue;
|
||||
|
||||
/* Outer black border */
|
||||
red = green = blue = 1.;
|
||||
cairo_set_line_width(cr, 0);
|
||||
cairo_set_source_rgba(cr, red, green, blue, 1.);
|
||||
|
||||
cairo_rectangle(cr, 0, 0, width, height);
|
||||
cairo_fill(cr);
|
||||
|
||||
/* Colors */
|
||||
x1 = width;
|
||||
dx = width / 36;
|
||||
y1 = dy = height / 36;
|
||||
x0 = 0;
|
||||
y0 = 0;
|
||||
for (ii = start, jj = 0; jj < 36; jj++, ii++) {
|
||||
cairo_rectangle(cr, x0, y0, x1, y1);
|
||||
cairo_set_source_rgba(cr, values[ii % NVALUES].r, values[ii % NVALUES].g, values[ii % NVALUES].b, 1.);
|
||||
cairo_fill(cr);
|
||||
y0 += dy;
|
||||
x1 += dx;
|
||||
y1 += dy;
|
||||
}
|
||||
}
|
||||
|
||||
int main(int argc, char **argv) {
|
||||
int n;
|
||||
width = 3840;
|
||||
height = 2160;
|
||||
sprintf (path_output, "stage1-00.png");
|
||||
if (argc == 2) {
|
||||
n = 0;
|
||||
sscanf(argv[1], "%d", &n);
|
||||
start = n;
|
||||
sprintf (path_output, "stage1-%02d.png", n);
|
||||
}
|
||||
surface = cairo_image_surface_create (CAIRO_FORMAT_ARGB32, width, height);
|
||||
cr = cairo_create(surface);
|
||||
lain_rainbow(cr);
|
||||
cairo_surface_write_to_png (surface, path_output);
|
||||
cairo_surface_destroy(surface);
|
||||
cairo_destroy(cr);
|
||||
return 0;
|
||||
}
|
BIN
lain.xcf.xz
Normal file
25
makefile
Normal file
@ -0,0 +1,25 @@
|
||||
FRAMES = 00 01 02 03 04 05
|
||||
FRAMES_SUFFIX = .png
|
||||
STAGE1_NAME = stage1-
|
||||
STAGE2_NAME = stage2-
|
||||
STAGE1_FILES := $(addprefix $(STAGE1_NAME),$(FRAMES))
|
||||
STAGE1_FILES := $(addsuffix $(FRAMES_SUFFIX),$(STAGE1_FILES))
|
||||
STAGE2_FILES := $(addprefix $(STAGE2_NAME),$(FRAMES))
|
||||
STAGE2_FILES := $(addsuffix $(FRAMES_SUFFIX),$(STAGE2_FILES))
|
||||
|
||||
all: $(STAGE1_FILES) $(STAGE2_FILES) lain.mp4
|
||||
|
||||
lain-rainbow: lain-rainbow.c
|
||||
$(CC) -W -Wall -Werror -Wextra -std=c89 $^ -o $@ $(shell pkg-config --cflags --libs cairo cairo-svg)
|
||||
|
||||
$(STAGE1_NAME)%.png: lain-rainbow
|
||||
./lain-rainbow $*
|
||||
|
||||
$(STAGE2_NAME)%.png: $(STAGE1_NAME)%.png
|
||||
composite lain.png $(STAGE1_NAME)$*.png $(STAGE2_NAME)$*.png
|
||||
|
||||
lain.mp4: $(STAGE2_FILES)
|
||||
ffmpeg -re -stream_loop -1 -y -i "$(STAGE2_NAME)%02d.png" -vf 'zoompan=d=.5:s=3840x2160:fps=2,framerate=25:interp_start=0:interp_end=255:scene=100' -c:v mpeg4 -maxrate 5M -q:v 2 -t 0:0:3 $@
|
||||
|
||||
clean:
|
||||
$(RM) lain-rainbow $(STAGE1_FILES) $(STAGE2_FILES)
|
BIN
original.gif
Normal file
After Width: | Height: | Size: 84 KiB |
27
readme.org
Normal file
@ -0,0 +1,27 @@
|
||||
#MODE: -*- org -*-
|
||||
|
||||
* Info
|
||||
|
||||
- ~original.gif~ is the original image
|
||||
- ~drawing.svg~ is a vector of the important parts
|
||||
- ~lain.xcf~ contains all ~source_images~ and masking to produce ~lain.png~
|
||||
- ~lain.png~ is combined with 6 frames of ~stage1-%02d.png~ to produce ~stage2-%02d.png~
|
||||
- ~stage2-%02d.png~ is merged into ~lain.mp4~ with ~ffmpeg~
|
||||
|
||||
* Usage
|
||||
#+BEGIN_SRC
|
||||
mpv --loop=inf --vo=vdpau lain.mp4
|
||||
#+END_SRC
|
||||
|
||||
* Source Images
|
||||
No idea where these came from. I guess around the net. Google.
|
||||
You could probably reverse image search.
|
||||
|
||||
* Dependencies
|
||||
- cc
|
||||
- mpv (for viewing)
|
||||
- make
|
||||
- imagemagick
|
||||
- libcairo2-dev
|
||||
- gimp (for editing xcf)
|
||||
- inkscape (for editing svg)
|
After Width: | Height: | Size: 27 KiB |
BIN
source_images/Amiga-OSX_1.png
Normal file
After Width: | Height: | Size: 183 KiB |
BIN
source_images/a4000_05.jpg
Normal file
After Width: | Height: | Size: 201 KiB |
BIN
source_images/amigaos_1-0b3_workbench_2012.png
Normal file
After Width: | Height: | Size: 177 KiB |
BIN
source_images/download (1).gif
Normal file
After Width: | Height: | Size: 16 KiB |
BIN
source_images/download (1).jpeg
Normal file
After Width: | Height: | Size: 185 KiB |
BIN
source_images/download (2).gif
Normal file
After Width: | Height: | Size: 32 KiB |
BIN
source_images/download (2).jpeg
Normal file
After Width: | Height: | Size: 323 KiB |
BIN
source_images/download (3).jpeg
Normal file
After Width: | Height: | Size: 295 KiB |
BIN
source_images/download.gif
Normal file
After Width: | Height: | Size: 132 KiB |
BIN
source_images/download.jpeg
Normal file
After Width: | Height: | Size: 75 KiB |
BIN
source_images/download.png
Normal file
After Width: | Height: | Size: 52 KiB |
BIN
source_images/microsoft-paint-windows-98-136398854913902601.jpeg
Normal file
After Width: | Height: | Size: 81 KiB |
BIN
source_images/win31.png
Normal file
After Width: | Height: | Size: 13 KiB |
BIN
source_images/win31progman2.png
Normal file
After Width: | Height: | Size: 6.0 KiB |
BIN
source_images/win95-2-1.png
Normal file
After Width: | Height: | Size: 4.0 KiB |
BIN
source_images/win95cpl.png
Normal file
After Width: | Height: | Size: 10 KiB |
BIN
source_images/win95msdos.png
Normal file
After Width: | Height: | Size: 7.2 KiB |