'use strict';

Object.defineProperty(exports, "__esModule", {
  value: true
});

var _index = require('./index.js');

var _index2 = _interopRequireDefault(_index);

var _eventtarget = require('./events/eventtarget.js');

var _eventtarget2 = _interopRequireDefault(_eventtarget);

var _eventtype = require('./events/eventtype.js');

var _eventtype2 = _interopRequireDefault(_eventtype);

function _interopRequireDefault(obj) {
  return obj && obj.__esModule ? obj : { default: obj };
}

/**
 * @constructor
 * @abstract
 * @extends {ol.events.EventTarget}
 * @param {ol.Extent} extent Extent.
 * @param {number|undefined} resolution Resolution.
 * @param {number} pixelRatio Pixel ratio.
 * @param {ol.ImageState} state State.
 */
var _ol_ImageBase_ = function (extent, resolution, pixelRatio, state) {

  _eventtarget2.default.call(this);

  /**
   * @protected
   * @type {ol.Extent}
   */
  this.extent = extent;

  /**
   * @private
   * @type {number}
   */
  this.pixelRatio_ = pixelRatio;

  /**
   * @protected
   * @type {number|undefined}
   */
  this.resolution = resolution;

  /**
   * @protected
   * @type {ol.ImageState}
   */
  this.state = state;
};

_index2.default.inherits(_ol_ImageBase_, _eventtarget2.default);

/**
 * @protected
 */
_ol_ImageBase_.prototype.changed = function () {
  this.dispatchEvent(_eventtype2.default.CHANGE);
};

/**
 * @return {ol.Extent} Extent.
 */
_ol_ImageBase_.prototype.getExtent = function () {
  return this.extent;
};

/**
 * @abstract
 * @return {HTMLCanvasElement|Image|HTMLVideoElement} Image.
 */
_ol_ImageBase_.prototype.getImage = function () {};

/**
 * @return {number} PixelRatio.
 */
_ol_ImageBase_.prototype.getPixelRatio = function () {
  return this.pixelRatio_;
};

/**
 * @return {number} Resolution.
 */
_ol_ImageBase_.prototype.getResolution = function () {
  return (/** @type {number} */this.resolution
  );
};

/**
 * @return {ol.ImageState} State.
 */
_ol_ImageBase_.prototype.getState = function () {
  return this.state;
};

/**
 * Load not yet loaded URI.
 * @abstract
 */
_ol_ImageBase_.prototype.load = function () {};
exports.default = _ol_ImageBase_;
module.exports = exports['default'];