Skip to content

Commit

Permalink
Merge pull request #304 from gpujs/296-image-support
Browse files Browse the repository at this point in the history
Closes #296 adds image support
  • Loading branch information
robertleeplummerjr authored Jun 5, 2018
2 parents 697c112 + 9913eea commit 419be53
Show file tree
Hide file tree
Showing 27 changed files with 1,780 additions and 289 deletions.
12 changes: 9 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -164,9 +164,15 @@ myFunc();
// Result: [0, 1, 2, 3, ... 99]
```
## Accepting Input

Kernel functions can accept numbers, or 1D, 2D or 3D array of numbers as input. To define an argument, simply add it to the kernel function like regular JavaScript.

### Supported Input Types
* Numbers
* 1d Array
* 2d Array
* 3d Array
* HTML Image
To define an argument, simply add it to the kernel function like regular JavaScript.

### Input Examples
```js
const myFunc = gpu.createKernel(function(x) {
return x;
Expand Down
6 changes: 3 additions & 3 deletions bin/gpu-core.js
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,15 @@
*
* GPU Accelerated JavaScript
*
* @version 1.2.0
* @date Fri Apr 27 2018 19:37:56 GMT+0200 (CEST)
* @version 1.3.0
* @date Mon Jun 04 2018 20:06:27 GMT-0400 (EDT)
*
* @license MIT
* The MIT License
*
* Copyright (c) 2018 gpu.js Team
*/
"use strict";(function(){function r(e,n,t){function o(i,f){if(!n[i]){if(!e[i]){var c="function"==typeof require&&require;if(!f&&c)return c(i,!0);if(u)return u(i,!0);var a=new Error("Cannot find module '"+i+"'");throw a.code="MODULE_NOT_FOUND",a}var p=n[i]={exports:{}};e[i][0].call(p.exports,function(r){var n=e[i][1][r];return o(n||r)},p,p.exports,r,e,n,t)}return n[i].exports}for(var u="function"==typeof require&&require,i=0;i<t.length;i++)o(t[i]);return o}return r})()({1:[function(require,module,exports){
"use strict";(function(){function e(t,n,r){function s(o,u){if(!n[o]){if(!t[o]){var a=typeof require=="function"&&require;if(!u&&a)return a(o,!0);if(i)return i(o,!0);var f=new Error("Cannot find module '"+o+"'");throw f.code="MODULE_NOT_FOUND",f}var l=n[o]={exports:{}};t[o][0].call(l.exports,function(e){var n=t[o][1][e];return s(n?n:e)},l,l.exports,e,t,n,r)}return n[o].exports}var i=typeof require=="function"&&require;for(var o=0;o<r.length;o++)s(r[o]);return s}return e})()({1:[function(require,module,exports){
'use strict';

var _createClass = function () { function defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } } return function (Constructor, protoProps, staticProps) { if (protoProps) defineProperties(Constructor.prototype, protoProps); if (staticProps) defineProperties(Constructor, staticProps); return Constructor; }; }();
Expand Down
6 changes: 3 additions & 3 deletions bin/gpu-core.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 419be53

Please sign in to comment.