package de.uwesoftware.mobilRaw;

import android.graphics.Bitmap;

public final class MobilRawWrapper {

	private long pointer;
	
	private int zoomsize[] = new int[2];
	
	private float zoom = 1.0f;
	
	private int fullsize[];

	private int zoompos[];
	
    static {
        System.loadLibrary("mobilRaw");
    }
	
    
	private native long setFile(String path);

	private native int setZoom(long pointer, float zoom, int size[]);
	
	private native int getSize(long pointer, int fullsize[], int zoomsize[]);
	
	private native int moveBitmap2(Bitmap bitmap, int x, int y);
	
	
	private native int updateImage(long pointer, Bitmap  bitmap, int pos[]);	
	
	private native int released(long pointer);
	
	
	public MobilRawWrapper(String path){
		pointer = setFile(path);	
		if(pointer != 0){
			setZoom(pointer, zoom, zoomsize);
		}
	}
	
	public int get_ZoomsizeX(){
		return zoomsize[0];
	}
	
	public int get_ZoomsizeY(){
		return zoomsize[1];
	}
	
	public void moveBitmap(Bitmap bitmap, int variable[]){
		
		updateImage(pointer, bitmap, variable );
	}
	
	public void moveBitmap(Bitmap bitmap, int x, int y){
		moveBitmap2(bitmap,x,y);
	}
}
