i gotta clean up the code before
.greyScaleFilter | 2,4,8,16,32,64 ... 128 bits
.colorFilter | 3, 6, 24 bits
.YCrCbFilter
.medianFilter
.nagaoFilter ( an other median filter by sort matrice )
.graphColorFilter : Canvas Graphic color
var opts;
var guid = graphicalUserInterface( opts = {
monitor: DOMHtml canvas,
width: uint x,
height: uint y,
rgba: bool useRGBA
});Global :
methods :
parameters : DOMImage node
@return void
guid.drawImage( imgNode );parameters : int color || str color
@return void
guid.resetScreen( 0 );parameters : uint x, uint y
@return void
guid.resize( 320, 400 );parameters : uint offset
@return uint colorRGB
guid.getRawPixel( 256 );parameters : uint offset, uint color
@return void
guid.setRawPixel( 255, 16777215 );parameters : uint x, uint y
@return uint colorRGB
guid.getPixel( 1, 0 );parameters : uint x, uint y, uint color
@return void
guid.setPixel( 1, 0, 16711680 ); // #ff0000 -> red -> 1671168parameters : uint y (, bool key )
@return Array ret[ addr1, addr2,... ] if key is false
@return Array ret[ 1,2,3,.... ] if key is true
var line = guid.getLine( 1 );
line[ y*screen_x ];
line[ y*screen_x +1 ];
var line = guid.getLine( 1, true );
line[ 0 ];
line[ 1 ];parameters : uint y ,[ Array [0,1,2], bool key=true || Array[ offset, offset ] || uintcolor ][, bool key ]
@return void
guid.setLine( 1, 255 );
guid.setLine( 2, [ scree_x*y => 16777215, screen_x*y+1 =>255 ,...] );
guid.setLine( 2, [ 0 => 16777215, 1 =>255 ,...], true );parameters : void @return void
guid.refresh( );parameters : void
@return void
guid.snapshot( ); // dataURLparameters : callback
@return void
guid.each( function( addr, colorUint32, JSON rgb, uint32 x, uint32 y ){
this == guid or buffer if opts.buffer is declared
}); gui.bind( 1, 1, 10, 1, 0x00ff00 )gui.bind( 10, 50, 20, 0x00ff00 ) hprop = {
__code: *Array* binaryImage
angle: *int* angle,
x: *int* to
y: *int* to
overflow: *int32* colorDisplay
}gui.rot( hprop, 20, 50 )@return Object
JSON opts {
mod:0 or 1 or 2
offsetTilesX : uint32 x,
offsetTilesY : uint32 y,
mod:0,
center: 1 or 0
//
mod:1
palette: Array PaletteColor[...,...]
//
buffer: Array[]
}
parameters : callback
@return void
var tile = [
0, 0xfefefe, 0xfafafa, 0xffffff ... // color data
...
];
// mod 0
// 8*8
var mtile= guid.tiles({
mod:0,
offsetTilesX: 8,
offsetTileY: 8,
}).setTiles( screen_x, screen_y, tile );var mtile= guid.tiles({
mod:0,
offsetTilesX: 8,
offsetTileY: 8,
center: true,
}).setTilesByOffset( 5, tile ); // mod 1
// 8*8
var tile = [
0,3,3,2
0,2,2,1
...
];
guid.tiles({
mod:1,
offsetTilesX: 8,
offsetTilesY:8
palette:[
0, 0xfefefe, 0xfafafa, 0xffffff ... // color data
],
})( screen_x, screen_y, tile )
// mod 2
// 9*8
var tile = [
0,0,0,0,0,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,0,0,1,1,0,0,0,
0,1,1,1,1,1,1,0,
0,0,1,1,1,1,0,0,
0,0,0,1,1,0,0,0,
0,0,0,0,0,0,0,0,
0,0,0,0,0,0,0,0,
...
];
guid.tiles({
mod:1,
offsetTilesX: 8,
offsetTiesY:9,
palette:[
0, 0xfefefe, 0xfafafa, 0xffffff ... // color data
],
})( screen_x, screen_y, tile, 1 color font 0xfefefe , 0 background || null )###intToRgb
parameters : uint color
@return JSON { r: uint, g: uint g, b: uint b }
var color = guid.rgb( 16777215 );
color.r // 255
color.g // 255
color.b // 255



