Sha256: 52b5e7f9db2569ea0227fb833dffef74882fa10fb8c3b1c16e7d8d822753f7bb
Contents?: true
Size: 1.97 KB
Versions: 4
Compression:
Stored size: 1.97 KB
Contents
o: ActiveSupport::Cache::Entry :@compressedF:@expires_in0:@created_atf1380709792.40002:@value"u{I" class:ETI"BundledAsset;FI"logical_path;TI"Core/getImagePixels.js;TI" pathname;TI"T/Users/bogumil/www/engines/cesium/app/assets/javascripts/Core/getImagePixels.js;FI"content_type;TI"application/javascript;TI" mtime;TI"2013-10-02T12:16:28+02:00;TI"length;Ti�I"digest;TI"%8871f7c1e75f552dc0fcc7a182273099;FI"source;TI"�/*global define*/ define(['Core/defined'], function(defined) { "use strict"; var context2DsByWidthAndHeight = {}; /** * Extract a pixel array from a loaded image. Draws the image * into a canvas so it can read the pixels back. * * @exports getImagePixels * * @param {Image} image The image to extract pixels from. * * @returns {CanvasPixelArray} The pixels of the image. */ var getImagePixels = function(image, width, height) { if (!defined(width)) { width = image.width; } if (!defined(height)) { height = image.height; } var context2DsByHeight = context2DsByWidthAndHeight[width]; if (!defined(context2DsByHeight)) { context2DsByHeight = {}; context2DsByWidthAndHeight[width] = context2DsByHeight; } var context2d = context2DsByHeight[height]; if (!defined(context2d)) { var canvas = document.createElement('canvas'); canvas.width = width; canvas.height = height; context2d = canvas.getContext('2d'); context2d.globalCompositeOperation = 'copy'; context2DsByHeight[height] = context2d; } context2d.drawImage(image, 0, 0, width, height); return context2d.getImageData(0, 0, width, height).data; }; return getImagePixels; }); ;TI"required_assets_digest;TI"%49174d64728e150a2ec58f1514f3dd49;FI" _version;TI"%6776f581a4329e299531e1d52aa59832;F
Version data entries
4 entries across 4 versions & 1 rubygems