#pragma once
#include "action.h"

class ActionStroke : public Action
{
public:
    //std::unique_ptr<Stroke> m_stroke;
    std::unique_ptr<uint8_t[]> m_image[6] = SIXPLETTE(nullptr);
    glm::ivec4 m_old_box[6] = SIXPLETTE(glm::ivec4(0));
    bool m_old_dirty[6] = SIXPLETTE(false);
    glm::ivec4 m_box[6] = SIXPLETTE(glm::ivec4(0));
    bool clear_layer = false;
    int m_layer_idx = 0;
    int m_frame_idx = 0;
    class Canvas* m_canvas;
    virtual ~ActionStroke() = default;
    virtual void run() override { }
    virtual Action* get_redo() override;
    virtual void undo() override;
    virtual size_t memory() override;
};

struct ActionLayerClear : public Action
{
    std::shared_ptr<LayerFrame::Snapshot> m_snap;
    std::shared_ptr<Layer> m_layer;
    int m_frame = 0;
    glm::vec4 m_color;
    virtual void run() override { }
    virtual size_t memory() override { return m_snap->memsize(); }
    virtual Action* get_redo() override;
    virtual void undo() override;
};

struct ActionImportEquirect : public Action
{
    std::shared_ptr<LayerFrame::Snapshot> m_snap;
    std::shared_ptr<Layer> m_layer;
    int m_frame = 0;
    std::string m_path;
    virtual void run() override { }
    virtual size_t memory() override { return m_snap->memsize(); }
    virtual Action* get_redo() override;
    virtual void undo() override;
};
