<commit_before>goog.provide('ol.source.StaticImage');

goog.require('ol.Image');
goog.require('ol.ImageUrlFunctionType');
goog.require('ol.extent');
goog.require('ol.projection');
goog.require('ol.source.ImageSource');



/**
 * @constructor
 * @extends {ol.source.ImageSource}
 * @param {ol.source.StaticImageOptions} options Static image options.
 */
ol.source.StaticImage = function(options) {

  var imageFunction = ol.source.StaticImage.createImageFunction(
      options.url);

  var imageExtent = options.imageExtent;
  var imageSize = options.imageSize;
  var imageResolution = (imageExtent[3] - imageExtent[2]) / imageSize.height;
  var projection = ol.projection.get(options.projection);

  goog.base(this, {
    attributions: options.attributions,
    crossOrigin: options.crossOrigin,
    extent: options.extent,
    projection: options.projection,
    imageUrlFunction: imageFunction,
    resolutions: [imageResolution]
  });

  /**
   * @private
   * @type {ol.Image}
   */
  this.image_ = this.createImage(
      imageExtent, imageResolution, imageSize, projection);

};
goog.inherits(ol.source.StaticImage, ol.source.ImageSource);


/**
 * @inheritDoc
 */
ol.source.StaticImage.prototype.getImage =
    function(extent, resolution, projection) {
  if (ol.extent.intersects(extent, this.image_.getExtent())) {
    return this.image_;
  }
  return null;
};


/**
 * @param {string|undefined} url URL.
 * @return {ol.ImageUrlFunctionType} Function.
 */
ol.source.StaticImage.createImageFunction = function(url) {
  return function(extent, size, projection) {
    return url;
  };
};<commit_msg>Improve type checking in ol.source.StaticImage<commit_after>goog.provide('ol.source.StaticImage');

goog.require('ol.Image');
goog.require('ol.ImageUrlFunctionType');
goog.require('ol.extent');
goog.require('ol.projection');
goog.require('ol.source.ImageSource');



/**
 * @constructor
 * @extends {ol.source.ImageSource}
 * @param {ol.source.StaticImageOptions} options Static image options.
 */
ol.source.StaticImage = function(options) {

  var imageFunction = ol.source.StaticImage.createImageFunction(
      options.url);

  var imageExtent = options.imageExtent;
  var imageSize = options.imageSize;
  var imageResolution = (imageExtent[3] - imageExtent[2]) / imageSize.height;
  var projection = ol.projection.get(options.projection);

  goog.base(this, {
    attributions: options.attributions,
    crossOrigin: options.crossOrigin,
    extent: options.extent,
    projection: options.projection,
    imageUrlFunction: imageFunction,
    resolutions: [imageResolution]
  });

  /**
   * @private
   * @type {ol.Image}
   */
  this.image_ = this.createImage(
      imageExtent, imageResolution, imageSize, projection);

};
goog.inherits(ol.source.StaticImage, ol.source.ImageSource);


/**
 * @inheritDoc
 */
ol.source.StaticImage.prototype.getImage =
    function(extent, resolution, projection) {
  if (ol.extent.intersects(extent, this.image_.getExtent())) {
    return this.image_;
  }
  return null;
};


/**
 * @param {string|undefined} url URL.
 * @return {ol.ImageUrlFunctionType} Function.
 */
ol.source.StaticImage.createImageFunction = function(url) {
  return (
      /**
       * @param {ol.Extent} extent Extent.
       * @param {ol.Size} size Size.
       * @param {ol.Projection} projection Projection.
       * @return {string|undefined} URL.
       */
      function(extent, size, projection) {
        return url;
      });
};
{'fraction_non_alphanumeric': 0.14248554913294798, 'fraction_numerical': 0.0011560693641618498, 'mean_word_length': 3.994227994227994, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7229839', 'n_tokens_mistral': 1122, 'n_tokens_neox': 1086, 'n_words': 191}