package cz.jzitnik.events.handlers;

import com.googlecode.lanterna.TextColor;
import com.googlecode.lanterna.screen.Screen;
import com.googlecode.lanterna.screen.TerminalScreen;
import cz.jzitnik.annotations.EventHandler;
import cz.jzitnik.annotations.injectors.InjectDependency;
import cz.jzitnik.annotations.injectors.InjectState;
import cz.jzitnik.events.PlayVideo;
import cz.jzitnik.game.ResourceManager;
import cz.jzitnik.states.TerminalState;
import cz.jzitnik.utils.DependencyManager;
import cz.jzitnik.utils.events.AbstractEventHandler;
import org.bytedeco.javacv.FFmpegFrameGrabber;
import org.bytedeco.javacv.Frame;
import org.bytedeco.javacv.Java2DFrameConverter;

import java.awt.*;
import java.awt.image.BufferedImage;
import java.io.File;
import java.io.InputStream;
import java.nio.file.Files;
import java.nio.file.StandardCopyOption;

@EventHandler(PlayVideo.class)
public class PlayVideoHandler extends AbstractEventHandler<PlayVideo> {
    public PlayVideoHandler(DependencyManager dm) {
        super(dm);
    }

    @InjectDependency
    private ResourceManager resourceManager;

    @InjectState
    private TerminalState terminalState;

    @Override
    public void handle(PlayVideo event) {
    }


    private static TextColor.RGB toColor(int rgb) {
        int r = (rgb >> 16) & 0xFF;
        int g = (rgb >> 8) & 0xFF;
        int b = rgb & 0xFF;
        return new TextColor.RGB(r, g, b);
    }
}
