Skip to content

Commit

Permalink
Merge pull request #35 from visual-cortex/feature/single_instance_thread
Browse files Browse the repository at this point in the history
Feature / Single Instance Thread
  • Loading branch information
vladjerca committed Jan 26, 2019
2 parents 1a6845b + 8eacccb commit 1f9ec41
Show file tree
Hide file tree
Showing 15 changed files with 221 additions and 72 deletions.
12 changes: 12 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Documentation
* [imageData](#imagedata)
* [loadImage](#loadimage)
* [splineTheme](#splinetheme)
* [uuid](#uuid)

---

Expand Down Expand Up @@ -309,4 +310,15 @@ ___
**Returns:** `object`

___
<a id="uuid"></a>

### `<Const>` uuid

**uuid**(): `string`

*Defined in [utils/random/uuid.ts:7](https://github.com/visual-cortex/imgstry/blob/master/source/utils/random/uuid.ts#L7)*

**Returns:** `string`

___

12 changes: 12 additions & 0 deletions docs/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -65,6 +65,7 @@ Documentation
* [imageData](#imagedata)
* [loadImage](#loadimage)
* [splineTheme](#splinetheme)
* [uuid](#uuid)

---

Expand Down Expand Up @@ -309,4 +310,15 @@ ___
**Returns:** `object`

___
<a id="uuid"></a>

### `<Const>` uuid

**uuid**(): `string`

*Defined in [utils/random/uuid.ts:7](https://github.com/visual-cortex/imgstry/blob/master/source/utils/random/uuid.ts#L7)*

**Returns:** `string`

___

59 changes: 45 additions & 14 deletions docs/classes/imgstry.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,14 @@
# Class: Imgstry

(Exposes image processing methods for html canvas) Processor implementation for the web worker (Exposes image processing methods for html canvas)
*__export__*:

*__class__*: Imgstry

*__extends__*: {ImgstryEditor}

*__implements__*: {IDisposable}

*__export__*:

*__class__*: Imgstry
Expand All @@ -23,6 +29,10 @@

**↳ Imgstry**

## Implements

* [IDisposable](../interfaces/idisposable.md)

## Index

### Constructors
Expand Down Expand Up @@ -51,6 +61,7 @@
* [clone](imgstry.md#clone)
* [contrast](imgstry.md#contrast)
* [convolve](imgstry.md#convolve)
* [dispose](imgstry.md#dispose)
* [drawImage](imgstry.md#drawimage)
* [fill](imgstry.md#fill)
* [gamma](imgstry.md#gamma)
Expand All @@ -77,7 +88,7 @@

**new Imgstry**(canvas: *`HTMLCanvasElement`*, _options?: *`Partial`<[ImgstryBrowserOptions](../interfaces/imgstrybrowseroptions.md)>*): [Imgstry](imgstry.md)

*Defined in [platform/browser/imgstry/imgstry.browser.ts:60](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L60)*
*Defined in [platform/browser/imgstry/imgstry.browser.ts:69](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L69)*

Creates an instance of Imgstry.
*__constructor__*:
Expand All @@ -101,7 +112,7 @@ ___

**● canvas**: *`HTMLCanvasElement`*

*Defined in [platform/browser/imgstry/imgstry.browser.ts:70](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L70)*
*Defined in [platform/browser/imgstry/imgstry.browser.ts:79](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L79)*
*Defined in [platform/node/imgstry/imgstry.node.ts:26](https://github.com/visual-cortex/imgstry/blob/master/source/platform/node/imgstry/imgstry.node.ts#L26)*

(specifies the canvas base for imgstry)
Expand All @@ -113,7 +124,7 @@ ___

**● context**: *`CanvasRenderingContext2D`*

*Defined in [platform/browser/imgstry/imgstry.browser.ts:52](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L52)*
*Defined in [platform/browser/imgstry/imgstry.browser.ts:59](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L59)*
*Defined in [platform/node/imgstry/imgstry.node.ts:25](https://github.com/visual-cortex/imgstry/blob/master/source/platform/node/imgstry/imgstry.node.ts#L25)*

___
Expand All @@ -123,7 +134,7 @@ ___

**● getCanvas**: *[getCanvas]()* = getCanvas

*Defined in [platform/browser/imgstry/imgstry.browser.ts:49](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L49)*
*Defined in [platform/browser/imgstry/imgstry.browser.ts:56](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L56)*

___

Expand All @@ -150,7 +161,7 @@ gethistogram(): `HistogramData`

*Overrides ImgstryProcessor.histogram*

*Defined in [core/imgstry.processor.ts:95](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L95)*
*Defined in [core/imgstry.processor.ts:96](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L96)*

Returns the channel histogram of the image.
*__readonly__*:
Expand Down Expand Up @@ -207,7 +218,7 @@ ___

*Overrides ImgstryProcessor.batch*

*Defined in [core/imgstry.processor.ts:126](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L126)*
*Defined in [core/imgstry.processor.ts:127](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L127)*

Applies a series of filters to the image.
*__memberof__*: ImgstryProcessor
Expand All @@ -216,11 +227,11 @@ Applies a series of filters to the image.

| Name | Type | Description |
| ------ | ------ | ------ |
| options | `OperationOption`[] | the set of operations |
| options | `OperationOption`[] | The set of operations. |
| `Optional` reset | `boolean` |

**Returns:** `ImgstryProcessor`
the current processor instance
The current processor instance

___
<a id="blackandwhite"></a>
Expand Down Expand Up @@ -300,7 +311,7 @@ ___

*Overrides ImgstryProcessor.clone*

*Defined in [platform/browser/imgstry/imgstry.browser.ts:101](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L101)*
*Defined in [platform/browser/imgstry/imgstry.browser.ts:119](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L119)*

**Parameters:**

Expand Down Expand Up @@ -360,14 +371,30 @@ Apply a kernel to the active image
**Returns:** [ImgstryEditor](imgstryeditor.md)
the current editor instance

___
<a id="dispose"></a>

### dispose

**dispose**(): `void`

*Implementation of [IDisposable](../interfaces/idisposable.md).[dispose](../interfaces/idisposable.md#dispose)*

*Defined in [platform/browser/imgstry/imgstry.browser.ts:148](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L148)*

Destroys the thread and clears the canvas of data.
*__memberof__*: Imgstry

**Returns:** `void`

___
<a id="drawimage"></a>

### drawImage

**drawImage**(image: *`HTMLImageElement`*): `void`

*Defined in [platform/browser/imgstry/imgstry.browser.ts:87](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L87)*
*Defined in [platform/browser/imgstry/imgstry.browser.ts:97](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L97)*

Draws an image on the canvas.
*__memberof__*: Imgstry
Expand Down Expand Up @@ -508,7 +535,7 @@ ___

*Overrides [ImgstryEditor](imgstryeditor.md).[render](imgstryeditor.md#render)*

*Defined in [platform/browser/imgstry/imgstry.browser.ts:113](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L113)*
*Defined in [platform/browser/imgstry/imgstry.browser.ts:131](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L131)*

**Returns:** `Promise`<[Imgstry](imgstry.md)>

Expand Down Expand Up @@ -540,7 +567,7 @@ ___

*Overrides ImgstryProcessor.reset*

*Defined in [platform/browser/imgstry/imgstry.browser.ts:96](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L96)*
*Defined in [platform/browser/imgstry/imgstry.browser.ts:114](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L114)*

**Returns:** `ImgstryProcessor`

Expand Down Expand Up @@ -628,7 +655,10 @@ ___

*Overrides ImgstryProcessor.toDataUrl*

*Defined in [platform/browser/imgstry/imgstry.browser.ts:92](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L92)*
*Defined in [platform/browser/imgstry/imgstry.browser.ts:110](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L110)*

Returns the content of the current canvas as an image that you can use as a source for another canvas or an HTML element.
*__memberof__*: Imgstry

**Parameters:**

Expand All @@ -637,6 +667,7 @@ ___
| `Default value` type | `string` | &quot;image/png&quot; |

**Returns:** `string`
The image encoded as a data url.

___
<a id="vibrance"></a>
Expand Down Expand Up @@ -672,7 +703,7 @@ ___

**loadImage**(src: *`string`*): `Promise`<`HTMLImageElement`>

*Defined in [platform/browser/imgstry/imgstry.browser.ts:50](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L50)*
*Defined in [platform/browser/imgstry/imgstry.browser.ts:57](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L57)*

**Parameters:**

Expand Down
28 changes: 14 additions & 14 deletions docs/classes/imgstryeditor.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ gethistogram(): `HistogramData`

*Inherited from ImgstryProcessor.histogram*

*Defined in [core/imgstry.processor.ts:95](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L95)*
*Defined in [core/imgstry.processor.ts:96](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L96)*

Returns the channel histogram of the image.
*__readonly__*:
Expand All @@ -121,7 +121,7 @@ getimageData(): `ImageData`setimageData(imgData: *`ImageData`*): `any`

*Inherited from ImgstryProcessor.imageData*

*Defined in [core/imgstry.processor.ts:78](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L78)*
*Defined in [core/imgstry.processor.ts:79](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L79)*

Gets the image data.
*__abstract__*:
Expand All @@ -134,7 +134,7 @@ Gets the image data.

*Inherited from ImgstryProcessor.imageData*

*Defined in [core/imgstry.processor.ts:86](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L86)*
*Defined in [core/imgstry.processor.ts:87](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L87)*

Sets the image data.
*__abstract__*:
Expand All @@ -161,7 +161,7 @@ ___

*Inherited from ImgstryProcessor.batch*

*Defined in [core/imgstry.processor.ts:126](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L126)*
*Defined in [core/imgstry.processor.ts:127](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L127)*

Applies a series of filters to the image.
*__memberof__*: ImgstryProcessor
Expand All @@ -170,11 +170,11 @@ Applies a series of filters to the image.

| Name | Type | Description |
| ------ | ------ | ------ |
| options | `OperationOption`[] | the set of operations |
| options | `OperationOption`[] | The set of operations. |
| `Optional` reset | `boolean` |

**Returns:** `ImgstryProcessor`
the current processor instance
The current processor instance

___
<a id="blackandwhite"></a>
Expand Down Expand Up @@ -242,7 +242,7 @@ ___

*Inherited from ImgstryProcessor.clone*

*Defined in [core/imgstry.processor.ts:70](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L70)*
*Defined in [core/imgstry.processor.ts:71](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L71)*

Clone image data
*__abstract__*:
Expand All @@ -253,10 +253,10 @@ Clone image data

| Name | Type | Description |
| ------ | ------ | ------ |
| original | `ImageData` | source image data |
| original | `ImageData` | The source image data. |

**Returns:** `ImageData`
the cloned canvas image data
The cloned canvas image data.

___
<a id="contrast"></a>
Expand Down Expand Up @@ -438,15 +438,15 @@ ___

*Inherited from ImgstryProcessor.reset*

*Defined in [core/imgstry.processor.ts:61](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L61)*
*Defined in [core/imgstry.processor.ts:62](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L62)*

Resets the image to the original state.
*__abstract__*:

*__memberof__*: ImgstryProcessor

**Returns:** `ImgstryProcessor`
the current processor instance
The current processor instance.

___
<a id="saturation"></a>
Expand Down Expand Up @@ -520,7 +520,7 @@ ___

*Inherited from ImgstryProcessor.toDataUrl*

*Defined in [core/imgstry.processor.ts:51](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L51)*
*Defined in [core/imgstry.processor.ts:52](https://github.com/visual-cortex/imgstry/blob/master/source/core/imgstry.processor.ts#L52)*

Encodes the canvas data to a data URI.
*__memberof__*: Imgstry
Expand All @@ -529,10 +529,10 @@ Encodes the canvas data to a data URI.

| Name | Type | Description |
| ------ | ------ | ------ |
| type | `string` | data url type (eg: 'image/png') |
| type | `string` | The standard MIME type for the image format to return. If you do not specify this parameter, the default value is a PNG format image. |

**Returns:** `string`
url with the encoded image
The image encoded as a data url.

___
<a id="vibrance"></a>
Expand Down
1 change: 1 addition & 0 deletions docs/interfaces/idisposable.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@

## Implemented by

* [Imgstry](../classes/imgstry.md)
* [ImgstrySpline](../classes/imgstryspline.md)

## Index
Expand Down
2 changes: 1 addition & 1 deletion docs/interfaces/imgstrybrowseroptions.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@

**● thread**: *`ImgstryThreadOptions`*

*Defined in [platform/browser/imgstry/imgstry.browser.ts:20](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L20)*
*Defined in [platform/browser/imgstry/imgstry.browser.ts:23](https://github.com/visual-cortex/imgstry/blob/master/source/platform/browser/imgstry/imgstry.browser.ts#L23)*

___

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "imgstry",
"version": "1.0.0-alpha1",
"version": "1.0.0-alpha2",
"description": "A JavaScript image editing module.",
"main": "lib/index.js",
"directories": {
Expand Down
Loading

0 comments on commit 1f9ec41

Please sign in to comment.