/*
 * Copyright (c) 2011, Oracle and/or its affiliates. All rights reserved.
 */
package com.sun.glass.ui.win;

import com.sun.glass.ui.Application;
import com.sun.glass.ui.Pixels;

import java.nio.ByteBuffer;
import java.nio.IntBuffer;


/**
 * MS Windows platform implementation class for Pixels.
 *
 * @author Anthony Petrov
 */
final class WinPixels extends Pixels {
    protected WinPixels(int width, int height, ByteBuffer data) {
        super(width, height, data);
    }

    protected WinPixels(int width, int height, IntBuffer data) {
        super(width, height, data);
    }

    private static final int nativeFormat;
    // _initIDs() returns the native format
    native private static int _initIDs();
    static {
        Application.loadNativeLibrary();
        nativeFormat = _initIDs();
    }

    static int getNativeFormat_impl() {
        return nativeFormat;
    }

    @Override native protected void _fillDirectByteBuffer(ByteBuffer bb);
    @Override native protected void _attachInt(long ptr, int w, int h, IntBuffer ints, int[] array, int offset);
    @Override native protected void _attachByte(long ptr, int w, int h, ByteBuffer bytes, byte[] array, int offset);
}

