Remove ol.raster namespace

Now used only for 1 typedefs and 1 enum, it serves little purpose,
so the typedef is renamed in the ol namespace, and the enum moved to rastersource.js
This commit is contained in:
Peter Robins
2016-05-26 10:13:59 +00:00
parent e63b4d1f48
commit 395f3c0756
6 changed files with 47 additions and 45 deletions

View File

@@ -1,3 +1,4 @@
goog.provide('ol.RasterOperationType');
goog.provide('ol.source.Raster');
goog.provide('ol.source.RasterEvent');
goog.provide('ol.source.RasterEventType');
@@ -15,7 +16,6 @@ goog.require('ol.extent');
goog.require('ol.layer.Image');
goog.require('ol.layer.Tile');
goog.require('ol.object');
goog.require('ol.raster.OperationType');
goog.require('ol.renderer.canvas.ImageLayer');
goog.require('ol.renderer.canvas.TileLayer');
goog.require('ol.source.Image');
@@ -23,10 +23,20 @@ goog.require('ol.source.State');
goog.require('ol.source.Tile');
/**
* Raster operation type. Supported values are `'pixel'` and `'image'`.
* @enum {string}
*/
ol.RasterOperationType = {
PIXEL: 'pixel',
IMAGE: 'image'
};
/**
* @classdesc
* A source that transforms data from any number of input sources using an array
* of {@link ol.raster.Operation} functions to transform input pixel values into
* of {@link ol.RasterOperation} functions to transform input pixel values into
* output pixel values.
*
* @constructor
@@ -45,10 +55,10 @@ ol.source.Raster = function(options) {
/**
* @private
* @type {ol.raster.OperationType}
* @type {ol.RasterOperationType}
*/
this.operationType_ = options.operationType !== undefined ?
options.operationType : ol.raster.OperationType.PIXEL;
options.operationType : ol.RasterOperationType.PIXEL;
/**
* @private
@@ -144,7 +154,7 @@ ol.inherits(ol.source.Raster, ol.source.Image);
/**
* Set the operation.
* @param {ol.raster.Operation} operation New operation.
* @param {ol.RasterOperation} operation New operation.
* @param {Object=} opt_lib Functions that will be available to operations run
* in a worker.
* @api
@@ -152,7 +162,7 @@ ol.inherits(ol.source.Raster, ol.source.Image);
ol.source.Raster.prototype.setOperation = function(operation, opt_lib) {
this.worker_ = new ol.ext.pixelworks.Processor({
operation: operation,
imageOps: this.operationType_ === ol.raster.OperationType.IMAGE,
imageOps: this.operationType_ === ol.RasterOperationType.IMAGE,
queue: 1,
lib: opt_lib,
threads: this.threads_