package com.wonderkiln.camerakit.base;

import android.graphics.SurfaceTexture;
import android.view.Surface;
import android.view.SurfaceHolder;
import android.view.View;

public abstract class PreviewImpl {

    public  interface Callback {
        void onSurfaceChanged();
    }

    private Callback mCallback;

    private int mWidth;
    private int mHeight;

    protected int mPreviewWidth;
    protected int mPreviewHeight;
    protected int mPreviewFormat;

    public  void setCallback(Callback callback) {
        mCallback = callback;
    }

    public  abstract Surface getSurface();

    public abstract View getView();

    public abstract Class getOutputClass();

    public abstract void setDisplayOrientation(int displayOrientation);

    public abstract boolean isReady();

    protected void dispatchSurfaceChanged() {
        mCallback.onSurfaceChanged();
    }

    public  SurfaceHolder getSurfaceHolder() {
        return null;
    }

    public SurfaceTexture getSurfaceTexture() {
        return null;
    }

    public  void setSize(int width, int height) {
        mWidth = width;
        mHeight = height;
    }

    public int getWidth() {
        return mWidth;
    }

    public   int getHeight() {
        return mHeight;
    }

    public abstract float getX();
    public abstract float getY();

    public  void setPreviewParameters(final int width, final int height, final int format) {
        this.mPreviewWidth = width;
        this.mPreviewHeight = height;
        this.mPreviewFormat = format;
    }

    public int getPreviewWidth() {
        return mPreviewWidth;
    }

    public int getPreviewHeight() {
        return mPreviewHeight;
    }

    public int getPreviewFormat() {
        return mPreviewFormat;
    }

}
