<commit_before>##Portal Control
> gesture controlled video feedback installation
___________________

#####see [Portal Control wiki](https://github.com/VideoAlchemy/portal-control/wiki) for detailed dev docs, including tech and feature specs, study notes and tutorials.

####requirements
1. all displayed images are textures
2. sources are never altered
3. pixel manipulation is always via pixels array
4. analog video equipment metaphor drives design

___________________________
###var_NAMES and analog videolab metaphor

#####{source} PImage
- pristine original source.  the mother mold
- provides a copy to a specific channel for DISPLAY and/or MONITOR
- is never itself altered or displayed

#####chnl{x}_MONITOR PImage
- provides view of unaltered source
- always appears in the same place in the mx_MONITOR
- becomes the texture used for the MONITOR shape


#####chnl{x}_DISPLAY PImage
- receives a source
- image processing takes place when pixel values are copied from source to DISPLAY
- becomes the texture used for DISPLAY

#####mx_MONITOR PImage
- contains all chnl<x>_MONITOR textures
- has blue background
- can display each chnl<x>_DISPLAY separately



___________________________
###Controller Components (touchOSC)

####chnl{x}_CONTROLLER

#####chnl{x}_SEND 
- select new image
- send chnl<x>_DISPLAY to mx_MONITOR where it can be isolated for evaluation, test, etc. seen above the blue test background of mx_MONITOR
- by default, the chnl<x>_MONITOR always appears on mx_MONITOR, so no need to toggle this
- send chnl<x>_DISPLAY to mx_OUTPUT to view on main screen

#####chnl{x}_POSITION
- vertex-location-control
     - 4 2D grids, each control one corner
- image-location-control (used with imageMode(CENTER); )
     - 1 2D grid to position the object
- scale
- rotate
- rotateZ ????

#####chnl{x}_PIXELS
- alpha threshold
     - at what level of brightness does alpha go to 100%
     - this forms an irregular shape.  not sure if this will work if the image is a vertex based shape.  it should punch holes in the shape, no?  see the layers underneath? sheet hope so
- alpha level
     - adjust the overall alpha of that channel
- blendModes
     - blends each pixel as they are copied to the mx_OUTPUT
     - ideally, blend modes can be applied from current chnl to any other chnl or from chnl to mx_OUTPUT.



___________________________
####functions to implement

#####blendColor();
- applies blend from one pixel to another as pixel by pixel are copied over from pixels[]
- this can be applied from chnl<x> to chnl<z> or from the composite of all non-silhouette chnls to the silhouette in the final steps of mx_OUTPUT.  (Was that an uncontrived use of 'chnl<z>' in a project?  Nice! Gettin' nothin' but static.)
```
//exact syntax unknow, but prolly something like:
mxOUTPUT.pixels[loc] = blendColor(journal.pixels[loc], silhouette.pixels[loc], HARD_LIGHT);
```
- includes: BLEND, DARKEST, LIGHTEST, SOFT_LIGHT, etc
- use this to blend between images, or to apply mask
- use with silhouette
- ideally, blend modes can be applied from current chnl to any other chnl or from chnl to mx_OUTPUT.
- think like shiffman
```
bufferMixesSignal.loadPixels();
accumulateForces(); --> into a single force
applyForce();
updatePixels into a buffer mixerStation


#####blend(img, x,y,h,d, u,v,uw,vh, BLENDMODE);
- apply blend mode from piece of img to piece of graphics window


#####filter(<filteName>, <factor>);
- modifies the graphics window directly
- INVERT may be the most useful, like the old MX-1 Videonics effect
```
// create negative/positive oscillation by inverting then apply unfiltered 
1. feedback layer get the unfiltered mx_OUTPUT
2. draw mx_OUTPUT to screen
3. apply INVERT to the screen
4. draw unfiltered texture map to the screen
```

#####tint(r,g,b,a); 
- applied directly to graphics window
- use this to create transparency
```
// shade output RED
tint(255,0,0);
image(myImage,0,0);

// shut it off
noTint();

// create transparency
image(opaqueImage, 0,0);
tint(255,255,255,)






