Scheduled service maintenance on November 22


On Friday, November 22, 2024, between 06:00 CET and 18:00 CET, GIN services will undergo planned maintenance. Extended service interruptions should be expected. We will try to keep downtimes to a minimum, but recommend that users avoid critical tasks, large data uploads, or DOI requests during this time.

We apologize for any inconvenience.

.yarn-metadata.json 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. {
  2. "manifest": {
  3. "name": "bitmap-sdf",
  4. "version": "1.0.3",
  5. "description": "Calculate SDF for image/bw-data/array",
  6. "main": "index.js",
  7. "dependencies": {
  8. "clamp": "^1.0.1"
  9. },
  10. "devDependencies": {
  11. "enable-mobile": "^1.0.7",
  12. "bubleify": "^0.7.0"
  13. },
  14. "scripts": {
  15. "test": "budo test",
  16. "build": "browserify test.js -g bubleify | indexhtmlify | metadataify | github-cornerify > index.html"
  17. },
  18. "repository": {
  19. "type": "git",
  20. "url": "git+https://github.com/dfcreative/bitmap-sdf.git"
  21. },
  22. "keywords": [
  23. "sdf",
  24. "signed-distance",
  25. "image-sdf",
  26. "bitmap",
  27. "bwdist",
  28. "tiny-sdf"
  29. ],
  30. "author": {
  31. "name": "Dima Yv",
  32. "email": "dfcreative@gmail.com"
  33. },
  34. "license": "MIT",
  35. "bugs": {
  36. "url": "https://github.com/dfcreative/bitmap-sdf/issues"
  37. },
  38. "homepage": "https://github.com/dfcreative/bitmap-sdf#readme",
  39. "_registry": "npm",
  40. "_loc": "/home/jovyan/.cache/yarn/v6/npm-bitmap-sdf-1.0.3-c99913e5729357a6fd350de34158180c013880b2-integrity/node_modules/bitmap-sdf/package.json",
  41. "readmeFilename": "readme.md",
  42. "readme": "# bitmap-sdf [![unstable](https://img.shields.io/badge/stability-unstable-green.svg)](http://github.com/badges/stability-badges)\n\nCalculate signed distance field for an image / bw-data. Fork of [tiny-sdf](https://github.com/mapbox/tiny-sdf) with reduced API.\n\n![bitmap-sdf](https://raw.githubusercontent.com/dfcreative/bitmap-sdf/master/preview.png)\n\n[Demo](https://dfcreative.github.io/bitmap-sdf/)\n\n## Usage\n\n[![npm install bitmap-sdf](https://nodei.co/npm/bitmap-sdf.png?mini=true)](https://npmjs.org/package/bitmap-sdf/)\n\n```js\nlet calcSdf = requrie('bitmap-sdf')\n\n//draw image\nlet canvas = document.body.appendChild(document.createElement('canvas'))\nlet w = canvas.width = 200, h = canvas.height = 200\nlet ctx = canvas.getContext('2d')\nctx.fillStyle = 'white'\nctx.font = 'bold 30px sans-serif'\nctx.fillText('X', 20, 20)\n\n//calculate distances\nlet distances = calcSdf(canvas)\n\n//show distances\nlet imgArr = new Uint8ClampedArray(w*h*4)\nfor (let i = 0; i < w; i++) {\n\tfor (let j = 0; j < h; j++) {\n\t\timgArr[j*w*4 + i*4 + 0] = arr[j*w+i]*255\n\t\timgArr[j*w*4 + i*4 + 1] = arr[j*w+i]*255\n\t\timgArr[j*w*4 + i*4 + 2] = arr[j*w+i]*255\n\t\timgArr[j*w*4 + i*4 + 3] = 255\n\t}\n}\nvar data = new ImageData(imgArr, w, h)\nctx.putImageData(data, 0, 0)\n```\n\n### dist = calcSdf(source, options?)\n\nCalculate distance field for the input `source` data, based on `options`. Returns 1-channel array with distance values from `0..1` range.\n\n#### Source:\n\nType | Meaning\n---|---\n_Canvas_, _Context2D_ | Calculates sdf for the full canvas image data based on `options.channel`, by default `0`, ie. red channel.\n_ImageData_ | Calculates sdf for the image data based on `options.channel`\n_Uint8ClampedArray_, _Uint8Array_ | Handles raw pixel data, requires `options.width` and `options.height`. Stride is detected from `width` and `height`.\n_Float32Array_, _Array_ | Handles raw numbers from `0..1` range, requires `options.width` and `options.height`. Stride is detected from `width` and `height`.\n\n#### Options:\n\nProperty | Default | Meaning\n---|---|---\n`cutoff` | `0.25` | Cutoff parameter, balance between SDF inside `1` and outside `0` of glyph\n`radius` | `10` | Max length of SDF, ie. the size of SDF around the `cutoff`\n`width` | `canvas.width` | Width of input data, if array\n`height` | `canvas.height` | Height of input data, if array\n`channel` | `0` | Channel number, `0` is red, `1` is green, `2` is blue, `3` is alpha.\n`stride` | `null` | Explicitly indicate number of channels per pixel. Not needed if `height` and `width` are provided.\n\n## See also\n\n* [font-atlas-sdf](https://github.com/hughsk/font-atlas-sdf) − generate sdf atlas for a font.\n* [tiny-sdf](https://github.com/mapbox/tiny-sdf) − fast glyph signed distance field generation.\n* [optical-properties](https://github.com/dfcreative/optical-properties) − glyph optical center and bounding box calculation\n\n## License\n\n(c) 2017 Dima Yv. MIT License\n\nDevelopment supported by plot.ly.\n"
  43. },
  44. "artifacts": [],
  45. "remote": {
  46. "resolved": "https://registry.yarnpkg.com/bitmap-sdf/-/bitmap-sdf-1.0.3.tgz#c99913e5729357a6fd350de34158180c013880b2",
  47. "type": "tarball",
  48. "reference": "https://registry.yarnpkg.com/bitmap-sdf/-/bitmap-sdf-1.0.3.tgz",
  49. "hash": "c99913e5729357a6fd350de34158180c013880b2",
  50. "integrity": "sha512-ojYySSvWTx21cbgntR942zgEgqj38wHctN64vr4vYRFf3GKVmI23YlA94meWGkFslidwLwGCsMy2laJ3g/94Sg==",
  51. "registry": "npm",
  52. "packageName": "bitmap-sdf",
  53. "cacheIntegrity": "sha512-ojYySSvWTx21cbgntR942zgEgqj38wHctN64vr4vYRFf3GKVmI23YlA94meWGkFslidwLwGCsMy2laJ3g/94Sg== sha1-yZkT5XKTV6b9NQ3jQVgYDAE4gLI="
  54. },
  55. "registry": "npm",
  56. "hash": "c99913e5729357a6fd350de34158180c013880b2"
  57. }