You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -77,17 +99,28 @@ ImageSequencer = function ImageSequencer(options) {
77
99
returnthis;
78
100
}
79
101
102
+
/**
103
+
* @method removeStep
104
+
* @description Removes the step at the specified index from the sequence.
105
+
* @param {Object} ref ImageSequencer instance
106
+
* @param {Number} index Index of the step to be removed
107
+
* @returns {Null}
108
+
*/
80
109
functionremoveStep(ref,index){
81
-
//remove the step from images[image].steps and redraw remaining images
110
+
// Remove the step from images[image].steps and redraw remaining images
82
111
if(index>0){
83
-
//var this_ = (this.name == "ImageSequencer") ? this : this.sequencer;
112
+
//var this_ = (this.name == "ImageSequencer") ? this : this.sequencer;
84
113
thisStep=ref.steps[index];
85
114
thisStep.UI.onRemove(thisStep.options.step);
86
115
ref.steps.splice(index,1);
87
116
}
88
-
//tell the UI a step has been removed
89
117
}
90
118
119
+
/**
120
+
* @method removeSteps
121
+
* @description Removes one or more steps from the sequence
122
+
* @returns {Object}
123
+
*/
91
124
functionremoveSteps(){
92
125
varindices;
93
126
varthis_=(this.name=='ImageSequencer') ? this : this.sequencer;
@@ -103,6 +136,11 @@ ImageSequencer = function ImageSequencer(options) {
103
136
returnthis;
104
137
}
105
138
139
+
/**
140
+
* @method insertSteps
141
+
* @description Inserts steps at the specified index
142
+
* @returns {Object}
143
+
*/
106
144
functioninsertSteps(){
107
145
varthis_=(this.name=='ImageSequencer') ? this : this.sequencer;
108
146
varargs=[];
@@ -118,8 +156,11 @@ ImageSequencer = function ImageSequencer(options) {
118
156
returnthis;
119
157
}
120
158
121
-
// Config is an object which contains the runtime configuration like progress bar
122
-
// information and index from which the sequencer should run
159
+
/**
160
+
* @method run
161
+
* @param {Object} config Object which contains the runtime configuration like progress bar information and index from which the sequencer should run.
162
+
* @returns {Boolean}
163
+
*/
123
164
functionrun(config){
124
165
varprogressObj,index=0;
125
166
config=config||{mode: 'no-arg'};
@@ -137,7 +178,7 @@ ImageSequencer = function ImageSequencer(options) {
137
178
varcallback=function(){};
138
179
for(vararginargs)
139
180
if(objTypeOf(args[arg])=='Function')
140
-
callback=args.splice(arg,1)[0];//callback is formed
181
+
callback=args.splice(arg,1)[0];// Callback is formed
141
182
142
183
varjson_q=formatInput.call(this_,args,'r');
143
184
@@ -146,6 +187,11 @@ ImageSequencer = function ImageSequencer(options) {
146
187
returntrue;
147
188
}
148
189
190
+
/**
191
+
* @method loadImages
192
+
* @description Loads an image via dataURL or normal URL. Read the docs(https://github.com/publiclab/image-sequencer/blob/main/README.md) for more info.
* @description Returns the current sequence of steps
248
+
* @returns {Object}
249
+
*/
192
250
functiongetSteps(){
193
251
returnthis.steps;
194
252
}
195
253
254
+
/**
255
+
* @method setUI
256
+
* @description To set up a UI for ImageSequencer via different callback methods. Read the docs(https://github.com/publiclab/image-sequencer/blob/main/README.md) for more info.
257
+
* @param {Object} UI Object containing UI callback methods. Read the docs(https://github.com/publiclab/image-sequencer/blob/main/README.md) for more info.
258
+
* @returns {Null}
259
+
*/
196
260
functionsetUI(UI){
197
261
this.events=require('./ui/UserInterface')(UI);
198
262
}
@@ -201,6 +265,12 @@ ImageSequencer = function ImageSequencer(options) {
Copy file name to clipboardExpand all lines: src/modules/_nomodule/PixelManipulation.js
+16-8Lines changed: 16 additions & 8 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,14 @@
2
2
* General purpose per-pixel manipulation
3
3
* accepting a changePixel() method to remix a pixel's channels
4
4
*/
5
+
6
+
/**
7
+
* @method PixelManipulation
8
+
* @description Function for changing pixel values of the image via different callback functions. Read the docs(https://github.com/publiclab/image-sequencer/blob/main/CONTRIBUTING.md) for more info.
9
+
* @param {Object} image ndarray of pixels of the image
10
+
* @param {Object} options object containing callbacks for manipulating pixels.
0 commit comments