#####copy(); 
- copies portion of display window and places it back into display
- or copies portion of source image and places into display window
```
// copy from processing screen back to processing screen
copy(sx, sy, sw, sh, dx, dy, dw, dh); <commit_msg>added controller compooenents and PImage naming conventions to README<commit_after>##Portal Control
> gesture controlled video feedback installation
___________________

#####see [Portal Control wiki](https://github.com/VideoAlchemy/portal-control/wiki) for detailed dev docs, including tech and feature specs, study notes and tutorials.

####requirements
1. all displayed images are textures
2. sources are never altered
3. pixel manipulation is always via pixels array
4. analog video equipment metaphor drives design

___________________________
###var_NAMES and analog videolab metaphor

#####{source} PImage
- pristine original source.  the mother mold
- provides a copy to a specific channel for DISPLAY and/or MONITOR
- is never itself altered or displayed

#####chnl{x}_MONITOR PImage
- provides view of unaltered source
- always appears in the same place in the mx_MONITOR
- becomes the texture used for the MONITOR shape


#####chnl{x}_DISPLAY PImage
- receives a source
- image processing takes place when pixel values are copied from source to DISPLAY
- becomes the texture used for DISPLAY

#####mx_MONITOR PImage
- contains all chnl<x>_MONITOR textures
- has blue background
- can display each chnl<x>_DISPLAY separately



___________________________
###Controller Components (touchOSC)

####chnl{x}_CONTROLLER

#####chnl{x}_SEND 
- select new image
- send chnl<x>_DISPLAY to mx_MONITOR where it can be isolated for evaluation, test, etc. seen above the blue test background of mx_MONITOR
- by default, the chnl<x>_MONITOR always appears on mx_MONITOR, so no need to toggle this
- send chnl<x>_DISPLAY to mx_OUTPUT to view on main screen

#####chnl{x}_POSITION
- vertex-location-control
     - 4 2D grids, each control one corner
- image-location-control (used with imageMode(CENTER); )
     - 1 2D grid to position the object
- scale
- rotate
- rotateZ ????

#####chnl{x}_PIXELS
- alpha threshold
     - at what level of brightness does alpha go to 100%
     - this forms an irregular shape.  not sure if this will work if the image is a vertex based shape.  it should punch holes in the shape, no?  see the layers underneath? sheet hope so
- alpha level
     - adjust the overall alpha of that channel
- blendModes
     - blends each pixel as they are copied to the mx_OUTPUT
     - ideally, blend modes can be applied from current chnl to any other chnl or from chnl to mx_OUTPUT.



___________________________
####functions to implement

#####blendColor();
- applies blend from one pixel to another as pixel by pixel are copied over from pixels[]
- this can be applied from chnl<x> to chnl<z> or from the composite of all non-silhouette chnls to the silhouette in the final steps of mx_OUTPUT.  (Was that an uncontrived use of 'chnl<z>' in a project?  Nice! Gettin' nothin' but static.)
```
//exact syntax unknow, but prolly something like:
mxOUTPUT.pixels[loc] = blendColor(journal.pixels[loc], silhouette.pixels[loc], HARD_LIGHT);
```
- includes: BLEND, DARKEST, LIGHTEST, SOFT_LIGHT, etc
- use this to blend between images, or to apply mask
- use with silhouette
- ideally, blend modes can be applied from current chnl to any other chnl or from chnl to mx_OUTPUT.
- think like shiffman
```
bufferMixesSignal.loadPixels();
accumulateForces(); --> into a single force
applyForce();
updatePixels into a buffer mixerStation
```

#####blend(img, x,y,h,d, u,v,uw,vh, BLENDMODE);
- apply blend mode from piece of img to piece of graphics window


#####filter(<filteName>, <factor>);
- modifies the graphics window directly
- INVERT may be the most useful, like the old MX-1 Videonics effect
```
// create negative/positive oscillation by inverting then apply unfiltered 
1. feedback layer get the unfiltered mx_OUTPUT
2. draw mx_OUTPUT to screen
3. apply INVERT to the screen
4. draw unfiltered texture map to the screen
```

#####tint(r,g,b,a); 
- applied directly to graphics window
- use this to create transparency
```
// shade output RED
tint(255,0,0);
image(myImage,0,0);

// shut it off
noTint();

// create transparency
image(opaqueImage, 0,0);
tint(255,255,255,)
```





#####copy(); 
- copies portion of display window and places it back into display
- or copies portion of source image and places into display window
```
// copy from processing screen back to processing screen
copy(sx, sy, sw, sh, dx, dy, dw, dh); 
{'fraction_non_alphanumeric': 0.08648272664038952, 'fraction_numerical': 0.007883143983306284, 'mean_word_length': 4.381784154709919, 'pattern_counts': {'":': 0, '<': 23, '<?xml version=': 0, '>': 27, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 2, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4245716', 'n_tokens_mistral': 2617, 'n_tokens_neox': 2457, 'n_words': 1126}