package me.hammerle.supersnuvi.rendering;

import me.hammerle.supersnuvi.javafx.Image;

public interface IRenderer 
{
    // -------------------------------------------------------------------------
    // image rendering
    // -------------------------------------------------------------------------
    
    public void drawImage(Image image, double x, double y);
    public void drawFixedImage(Image image, double x, double y);
    public void drawFixedImage(Image image, double x, double y, double w, double h);
    public void drawFlippedImage(Image image, double x, double y);
    public void drawBlockImage(Image image, int x, int y, double offsetX, double offsetY);   
    
    // -------------------------------------------------------------------------
    // primitive rendering
    // -------------------------------------------------------------------------
    
    public double getWidth();
    public double getHeight();
    
    public void save();
    public void restore();
    public void setFillColor(int r, int g, int b, double alpha);
    public void setStrokeColor(int r, int g, int b, double alpha);
    
    public void fillRectangle(double x, double y, double w, double h);
    
    // -------------------------------------------------------------------------
    // text rendering
    // -------------------------------------------------------------------------
    
    public void prepareTextDrawing(int r, int g, int b, double alpha, int width); 
    public void stopTextDrawing();
   
    public void drawText(double x, double y, char[] text);
    public void drawText(double x, double y, char[] text, int max);
    public double getTextWidth(int chars);
    public double getTextHeight(int lines);
    
    // -------------------------------------------------------------------------
    // rendering utils
    // -------------------------------------------------------------------------
    
    public int getFirstVisibleBlockX();
    public int getFirstVisibleBlockY();
    
    public int getLastVisibleBlockX();
    public int getLastVisibleBlockY();
    
    public int toBlock(double c);
    public double toCoord(int b);
    
    public void setViewCenter(double x, double y);
}
