package jp.sourceforge.nicoro.swf;

import static jp.sourceforge.nicoro.swf.Log.DEBUG_LOGD;
import static jp.sourceforge.nicoro.swf.Log.LOG_TAG;

public class FOCALGRADIENT extends GRADIENT {
	public short focalPoint;	// FIXED8

	@Override
    public int read(byte[] bufferArray, int offset, int tagType) {
    	FOCALGRADIENT focalGradient = this;

		if (DEBUG_LOGD) {
			Log.d(LOG_TAG, Log.buf().append("readFOCALGRADIENT: offset=")
					.append(offset).toString());
		}

		int offsetNext = super.read(bufferArray, offset, tagType);
		focalGradient.focalPoint = (short) ((bufferArray[offsetNext + 0] & 0xff) | ((bufferArray[offsetNext + 1] & 0xff) << 8));
    	if (DEBUG_LOGD) {
    		Log.d(LOG_TAG, Log.buf().append("FocalPoint=")
    				.append(focalGradient.focalPoint).toString());
    	}
		offsetNext += 2;
		return offsetNext;
    }

}
