0.1.3 • Published 1 year ago

@asanka-npm/chameleon v0.1.3

Weekly downloads
-
License
MIT
Repository
github
Last release
1 year ago

Chemeleon

Chameleon

Light weight image uitll with custom shader support

dev build

npx webpack --mode development

package local build

npm pack

Generate .d.ts files from *.js

npx tsc --declaration --outDir dist src/*.js src/**/*.js --allowJs

Usage

import shaderBinder, {FlatGray,GrayScale} from '@asanka-npm/chameleon';
import img from "path/to/your/image"
  ...
const FLatAndGrayRender = ({ width, src, height, }) => {
  const canvasRef = useRef(null);

  const setUpContext = (canvas, name) => {
    FlatGray(name, canvas);
  };

  useEffect(() => {
      const canvas = canvasRef.current;
      if (canvas) {
          setUpContext(canvas, src);
      }
  }, []);

  return <canvas ref={canvasRef}  width={width} height={height}/>;
};
 ...

 return (
    ...
   <FLatAndGrayRender src={img} width={400} height={400}/>
    ...
 )
 ...
0.1.2

1 year ago

0.1.3

1 year ago

0.1.1

1 year ago

0.1.0

1 year ago

0.0.9

1 year ago

0.0.8

1 year ago

0.0.5

1 year ago

0.0.4

1 year ago

0.0.7

1 year ago

0.0.6

1 year ago

0.0.3

1 year ago

0.0.2

1 year ago

0.0.1

1 year ago