uigraph 1.0.0 → 1.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (319) hide show
  1. package/dist/bin.mjs +134 -56911
  2. package/dist/viewer/assets/abnfDiagram-VCTEODGH-D7zWJuPJ.js +1 -0
  3. package/dist/viewer/assets/actor-avatar-Bu-mKKXB.js +1 -0
  4. package/dist/viewer/assets/{api-adapters-CnQpLiWI.js → api-adapters-tfr51BsS.js} +1 -1
  5. package/dist/viewer/assets/{api-endpoints-DCA5GNpC.js → api-endpoints-D-Whnnwd.js} +9 -9
  6. package/dist/viewer/assets/{api-group-endpoints-page-Di42W69y.js → api-group-endpoints-page-B9R1EI4i.js} +9 -9
  7. package/dist/viewer/assets/{arc-Cn8owoDw.js → arc-DauzQXFu.js} +1 -1
  8. package/dist/viewer/assets/architectureDiagram-5GKGNRK7-CXzgHd-c.js +36 -0
  9. package/dist/viewer/assets/{arrow-left-DWcMgM2U.js → arrow-left-DpQqmf17.js} +1 -1
  10. package/dist/viewer/assets/avatar-DAFUyk1i.js +43 -0
  11. package/dist/viewer/assets/badge-hR3QvPWv.js +1 -0
  12. package/dist/viewer/assets/better-delete-confirmation-modal-CGEQ5O4X.js +1 -0
  13. package/dist/viewer/assets/better-dialog-DcIxFWwk.js +1 -0
  14. package/dist/viewer/assets/{blockDiagram-I7D4REHJ-CbYzOsL_.js → blockDiagram-I7D4REHJ-CFHWUw4z.js} +2 -2
  15. package/dist/viewer/assets/{brands-Bd4RklRx.js → brands-DtmA1AhP.js} +1 -1
  16. package/dist/viewer/assets/button-DZj74qS7.js +1 -0
  17. package/dist/viewer/assets/{c4Diagram-7LVT6UL2-CLkVbphC.js → c4Diagram-7LVT6UL2-BHSggPKI.js} +6 -6
  18. package/dist/viewer/assets/{calendar-C0xdI_ag.js → calendar-Bolgc8E5.js} +1 -1
  19. package/dist/viewer/assets/channel-CNRSofFP.js +1 -0
  20. package/dist/viewer/assets/{check-XjanpAFg.js → check-BpmCQNbj.js} +1 -1
  21. package/dist/viewer/assets/checkbox-CFJfXL6R.js +1 -0
  22. package/dist/viewer/assets/{chevron-down-R7pQzyLD.js → chevron-down-DDsUE_xz.js} +1 -1
  23. package/dist/viewer/assets/{chevron-up-CRPypfOs.js → chevron-up-DVznKMGv.js} +1 -1
  24. package/dist/viewer/assets/{chunk-2Q5K7J3B-CcvtugCu.js → chunk-2Q5K7J3B-CNfz5YDQ.js} +1 -1
  25. package/dist/viewer/assets/{chunk-5VM5RSS4-CpZHHr12.js → chunk-5VM5RSS4-CwIhjvMe.js} +1 -1
  26. package/dist/viewer/assets/{chunk-F27PBJKO-DeAl4iOc.js → chunk-F27PBJKO-YFexFJof.js} +1 -1
  27. package/dist/viewer/assets/{chunk-IMKFNOWR-BfrPe7pS.js → chunk-IMKFNOWR-GY2yrvuo.js} +1 -1
  28. package/dist/viewer/assets/{chunk-JWPE2WC7-DDjyvUmZ.js → chunk-JWPE2WC7-xd0JGvne.js} +1 -1
  29. package/dist/viewer/assets/chunk-OB3PAWPO-DJIP1M4r.js +12 -0
  30. package/dist/viewer/assets/{chunk-POPQ4Y6H-DkDb0mzz.js → chunk-POPQ4Y6H-Bh6rizEy.js} +1 -1
  31. package/dist/viewer/assets/{chunk-SVP7TREG-D-K2XIGs.js → chunk-SVP7TREG-DtNrjvpq.js} +1 -1
  32. package/dist/viewer/assets/{chunk-TICWLB2K-DWMQQx6z.js → chunk-TICWLB2K-DrERwtw8.js} +1 -1
  33. package/dist/viewer/assets/{chunk-XXDRQBXY-DfkljAyM.js → chunk-XXDRQBXY-fYo04iwY.js} +1 -1
  34. package/dist/viewer/assets/{circle-alert-pm13M-Ef.js → circle-alert-Bl7DXYD_.js} +1 -1
  35. package/dist/viewer/assets/classDiagram-ZZMXUADV-D7PO-ME9.js +1 -0
  36. package/dist/viewer/assets/classDiagram-v2-VYDZK3BY-D7PO-ME9.js +1 -0
  37. package/dist/viewer/assets/color-input-ClkkG_kZ.js +11 -0
  38. package/dist/viewer/assets/{common-Y7ySZBdh.js → common-DLCsGQ-t.js} +1 -1
  39. package/dist/viewer/assets/{component-icons-D1BDAuEt.js → component-icons-MJ61E9nt.js} +2 -2
  40. package/dist/viewer/assets/{copy-CN4K2f_R.js → copy-DMJJonQF.js} +1 -1
  41. package/dist/viewer/assets/cose-bilkent-JH36ORCC-Dplz8nVT.js +1 -0
  42. package/dist/viewer/assets/cross-button-D5qst1tj.js +1 -0
  43. package/dist/viewer/assets/{cynefin-OW5HDTMX-yz-uw9Kz.js → cynefin-OW5HDTMX-DiBs4CI8.js} +1 -1
  44. package/dist/viewer/assets/cynefinDiagram-5FMLGOSQ-COXS8-dI.js +62 -0
  45. package/dist/viewer/assets/{dagre-GXQ25YYZ-zjZDwXOe.js → dagre-GXQ25YYZ-K8qvfG8D.js} +2 -2
  46. package/dist/viewer/assets/dashboard-diagrams-page-Cb0xNr4W.js +2 -0
  47. package/dist/viewer/assets/dashboard-diagrams-page-inner-CD--zr5q.js +1 -0
  48. package/dist/viewer/assets/dashboard-docs-page-BfWR9Ai9.js +2 -0
  49. package/dist/viewer/assets/dashboard-docs-page-inner-BLbX-YwF.js +67 -0
  50. package/dist/viewer/assets/dashboard-layout-sTeeHNsZ.js +1 -0
  51. package/dist/viewer/assets/dashboard-lens-layout-D-tu_4kn.js +1 -0
  52. package/dist/viewer/assets/dashboard-map-frame-page-7pDmbTSe.js +1 -0
  53. package/dist/viewer/assets/dashboard-plans-page-CfwOZ34A.js +1 -0
  54. package/dist/viewer/assets/dashboard-service-apis-k93fjW51.js +1 -0
  55. package/dist/viewer/assets/{dashboard-service-diagrams-CIjk95Jk.js → dashboard-service-diagrams-BIWUxX-Y.js} +3 -3
  56. package/dist/viewer/assets/dashboard-service-docs-CnniTD6Q.js +1 -0
  57. package/dist/viewer/assets/{dashboard-service-overview-CzePVPjl.js → dashboard-service-overview-CGBu4omY.js} +5 -5
  58. package/dist/viewer/assets/dashboard-services-DEscIO2O.js +1 -0
  59. package/dist/viewer/assets/{db-type-badge-DOgu1Pyc.js → db-type-badge-UbPgpwQf.js} +2 -2
  60. package/dist/viewer/assets/debounce-Cp8eREM4-D7o-Pzb-.js +2 -0
  61. package/dist/viewer/assets/{dependencies-CYdEztHw.js → dependencies-DK2GDlhQ.js} +1 -1
  62. package/dist/viewer/assets/{dependency-graph-DbyfN-rC.js → dependency-graph-xBEnCS0J.js} +3 -3
  63. package/dist/viewer/assets/{diagram-S7CK7UJ4-q-NHkUCx.js → diagram-S7CK7UJ4-D-liadVe.js} +2 -2
  64. package/dist/viewer/assets/diagram-UQ7AKVKN-CnA8mgXp.js +41 -0
  65. package/dist/viewer/assets/{diagram-VSXAHHWV-DZc1kHGx.js → diagram-VSXAHHWV-Ck7dgRFR.js} +2 -2
  66. package/dist/viewer/assets/diagram-VX7I27RA-Cm1LHbu3.js +24 -0
  67. package/dist/viewer/assets/diagram-Z3DM3KII-DV3yBUCB.js +24 -0
  68. package/dist/viewer/assets/diagram-live-preview-DzJ7Nxp1.js +2 -0
  69. package/dist/viewer/assets/{diagram-portal-page-CWxuok9E.js → diagram-portal-page-gguGLULH.js} +24 -24
  70. package/dist/viewer/assets/{diagrams-C1xkRPqT.js → diagrams-BqBSv2eb.js} +4 -4
  71. package/dist/viewer/assets/dialog-D7wzTt0L.js +6 -0
  72. package/dist/viewer/assets/{doc-file-content-B06roi8L.js → doc-file-content-Be0au9Vo.js} +4 -4
  73. package/dist/viewer/assets/{download-CLdCXVsO.js → download-DhyZ3g4F.js} +1 -1
  74. package/dist/viewer/assets/ebnfDiagram-PWID7BFC-BXbHVQvG.js +1 -0
  75. package/dist/viewer/assets/{editor-vqK4qAnB.js → editor-F9o4zoeB.js} +2 -2
  76. package/dist/viewer/assets/{erDiagram-RLTQ6QDP-BWuA-aqV.js → erDiagram-RLTQ6QDP-DMfiWput.js} +2 -2
  77. package/dist/viewer/assets/{file-text-BvszilVL.js → file-text-BFqJQ67P.js} +1 -1
  78. package/dist/viewer/assets/flow-diagram-preview-B83UU1n_.js +1 -0
  79. package/dist/viewer/assets/{flowDiagram-HODETNUW-Db0QtNj4.js → flowDiagram-HODETNUW-BNFS2Mkr.js} +1 -1
  80. package/dist/viewer/assets/ganttDiagram-EL5Y4UJY-DFDsYJNp.js +292 -0
  81. package/dist/viewer/assets/gitGraphDiagram-WWUBYQGX-BVHabPDp.js +106 -0
  82. package/dist/viewer/assets/global-loader-XJO9_e0l.js +1 -0
  83. package/dist/viewer/assets/{globe-Jl6eIZmG.js → globe-CJ35KsQW.js} +1 -1
  84. package/dist/viewer/assets/gql-FFIj8zdp.js +1 -0
  85. package/dist/viewer/assets/{grid-scroll-body-CPqSxU6-.js → grid-scroll-body-DC5pYDPJ.js} +2 -2
  86. package/dist/viewer/assets/iconBase-DtqdW2XR.js +1 -0
  87. package/dist/viewer/assets/index-B6MxYIzs.js +1 -0
  88. package/dist/viewer/assets/index-BC5xdBQU.js +48 -0
  89. package/dist/viewer/assets/index-BIrx3oY4.js +1 -0
  90. package/dist/viewer/assets/{index-jm22RWpY.js → index-BZGsDmUx.js} +5 -5
  91. package/dist/viewer/assets/{index-Poftp9f1.js → index-BZXhpoWr.js} +4 -4
  92. package/dist/viewer/assets/index-Bn2bqqMd.js +1 -0
  93. package/dist/viewer/assets/{index-HU5pz3kj.js → index-BpCVYTvP.js} +36 -36
  94. package/dist/viewer/assets/{index-Bt2YHgxl.js → index-CBOYhBKJ.js} +1 -1
  95. package/dist/viewer/assets/index-CH7cEAxj.js +17 -0
  96. package/dist/viewer/assets/index-CIf0GId3.js +74 -0
  97. package/dist/viewer/assets/{index-D7MEHpJf.js → index-Ck66Ic_p.js} +4 -4
  98. package/dist/viewer/assets/index-Cp9mIQ8F.js +1 -0
  99. package/dist/viewer/assets/{index-c6Bxcoqm.js → index-DDmBuMKI.js} +1 -1
  100. package/dist/viewer/assets/{index-BSyJbFDG.js → index-DY3BFyb6.js} +1 -1
  101. package/dist/viewer/assets/{index-BS94XVnd.js → index-DkzZ-ZvR.js} +1 -1
  102. package/dist/viewer/assets/{index-C_43VC19.js → index-PglMbhys.js} +1 -1
  103. package/dist/viewer/assets/infoDiagram-27XIBGKW-CG-wwxBf.js +2 -0
  104. package/dist/viewer/assets/input--C59pq6j.js +1 -0
  105. package/dist/viewer/assets/{ishikawaDiagram-5VMMS53U-C4PzFnZ4.js → ishikawaDiagram-5VMMS53U-BlgV7ceJ.js} +2 -2
  106. package/dist/viewer/assets/{journeyDiagram-3NMN7TZE-Dpn3bBNo.js → journeyDiagram-3NMN7TZE-Cn03_Xl6.js} +2 -2
  107. package/dist/viewer/assets/{kanban-definition-UXKFOSKX-CJ99H4G6.js → kanban-definition-UXKFOSKX-CJogvDPY.js} +6 -6
  108. package/dist/viewer/assets/{layout-Bfvxt_D5.js → layout-B26eC4yQ.js} +1 -1
  109. package/dist/viewer/assets/{lens-run-page-DZneics-.js → lens-run-page-Ba1ppzJt.js} +3 -3
  110. package/dist/viewer/assets/lens-runs-page-BnUS57LM.js +1 -0
  111. package/dist/viewer/assets/{link-2-C75goIOt.js → link-2-D1e0xznG.js} +1 -1
  112. package/dist/viewer/assets/linked-project-dot-BY1gEES9.js +543 -0
  113. package/dist/viewer/assets/{loader-circle-C5jZoM7X.js → loader-circle-CiqyoJF7.js} +1 -1
  114. package/dist/viewer/assets/{merge-Cy7YkrN7.js → merge-BhOMvhW1.js} +1 -1
  115. package/dist/viewer/assets/mermaid.core-BDgZg3kW.js +312 -0
  116. package/dist/viewer/assets/method-badge-DErZP7y5.js +1 -0
  117. package/dist/viewer/assets/{mindmap-definition-YA3MSWOX-yQCKA-K4.js → mindmap-definition-YA3MSWOX-DFkLu0ac.js} +2 -2
  118. package/dist/viewer/assets/nav-links-DZWMpwMR.js +61 -0
  119. package/dist/viewer/assets/{network-COWNXGMM.js → network-B1apzT1s.js} +1 -1
  120. package/dist/viewer/assets/{nosql-editor-modal-DTiWkc_r.js → nosql-editor-modal-CvH0SWAi.js} +5 -5
  121. package/dist/viewer/assets/not-found-page-C-fn8QeM.js +1 -0
  122. package/dist/viewer/assets/organization-dependency-graph-page-BryP-iJL.js +1 -0
  123. package/dist/viewer/assets/pegDiagram-XKGWAZYB-g1cM14-L.js +1 -0
  124. package/dist/viewer/assets/{pieDiagram-E7YTZNPT-DqnkpCX4.js → pieDiagram-E7YTZNPT-WEnDsMY3.js} +2 -2
  125. package/dist/viewer/assets/{plus-DQakmTjA.js → plus-DbyuOgKB.js} +1 -1
  126. package/dist/viewer/assets/popover-476u3TN0.js +1 -0
  127. package/dist/viewer/assets/preload-helper-BlTxHScW.js +1 -0
  128. package/dist/viewer/assets/{quadrantDiagram-AXDQQJYC-iQjJfars.js → quadrantDiagram-AXDQQJYC-NdfQCpzF.js} +2 -2
  129. package/dist/viewer/assets/query-D9oj6LGx.js +50 -0
  130. package/dist/viewer/assets/{quill-rCHj4fCw.js → quill-Cde5JMRD.js} +1 -1
  131. package/dist/viewer/assets/railroadDiagram-O6MQD6OU-BYhlXlMY.js +1 -0
  132. package/dist/viewer/assets/{react-BNzYaZuG.js → react-Bx48XWN4.js} +1 -1
  133. package/dist/viewer/assets/react-flow-wrapper-BcbvHgxz.js +277 -0
  134. package/dist/viewer/assets/{requirementDiagram-BXWQKSXE-Bv-Vh1dW.js → requirementDiagram-BXWQKSXE-C25Bcm2L.js} +2 -2
  135. package/dist/viewer/assets/{sankeyDiagram-P5KCCOFB-C__uD07f.js → sankeyDiagram-P5KCCOFB-h8LiCsgk.js} +2 -2
  136. package/dist/viewer/assets/scroll-area-RagrStGj.js +6 -0
  137. package/dist/viewer/assets/{search-DW-qhXLk.js → search-vw7ucoOs.js} +1 -1
  138. package/dist/viewer/assets/section-loader-C4hOfhQS.js +1 -0
  139. package/dist/viewer/assets/section-not-found-BnrXiPog.js +1 -0
  140. package/dist/viewer/assets/select-D9fbrr7O.js +1 -0
  141. package/dist/viewer/assets/{sequenceDiagram-WJ2MYXX4-1RbvcHwO.js → sequenceDiagram-WJ2MYXX4-CDRVvD30.js} +2 -2
  142. package/dist/viewer/assets/{service-context-C17u_Fw9.js → service-context-D5nBtU18.js} +1 -1
  143. package/dist/viewer/assets/{service-database-list-page-cYuDHIls.js → service-database-list-page-DBjaDLVy.js} +2 -2
  144. package/dist/viewer/assets/service-database-page-CenNCgwf.js +2 -0
  145. package/dist/viewer/assets/service-database-page-inner-gS51TQTZ.js +85 -0
  146. package/dist/viewer/assets/{service-doc-Dir8g83J.js → service-doc-C-jHqT1U.js} +4 -4
  147. package/dist/viewer/assets/{service-doc-preview-modal-bJ6tJ5YR.js → service-doc-preview-modal-5sX6FOu1.js} +2 -2
  148. package/dist/viewer/assets/service-layout-Bf0vZBCH.js +1 -0
  149. package/dist/viewer/assets/service-pages-CFikvX4t.js +1 -0
  150. package/dist/viewer/assets/{services-Crqkffr5.js → services-Ivav34WC.js} +4 -4
  151. package/dist/viewer/assets/{share-2-BmYmqN4k.js → share-2-CQEaWbfH.js} +1 -1
  152. package/dist/viewer/assets/sizeCapture-INFHLROL-BJ6ndnPM.js +1 -0
  153. package/dist/viewer/assets/stateDiagram-D77RDMKH-B_tNCX3o.js +1 -0
  154. package/dist/viewer/assets/stateDiagram-v2-MP3YSRHH-Dl9wqdli.js +1 -0
  155. package/dist/viewer/assets/{style-DgSU0bQl.js → style-BPesJvJr.js} +8 -8
  156. package/dist/viewer/assets/super-circle-loader-DSkos6uP.js +1 -0
  157. package/dist/viewer/assets/super-logo-loader-Cxlbn6MB.js +1 -0
  158. package/dist/viewer/assets/swimlanes-42K2YHIH-CzURzYwf.js +1 -0
  159. package/dist/viewer/assets/swimlanesDiagram-VR7AAH4N-DrIlwFtk.js +8 -0
  160. package/dist/viewer/assets/table-B4pFND-o.js +1 -0
  161. package/dist/viewer/assets/textarea-Clgdv3Oi.js +1 -0
  162. package/dist/viewer/assets/{timeline-definition-24CTP7MA-C4yuLwUH.js → timeline-definition-24CTP7MA-D0YXQE1U.js} +2 -2
  163. package/dist/viewer/assets/ui-graph-logo-gHowu5gP.js +1 -0
  164. package/dist/viewer/assets/{upload-CRsS43j9.js → upload-CYb3nN_5.js} +1 -1
  165. package/dist/viewer/assets/{uploads-BOQHX9l4.js → uploads-CX2kdXbM.js} +8 -8
  166. package/dist/viewer/assets/{use-debounced-value-Ba-kkCUY.js → use-debounced-value-BpNFJd3C.js} +1 -1
  167. package/dist/viewer/assets/{use-localstorage-DIisTx-J.js → use-localstorage-D233xVb0.js} +1 -1
  168. package/dist/viewer/assets/use-permissions-BvmxJJ5r.js +1 -0
  169. package/dist/viewer/assets/{use-scoped-storage-C4RzED-E.js → use-scoped-storage-DL1XVp1j.js} +1 -1
  170. package/dist/viewer/assets/useMutation-D5ZHwHsx.js +1 -0
  171. package/dist/viewer/assets/useQuery-Dhe6uxrL.js +1 -0
  172. package/dist/viewer/assets/{vennDiagram-4TSXK5OY-BCtqXZqe.js → vennDiagram-4TSXK5OY-SSjHlqCQ.js} +2 -2
  173. package/dist/viewer/assets/{wardleyDiagram-VM6X3IG4-D3OtZJoT.js → wardleyDiagram-VM6X3IG4-CZWNdQxH.js} +2 -2
  174. package/dist/viewer/assets/{xychartDiagram-S5SC5T6Z-DxLL2CHH.js → xychartDiagram-S5SC5T6Z-B2qAGeb0.js} +2 -2
  175. package/dist/viewer/assets/zod-BMU4UTQt.js +1 -0
  176. package/dist/viewer/index.html +10 -1
  177. package/package.json +56 -56
  178. package/dist/abort-signals-B4fc3ahg.mjs +0 -34
  179. package/dist/anthropic-messages-KPxCHqBN.mjs +0 -14327
  180. package/dist/auth-storage-BvNH97p9.mjs +0 -2180
  181. package/dist/azure-openai-config-BbeCSg4y.mjs +0 -55
  182. package/dist/azure-openai-responses-BRzy8RfL.mjs +0 -182
  183. package/dist/classifier-shared-DBUHiTGw.mjs +0 -105
  184. package/dist/cli-2R6QQFp1.mjs +0 -451
  185. package/dist/cloudflare-workers-ai-system-one-BfqwmRQf.mjs +0 -44
  186. package/dist/config-D8DMGzIq.mjs +0 -647
  187. package/dist/cross-spawn-B2jIQPlu.mjs +0 -404
  188. package/dist/diagnostics-xdSgQR8t.mjs +0 -131
  189. package/dist/dist-BRyghrKX.mjs +0 -404
  190. package/dist/dist-D0EzrblG.mjs +0 -12161
  191. package/dist/dist-EKhnHWHG.mjs +0 -140221
  192. package/dist/dist-pQtuusFv.mjs +0 -1243
  193. package/dist/easter-egg-3d-C9_btlWn.mjs +0 -1225
  194. package/dist/env-api-keys-uytNub6O.mjs +0 -122
  195. package/dist/error-body-FhmCtR7m.mjs +0 -101
  196. package/dist/esm-D5isprgl.mjs +0 -1533
  197. package/dist/esm-DnqE4pfM.mjs +0 -104876
  198. package/dist/execute-BoTKl80U.mjs +0 -1715
  199. package/dist/github-copilot-headers-DWcTgoXr.mjs +0 -22
  200. package/dist/google-generative-ai-Brs5YpJo.mjs +0 -332
  201. package/dist/google-shared-2CyYa4VE.mjs +0 -33438
  202. package/dist/google-vertex-DZDUQPKa.mjs +0 -378
  203. package/dist/hash-DN7ukSfd.mjs +0 -16
  204. package/dist/headers-GhQHLk-3.mjs +0 -17
  205. package/dist/jiti-9kWALm4Y.mjs +0 -5439
  206. package/dist/jiti-loader-f21DrY1K.mjs +0 -27
  207. package/dist/jiti-static-loader-BI_w28l7.mjs +0 -41704
  208. package/dist/json-parse-B2mHg7o7.mjs +0 -381
  209. package/dist/keybinding-hints-D0nLU3ZH.mjs +0 -17899
  210. package/dist/lib-Dj1gKQJc.mjs +0 -24379
  211. package/dist/llama-cpp-classify-C73BoMYd.mjs +0 -344
  212. package/dist/mistral-conversations-DXVR7znL.mjs +0 -698
  213. package/dist/models-DBdii9gQ.mjs +0 -1255
  214. package/dist/multipart-parser-DLw9Z0uJ.mjs +0 -298
  215. package/dist/node-B0NU8X55.mjs +0 -2479
  216. package/dist/node-B8gaKm9g.mjs +0 -23
  217. package/dist/openai-I3_AqKDX.mjs +0 -17357
  218. package/dist/openai-codex-responses-PcZHDuBD.mjs +0 -1198
  219. package/dist/openai-completions-a_mH01ii.mjs +0 -994
  220. package/dist/openai-decisions-Du8y4mQG.mjs +0 -142
  221. package/dist/openai-prompt-cache-Bc6qNWt0.mjs +0 -8
  222. package/dist/openai-responses-a9lV_U7O.mjs +0 -270
  223. package/dist/openai-responses-shared-CDs_PBiH.mjs +0 -598
  224. package/dist/openrouter-images-D0Zc8Cjs.mjs +0 -125
  225. package/dist/photon_rs-DCvMOMu0.mjs +0 -4252
  226. package/dist/pi-messages-B5ietIBq.mjs +0 -306
  227. package/dist/provider-env-BJhgA66g.mjs +0 -37
  228. package/dist/provider-retry-DXYM7rVE.mjs +0 -79
  229. package/dist/runtime-DTkBxiaM.mjs +0 -2822
  230. package/dist/sanitize-unicode-CqChtoM6.mjs +0 -26
  231. package/dist/shell-836_JFnI.mjs +0 -162
  232. package/dist/source-CKPndhKl.mjs +0 -478
  233. package/dist/src-DNm2QRm3.mjs +0 -5028
  234. package/dist/system-one-shared-DUAFtNa8.mjs +0 -75
  235. package/dist/token-DEUkymby.mjs +0 -56
  236. package/dist/token-util-Cx5S4eKt.mjs +0 -3
  237. package/dist/tool-DHDYqsyG.mjs +0 -6673
  238. package/dist/transform-messages-BClk99Vn.mjs +0 -477
  239. package/dist/typesafe-system-one-D2d8j8hZ.mjs +0 -24
  240. package/dist/typescript-Br-vsRJV.mjs +0 -6737
  241. package/dist/uuid-CNCZqNBb.mjs +0 -49
  242. package/dist/v2-1z8ijsD3.mjs +0 -6120
  243. package/dist/viewer/assets/abnfDiagram-VCTEODGH-j5YaKnl9.js +0 -1
  244. package/dist/viewer/assets/actor-avatar-DqmoY8Xc.js +0 -1
  245. package/dist/viewer/assets/architectureDiagram-5GKGNRK7-D80cJKz_.js +0 -36
  246. package/dist/viewer/assets/avatar-BI7D-Aia.js +0 -43
  247. package/dist/viewer/assets/badge-870-A4Y6.js +0 -1
  248. package/dist/viewer/assets/better-delete-confirmation-modal-Dib31LVb.js +0 -1
  249. package/dist/viewer/assets/better-dialog-D3AAiahr.js +0 -1
  250. package/dist/viewer/assets/button-DadqadpO.js +0 -1
  251. package/dist/viewer/assets/channel-DRkt3LIn.js +0 -1
  252. package/dist/viewer/assets/checkbox-BXpR079x.js +0 -1
  253. package/dist/viewer/assets/classDiagram-ZZMXUADV-G5CebNaC.js +0 -1
  254. package/dist/viewer/assets/classDiagram-v2-VYDZK3BY-G5CebNaC.js +0 -1
  255. package/dist/viewer/assets/color-input-Efm-lxDy.js +0 -11
  256. package/dist/viewer/assets/cose-bilkent-JH36ORCC-CrSHFmnp.js +0 -1
  257. package/dist/viewer/assets/cross-button-5Sr5rWVP.js +0 -1
  258. package/dist/viewer/assets/cynefinDiagram-5FMLGOSQ-Bdl_eBdu.js +0 -62
  259. package/dist/viewer/assets/dashboard-diagrams-page-DMupOe1m.js +0 -2
  260. package/dist/viewer/assets/dashboard-diagrams-page-inner-Dh0yKh2A.js +0 -1
  261. package/dist/viewer/assets/dashboard-docs-page-DWJ1qOQz.js +0 -2
  262. package/dist/viewer/assets/dashboard-docs-page-inner-Fs6G3oGo.js +0 -67
  263. package/dist/viewer/assets/dashboard-layout-D36InAaB.js +0 -1
  264. package/dist/viewer/assets/dashboard-lens-layout-Cv1Xx3hY.js +0 -1
  265. package/dist/viewer/assets/dashboard-map-frame-page-CTn61NUO.js +0 -1
  266. package/dist/viewer/assets/dashboard-plans-page-DxFJkrgK.js +0 -1
  267. package/dist/viewer/assets/dashboard-service-apis-BHtD9s5z.js +0 -1
  268. package/dist/viewer/assets/dashboard-service-docs-Uv_1uxxO.js +0 -1
  269. package/dist/viewer/assets/dashboard-services-CUP-L4Jg.js +0 -1
  270. package/dist/viewer/assets/diagram-UQ7AKVKN-DhFcurW6.js +0 -41
  271. package/dist/viewer/assets/diagram-VX7I27RA-DE1nREE8.js +0 -24
  272. package/dist/viewer/assets/diagram-Z3DM3KII-CSrYcCbc.js +0 -24
  273. package/dist/viewer/assets/diagram-live-preview-i5doxXLH.js +0 -2
  274. package/dist/viewer/assets/dialog-D_HtNS17.js +0 -6
  275. package/dist/viewer/assets/ebnfDiagram-PWID7BFC-BfL8m_sf.js +0 -1
  276. package/dist/viewer/assets/flow-diagram-preview-T0Z4iMVU.js +0 -1
  277. package/dist/viewer/assets/ganttDiagram-EL5Y4UJY-CsITpniw.js +0 -292
  278. package/dist/viewer/assets/gitGraphDiagram-WWUBYQGX-B4eCBGoe.js +0 -106
  279. package/dist/viewer/assets/iconBase-BoDZfJgC.js +0 -1
  280. package/dist/viewer/assets/index-5E1tJ7yK.js +0 -125
  281. package/dist/viewer/assets/index-7XpV2DRw.js +0 -1
  282. package/dist/viewer/assets/index-C0Rs3s9Z.js +0 -1
  283. package/dist/viewer/assets/index-CzHjJWeV.js +0 -1
  284. package/dist/viewer/assets/index-DcEA6SIV.js +0 -74
  285. package/dist/viewer/assets/infoDiagram-27XIBGKW-lTebN5Ix.js +0 -2
  286. package/dist/viewer/assets/input-YvHTVS0E.js +0 -1
  287. package/dist/viewer/assets/lens-runs-page-DoAOObxx.js +0 -1
  288. package/dist/viewer/assets/linked-project-dot-Ds2uEmJ9.js +0 -543
  289. package/dist/viewer/assets/mermaid.core-BCRBv8Us.js +0 -312
  290. package/dist/viewer/assets/method-badge-DMYDKdDZ.js +0 -1
  291. package/dist/viewer/assets/nav-links-8vT2ixiI.js +0 -61
  292. package/dist/viewer/assets/not-found-page-CnfLlhS4.js +0 -1
  293. package/dist/viewer/assets/organization-dependency-graph-page-3xqIxjNx.js +0 -1
  294. package/dist/viewer/assets/pegDiagram-XKGWAZYB-CMXqeAum.js +0 -1
  295. package/dist/viewer/assets/popover-CN9ni1N3.js +0 -1
  296. package/dist/viewer/assets/railroadDiagram-O6MQD6OU-CfqToX3W.js +0 -1
  297. package/dist/viewer/assets/react-flow-wrapper-BPlRstyO.js +0 -276
  298. package/dist/viewer/assets/scroll-area-BodE-n7W.js +0 -6
  299. package/dist/viewer/assets/section-loader-BzpYM_Nx.js +0 -1
  300. package/dist/viewer/assets/select-DDtnmSET.js +0 -1
  301. package/dist/viewer/assets/service-database-page-CMi1wF4h.js +0 -2
  302. package/dist/viewer/assets/service-database-page-inner-CoqAj93L.js +0 -85
  303. package/dist/viewer/assets/service-layout-0NMm_bKG.js +0 -1
  304. package/dist/viewer/assets/service-pages-dfnc91SU.js +0 -1
  305. package/dist/viewer/assets/sizeCapture-INFHLROL-BRJi3gCg.js +0 -1
  306. package/dist/viewer/assets/stateDiagram-D77RDMKH-DdLsfxgy.js +0 -1
  307. package/dist/viewer/assets/stateDiagram-v2-MP3YSRHH-DFwg8Qki.js +0 -1
  308. package/dist/viewer/assets/super-circle-loader-D8MElOMh.js +0 -1
  309. package/dist/viewer/assets/super-logo-loader-DJYiRbCS.js +0 -1
  310. package/dist/viewer/assets/swimlanes-42K2YHIH-AuYjrPqh.js +0 -1
  311. package/dist/viewer/assets/swimlanesDiagram-VR7AAH4N-0nIGA8_4.js +0 -8
  312. package/dist/viewer/assets/table-Bi4Auk9Z.js +0 -1
  313. package/dist/viewer/assets/textarea-MgxZ5x6-.js +0 -1
  314. package/dist/viewer/assets/ui-graph-logo-D4jRhd4z.js +0 -1
  315. package/dist/viewer/assets/use-permissions-6JVET753.js +0 -1
  316. package/dist/viewer/assets/useMutation-CmVaR9zz.js +0 -1
  317. package/dist/viewer/assets/useQuery-B8yYhO0c.js +0 -1
  318. package/dist/viewer/assets/zod-Dc4H6VVJ.js +0 -1
  319. package/dist/virtual-modules-DnCx0Gdx.mjs +0 -340
@@ -1,4252 +0,0 @@
1
- import { i as __require, t as __commonJSMin } from "./bin.mjs";
2
- //#region node_modules/.pnpm/@silvia-odwyer+photon-node@0.3.4/node_modules/@silvia-odwyer/photon-node/photon_rs.js
3
- var require_photon_rs = /* @__PURE__ */ __commonJSMin(((exports, module) => {
4
- let imports = {};
5
- imports["__wbindgen_placeholder__"] = module.exports;
6
- let wasm;
7
- const { TextEncoder, TextDecoder } = __require("util");
8
- function debugString(val) {
9
- const type = typeof val;
10
- if (type == "number" || type == "boolean" || val == null) return `${val}`;
11
- if (type == "string") return `"${val}"`;
12
- if (type == "symbol") {
13
- const description = val.description;
14
- if (description == null) return "Symbol";
15
- else return `Symbol(${description})`;
16
- }
17
- if (type == "function") {
18
- const name = val.name;
19
- if (typeof name == "string" && name.length > 0) return `Function(${name})`;
20
- else return "Function";
21
- }
22
- if (Array.isArray(val)) {
23
- const length = val.length;
24
- let debug = "[";
25
- if (length > 0) debug += debugString(val[0]);
26
- for (let i = 1; i < length; i++) debug += ", " + debugString(val[i]);
27
- debug += "]";
28
- return debug;
29
- }
30
- const builtInMatches = /\[object ([^\]]+)\]/.exec(toString.call(val));
31
- let className;
32
- if (builtInMatches.length > 1) className = builtInMatches[1];
33
- else return toString.call(val);
34
- if (className == "Object") try {
35
- return "Object(" + JSON.stringify(val) + ")";
36
- } catch (_) {
37
- return "Object";
38
- }
39
- if (val instanceof Error) return `${val.name}: ${val.message}\n${val.stack}`;
40
- return className;
41
- }
42
- let WASM_VECTOR_LEN = 0;
43
- let cachedUint8ArrayMemory0 = null;
44
- function getUint8ArrayMemory0() {
45
- if (cachedUint8ArrayMemory0 === null || cachedUint8ArrayMemory0.byteLength === 0) cachedUint8ArrayMemory0 = new Uint8Array(wasm.memory.buffer);
46
- return cachedUint8ArrayMemory0;
47
- }
48
- let cachedTextEncoder = new TextEncoder("utf-8");
49
- const encodeString = typeof cachedTextEncoder.encodeInto === "function" ? function(arg, view) {
50
- return cachedTextEncoder.encodeInto(arg, view);
51
- } : function(arg, view) {
52
- const buf = cachedTextEncoder.encode(arg);
53
- view.set(buf);
54
- return {
55
- read: arg.length,
56
- written: buf.length
57
- };
58
- };
59
- function passStringToWasm0(arg, malloc, realloc) {
60
- if (realloc === void 0) {
61
- const buf = cachedTextEncoder.encode(arg);
62
- const ptr = malloc(buf.length, 1) >>> 0;
63
- getUint8ArrayMemory0().subarray(ptr, ptr + buf.length).set(buf);
64
- WASM_VECTOR_LEN = buf.length;
65
- return ptr;
66
- }
67
- let len = arg.length;
68
- let ptr = malloc(len, 1) >>> 0;
69
- const mem = getUint8ArrayMemory0();
70
- let offset = 0;
71
- for (; offset < len; offset++) {
72
- const code = arg.charCodeAt(offset);
73
- if (code > 127) break;
74
- mem[ptr + offset] = code;
75
- }
76
- if (offset !== len) {
77
- if (offset !== 0) arg = arg.slice(offset);
78
- ptr = realloc(ptr, len, len = offset + arg.length * 3, 1) >>> 0;
79
- const view = getUint8ArrayMemory0().subarray(ptr + offset, ptr + len);
80
- const ret = encodeString(arg, view);
81
- offset += ret.written;
82
- ptr = realloc(ptr, len, offset, 1) >>> 0;
83
- }
84
- WASM_VECTOR_LEN = offset;
85
- return ptr;
86
- }
87
- let cachedDataViewMemory0 = null;
88
- function getDataViewMemory0() {
89
- if (cachedDataViewMemory0 === null || cachedDataViewMemory0.buffer.detached === true || cachedDataViewMemory0.buffer.detached === void 0 && cachedDataViewMemory0.buffer !== wasm.memory.buffer) cachedDataViewMemory0 = new DataView(wasm.memory.buffer);
90
- return cachedDataViewMemory0;
91
- }
92
- let cachedTextDecoder = new TextDecoder("utf-8", {
93
- ignoreBOM: true,
94
- fatal: true
95
- });
96
- cachedTextDecoder.decode();
97
- function getStringFromWasm0(ptr, len) {
98
- ptr = ptr >>> 0;
99
- return cachedTextDecoder.decode(getUint8ArrayMemory0().subarray(ptr, ptr + len));
100
- }
101
- function _assertClass(instance, klass) {
102
- if (!(instance instanceof klass)) throw new Error(`expected instance of ${klass.name}`);
103
- return instance.ptr;
104
- }
105
- /**
106
- * Alter a select channel by incrementing or decrementing its value by a constant.
107
- *
108
- * # Arguments
109
- * * `img` - A PhotonImage.
110
- * * `channel` - The channel you wish to alter, it should be either 0, 1 or 2,
111
- * representing R, G, or B respectively. (O=Red, 1=Green, 2=Blue)
112
- * * `amount` - The amount to increment/decrement the channel's value by for that pixel.
113
- * A positive value will increment/decrement the channel's value, a negative value will decrement the channel's value.
114
- *
115
- * ## Example
116
- *
117
- * ```no_run
118
- * // For example, to increase the Red channel for all pixels by 10:
119
- * use photon_rs::channels::alter_channel;
120
- * use photon_rs::native::{open_image};
121
- *
122
- * let mut img = open_image("img.jpg").expect("File should open");
123
- * alter_channel(&mut img, 0_usize, 10_i16);
124
- * ```
125
- *
126
- * Adds a constant to a select R, G, or B channel's value.
127
- *
128
- * ### Decrease a channel's value
129
- * // For example, to decrease the Green channel for all pixels by 20:
130
- * ```no_run
131
- * use photon_rs::channels::alter_channel;
132
- * use photon_rs::native::open_image;
133
- *
134
- * let mut img = open_image("img.jpg").expect("File should open");
135
- * alter_channel(&mut img, 1_usize, -20_i16);
136
- * ```
137
- * **Note**: Note the use of a minus symbol when decreasing the channel.
138
- * @param {PhotonImage} img
139
- * @param {number} channel
140
- * @param {number} amt
141
- */
142
- module.exports.alter_channel = function(img, channel, amt) {
143
- _assertClass(img, PhotonImage);
144
- wasm.alter_channel(img.__wbg_ptr, channel, amt);
145
- };
146
- /**
147
- * Increment or decrement every pixel's Red channel by a constant.
148
- *
149
- * # Arguments
150
- * * `img` - A PhotonImage. See the PhotonImage struct for details.
151
- * * `amt` - The amount to increment or decrement the channel's value by for that pixel.
152
- *
153
- * # Example
154
- *
155
- * ```no_run
156
- * // For example, to increase the Red channel for all pixels by 10:
157
- * use photon_rs::channels::alter_red_channel;
158
- * use photon_rs::native::open_image;
159
- *
160
- * let mut img = open_image("img.jpg").expect("File should open");
161
- * alter_red_channel(&mut img, 10_i16);
162
- * ```
163
- * @param {PhotonImage} photon_image
164
- * @param {number} amt
165
- */
166
- module.exports.alter_red_channel = function(photon_image, amt) {
167
- _assertClass(photon_image, PhotonImage);
168
- wasm.alter_red_channel(photon_image.__wbg_ptr, amt);
169
- };
170
- /**
171
- * Increment or decrement every pixel's Green channel by a constant.
172
- *
173
- * # Arguments
174
- * * `img` - A PhotonImage.
175
- * * `amt` - The amount to increment/decrement the channel's value by for that pixel.
176
- *
177
- * # Example
178
- *
179
- * ```no_run
180
- * // For example, to increase the Green channel for all pixels by 20:
181
- * use photon_rs::channels::alter_green_channel;
182
- * use photon_rs::native::open_image;
183
- *
184
- * let mut img = open_image("img.jpg").expect("File should open");
185
- * alter_green_channel(&mut img, 20_i16);
186
- * ```
187
- * @param {PhotonImage} img
188
- * @param {number} amt
189
- */
190
- module.exports.alter_green_channel = function(img, amt) {
191
- _assertClass(img, PhotonImage);
192
- wasm.alter_green_channel(img.__wbg_ptr, amt);
193
- };
194
- /**
195
- * Increment or decrement every pixel's Blue channel by a constant.
196
- *
197
- * # Arguments
198
- * * `img` - A PhotonImage.
199
- * * `amt` - The amount to increment or decrement the channel's value by for that pixel.
200
- *
201
- * # Example
202
- *
203
- * ```no_run
204
- * // For example, to increase the Blue channel for all pixels by 10:
205
- * use photon_rs::channels::alter_blue_channel;
206
- * use photon_rs::native::open_image;
207
- *
208
- * let mut img = open_image("img.jpg").expect("File should open");
209
- * alter_blue_channel(&mut img, 10_i16);
210
- * ```
211
- * @param {PhotonImage} img
212
- * @param {number} amt
213
- */
214
- module.exports.alter_blue_channel = function(img, amt) {
215
- _assertClass(img, PhotonImage);
216
- wasm.alter_blue_channel(img.__wbg_ptr, amt);
217
- };
218
- /**
219
- * Increment/decrement two channels' values simultaneously by adding an amt to each channel per pixel.
220
- *
221
- * # Arguments
222
- * * `img` - A PhotonImage.
223
- * * `channel1` - A usize from 0 to 2 that represents either the R, G or B channels.
224
- * * `amt1` - The amount to increment/decrement the channel's value by for that pixel.
225
- * * `channel2` -A usize from 0 to 2 that represents either the R, G or B channels.
226
- * * `amt2` - The amount to increment/decrement the channel's value by for that pixel.
227
- *
228
- * # Example
229
- *
230
- * ```no_run
231
- * // For example, to increase the values of the Red and Blue channels per pixel:
232
- * use photon_rs::channels::alter_two_channels;
233
- * use photon_rs::native::open_image;
234
- *
235
- * let mut img = open_image("img.jpg").expect("File should open");
236
- * alter_two_channels(&mut img, 0_usize, 10_i16, 2_usize, 20_i16);
237
- * ```
238
- * @param {PhotonImage} img
239
- * @param {number} channel1
240
- * @param {number} amt1
241
- * @param {number} channel2
242
- * @param {number} amt2
243
- */
244
- module.exports.alter_two_channels = function(img, channel1, amt1, channel2, amt2) {
245
- _assertClass(img, PhotonImage);
246
- wasm.alter_two_channels(img.__wbg_ptr, channel1, amt1, channel2, amt2);
247
- };
248
- /**
249
- * Increment all 3 channels' values by adding an amt to each channel per pixel.
250
- *
251
- * # Arguments
252
- * * `img` - A PhotonImage.
253
- * * `r_amt` - The amount to increment/decrement the Red channel by.
254
- * * `g_amt` - The amount to increment/decrement the Green channel by.
255
- * * `b_amt` - The amount to increment/decrement the Blue channel by.
256
- *
257
- * # Example
258
- *
259
- * ```no_run
260
- * // For example, to increase the values of the Red channel by 10, the Green channel by 20,
261
- * // and the Blue channel by 50:
262
- * use photon_rs::channels::alter_channels;
263
- * use photon_rs::native::open_image;
264
- *
265
- * let mut img = open_image("img.jpg").expect("File should open");
266
- * alter_channels(&mut img, 10_i16, 20_i16, 50_i16);
267
- * ```
268
- * @param {PhotonImage} img
269
- * @param {number} r_amt
270
- * @param {number} g_amt
271
- * @param {number} b_amt
272
- */
273
- module.exports.alter_channels = function(img, r_amt, g_amt, b_amt) {
274
- _assertClass(img, PhotonImage);
275
- wasm.alter_channels(img.__wbg_ptr, r_amt, g_amt, b_amt);
276
- };
277
- /**
278
- * Set a certain channel to zero, thus removing the channel's influence in the pixels' final rendered colour.
279
- *
280
- * # Arguments
281
- * * `img` - A PhotonImage.
282
- * * `channel` - The channel to be removed; must be a usize from 0 to 2, with 0 representing Red, 1 representing Green, and 2 representing Blue.
283
- * * `min_filter` - Minimum filter. Value between 0 and 255. Only remove the channel if the current pixel's channel value is less than this minimum filter. To completely
284
- * remove the channel, set this value to 255, to leave the channel as is, set to 0, and to set a channel to zero for a pixel whose red value is greater than 50,
285
- * then channel would be 0 and min_filter would be 50.
286
- *
287
- * # Example
288
- *
289
- * ```no_run
290
- * // For example, to remove the Red channel with a min_filter of 100:
291
- * use photon_rs::channels::remove_channel;
292
- * use photon_rs::native::open_image;
293
- *
294
- * let mut img = open_image("img.jpg").expect("File should open");
295
- * remove_channel(&mut img, 0_usize, 100_u8);
296
- * ```
297
- * @param {PhotonImage} img
298
- * @param {number} channel
299
- * @param {number} min_filter
300
- */
301
- module.exports.remove_channel = function(img, channel, min_filter) {
302
- _assertClass(img, PhotonImage);
303
- wasm.remove_channel(img.__wbg_ptr, channel, min_filter);
304
- };
305
- /**
306
- * Remove the Red channel's influence in an image.
307
- *
308
- * # Arguments
309
- * * `img` - A PhotonImage.
310
- * * `min_filter` - Only remove the channel if the current pixel's channel value is less than this minimum filter.
311
- *
312
- * # Example
313
- *
314
- * ```no_run
315
- * // For example, to remove the red channel for red channel pixel values less than 50:
316
- * use photon_rs::channels::remove_red_channel;
317
- * use photon_rs::native::open_image;
318
- *
319
- * let mut img = open_image("img.jpg").expect("File should open");
320
- * remove_red_channel(&mut img, 50_u8);
321
- * ```
322
- * @param {PhotonImage} img
323
- * @param {number} min_filter
324
- */
325
- module.exports.remove_red_channel = function(img, min_filter) {
326
- _assertClass(img, PhotonImage);
327
- wasm.remove_red_channel(img.__wbg_ptr, min_filter);
328
- };
329
- /**
330
- * Remove the Green channel's influence in an image.
331
- *
332
- * # Arguments
333
- * * `img` - A PhotonImage.
334
- * * `min_filter` - Only remove the channel if the current pixel's channel value is less than this minimum filter.
335
- *
336
- * # Example
337
- *
338
- * ```no_run
339
- * // For example, to remove the green channel for green channel pixel values less than 50:
340
- * use photon_rs::channels::remove_green_channel;
341
- * use photon_rs::native::open_image;
342
- *
343
- * let mut img = open_image("img.jpg").expect("File should open");
344
- * remove_green_channel(&mut img, 50_u8);
345
- * ```
346
- * @param {PhotonImage} img
347
- * @param {number} min_filter
348
- */
349
- module.exports.remove_green_channel = function(img, min_filter) {
350
- _assertClass(img, PhotonImage);
351
- wasm.remove_green_channel(img.__wbg_ptr, min_filter);
352
- };
353
- /**
354
- * Remove the Blue channel's influence in an image.
355
- *
356
- * # Arguments
357
- * * `img` - A PhotonImage.
358
- * * `min_filter` - Only remove the channel if the current pixel's channel value is less than this minimum filter.
359
- *
360
- * # Example
361
- *
362
- * ```no_run
363
- * // For example, to remove the blue channel for blue channel pixel values less than 50:
364
- * use photon_rs::channels::remove_blue_channel;
365
- * use photon_rs::native::open_image;
366
- *
367
- * let mut img = open_image("img.jpg").expect("File should open");
368
- * remove_blue_channel(&mut img, 50_u8);
369
- * ```
370
- * @param {PhotonImage} img
371
- * @param {number} min_filter
372
- */
373
- module.exports.remove_blue_channel = function(img, min_filter) {
374
- _assertClass(img, PhotonImage);
375
- wasm.remove_blue_channel(img.__wbg_ptr, min_filter);
376
- };
377
- /**
378
- * Swap two channels.
379
- *
380
- * # Arguments
381
- * * `img` - A PhotonImage.
382
- * * `channel1` - An index from 0 to 2, representing the Red, Green or Blue channels respectively. Red would be represented by 0, Green by 1, and Blue by 2.
383
- * * `channel2` - An index from 0 to 2, representing the Red, Green or Blue channels respectively. Same as above.
384
- *
385
- * # Example
386
- *
387
- * ```no_run
388
- * // For example, to swap the values of the Red channel with the values of the Blue channel:
389
- * use photon_rs::channels::swap_channels;
390
- * use photon_rs::native::open_image;
391
- *
392
- * let mut img = open_image("img.jpg").expect("File should open");
393
- * swap_channels(&mut img, 0_usize, 2_usize);
394
- * ```
395
- * @param {PhotonImage} img
396
- * @param {number} channel1
397
- * @param {number} channel2
398
- */
399
- module.exports.swap_channels = function(img, channel1, channel2) {
400
- _assertClass(img, PhotonImage);
401
- wasm.swap_channels(img.__wbg_ptr, channel1, channel2);
402
- };
403
- /**
404
- * Invert RGB value of an image.
405
- *
406
- * # Arguments
407
- * * `photon_image` - A DynamicImage that contains a view into the image.
408
- * # Example
409
- *
410
- * ```no_run
411
- * use photon_rs::channels::invert;
412
- * use photon_rs::native::open_image;
413
- *
414
- * let mut img = open_image("img.jpg").expect("File should open");
415
- * invert(&mut img);
416
- * ```
417
- * @param {PhotonImage} photon_image
418
- */
419
- module.exports.invert = function(photon_image) {
420
- _assertClass(photon_image, PhotonImage);
421
- wasm.invert(photon_image.__wbg_ptr);
422
- };
423
- /**
424
- * Selective hue rotation.
425
- *
426
- * Only rotate the hue of a pixel if its RGB values are within a specified range.
427
- * This function only rotates a pixel's hue to another if it is visually similar to the colour specified.
428
- * For example, if a user wishes all pixels that are blue to be changed to red, they can selectively specify only the blue pixels to be changed.
429
- * # Arguments
430
- * * `img` - A PhotonImage.
431
- * * `ref_color` - The `RGB` value of the reference color (to be compared to)
432
- * * `degrees` - The amount of degrees to hue rotate by.
433
- *
434
- * # Example
435
- *
436
- * ```no_run
437
- * // For example, to only rotate the pixels that are of RGB value RGB{20, 40, 60}:
438
- * use photon_rs::Rgb;
439
- * use photon_rs::channels::selective_hue_rotate;
440
- * use photon_rs::native::open_image;
441
- *
442
- * let ref_color = Rgb::new(20_u8, 40_u8, 60_u8);
443
- * let mut img = open_image("img.jpg").expect("File should open");
444
- * selective_hue_rotate(&mut img, ref_color, 180_f32);
445
- * ```
446
- * @param {PhotonImage} photon_image
447
- * @param {Rgb} ref_color
448
- * @param {number} degrees
449
- */
450
- module.exports.selective_hue_rotate = function(photon_image, ref_color, degrees) {
451
- _assertClass(photon_image, PhotonImage);
452
- _assertClass(ref_color, Rgb);
453
- var ptr0 = ref_color.__destroy_into_raw();
454
- wasm.selective_hue_rotate(photon_image.__wbg_ptr, ptr0, degrees);
455
- };
456
- /**
457
- * Selectively change pixel colours which are similar to the reference colour provided.
458
- *
459
- * Similarity between two colours is calculated via the CIE76 formula.
460
- * Only changes the color of a pixel if its similarity to the reference colour is within the range in the algorithm.
461
- * For example, with this function, a user can change the color of all blue pixels by mixing them with red by 10%.
462
- * # Arguments
463
- * * `photon_image` - A PhotonImage.
464
- * * `ref_color` - The `RGB` value of the reference color (to be compared to)
465
- * * `new_color` - The `RGB` value of the new color (to be mixed with the matched pixels)
466
- * * `fraction` - The amount of mixing the new colour with the matched pixels
467
- *
468
- * # Example
469
- *
470
- * ```no_run
471
- * // For example, to only change the color of pixels that are similar to the RGB value RGB{200, 120, 30} by mixing RGB{30, 120, 200} with 25%:
472
- * use photon_rs::Rgb;
473
- * use photon_rs::channels::selective_color_convert;
474
- * use photon_rs::native::open_image;
475
- *
476
- * let ref_color = Rgb::new(200, 120, 30);
477
- * let new_color = Rgb::new(30, 120, 200);
478
- * let mut img = open_image("img.jpg").expect("File should open");
479
- * selective_color_convert(&mut img, ref_color, new_color, 0.25);
480
- * ```
481
- * @param {PhotonImage} photon_image
482
- * @param {Rgb} ref_color
483
- * @param {Rgb} new_color
484
- * @param {number} fraction
485
- */
486
- module.exports.selective_color_convert = function(photon_image, ref_color, new_color, fraction) {
487
- _assertClass(photon_image, PhotonImage);
488
- _assertClass(ref_color, Rgb);
489
- var ptr0 = ref_color.__destroy_into_raw();
490
- _assertClass(new_color, Rgb);
491
- var ptr1 = new_color.__destroy_into_raw();
492
- wasm.selective_color_convert(photon_image.__wbg_ptr, ptr0, ptr1, fraction);
493
- };
494
- /**
495
- * Selectively lighten an image.
496
- *
497
- * Only lighten the hue of a pixel if its colour matches or is similar to the RGB colour specified.
498
- * For example, if a user wishes all pixels that are blue to be lightened, they can selectively specify only the blue pixels to be changed.
499
- * # Arguments
500
- * * `img` - A PhotonImage.
501
- * * `ref_color` - The `RGB` value of the reference color (to be compared to)
502
- * * `amt` - The level from 0 to 1 to lighten the hue by. Increasing by 10% would have an `amt` of 0.1
503
- *
504
- * # Example
505
- *
506
- * ```no_run
507
- * // For example, to only lighten the pixels that are of or similar to RGB value RGB{20, 40, 60}:
508
- * use photon_rs::Rgb;
509
- * use photon_rs::channels::selective_lighten;
510
- * use photon_rs::native::open_image;
511
- *
512
- * let ref_color = Rgb::new(20_u8, 40_u8, 60_u8);
513
- * let mut img = open_image("img.jpg").expect("File should open");
514
- * selective_lighten(&mut img, ref_color, 0.2_f32);
515
- * ```
516
- * @param {PhotonImage} img
517
- * @param {Rgb} ref_color
518
- * @param {number} amt
519
- */
520
- module.exports.selective_lighten = function(img, ref_color, amt) {
521
- _assertClass(img, PhotonImage);
522
- _assertClass(ref_color, Rgb);
523
- var ptr0 = ref_color.__destroy_into_raw();
524
- wasm.selective_lighten(img.__wbg_ptr, ptr0, amt);
525
- };
526
- /**
527
- * Selectively desaturate pixel colours which are similar to the reference colour provided.
528
- *
529
- * Similarity between two colours is calculated via the CIE76 formula.
530
- * Only desaturates the hue of a pixel if its similarity to the reference colour is within the range in the algorithm.
531
- * For example, if a user wishes all pixels that are blue to be desaturated by 0.1, they can selectively specify only the blue pixels to be changed.
532
- * # Arguments
533
- * * `img` - A PhotonImage.
534
- * * `ref_color` - The `RGB` value of the reference color (to be compared to)
535
- * * `amt` - The amount of desaturate the colour by.
536
- *
537
- * # Example
538
- *
539
- * ```no_run
540
- * // For example, to only desaturate the pixels that are similar to the RGB value RGB{20, 40, 60}:
541
- * use photon_rs::Rgb;
542
- * use photon_rs::channels::selective_desaturate;
543
- * use photon_rs::native::open_image;
544
- *
545
- * let ref_color = Rgb::new(20_u8, 40_u8, 60_u8);
546
- * let mut img = open_image("img.jpg").expect("File should open");
547
- * selective_desaturate(&mut img, ref_color, 0.1_f32);
548
- * ```
549
- * @param {PhotonImage} img
550
- * @param {Rgb} ref_color
551
- * @param {number} amt
552
- */
553
- module.exports.selective_desaturate = function(img, ref_color, amt) {
554
- _assertClass(img, PhotonImage);
555
- _assertClass(ref_color, Rgb);
556
- var ptr0 = ref_color.__destroy_into_raw();
557
- wasm.selective_desaturate(img.__wbg_ptr, ptr0, amt);
558
- };
559
- /**
560
- * Selectively saturate pixel colours which are similar to the reference colour provided.
561
- *
562
- * Similarity between two colours is calculated via the CIE76 formula.
563
- * Only saturates the hue of a pixel if its similarity to the reference colour is within the range in the algorithm.
564
- * For example, if a user wishes all pixels that are blue to have an increase in saturation by 10%, they can selectively specify only the blue pixels to be changed.
565
- * # Arguments
566
- * * `img` - A PhotonImage.
567
- * * `ref_color` - The `RGB` value of the reference color (to be compared to)
568
- * * `amt` - The amount of saturate the colour by.
569
- *
570
- * # Example
571
- *
572
- * ```no_run
573
- * // For example, to only increase the saturation of pixels that are similar to the RGB value RGB{20, 40, 60}:
574
- * use photon_rs::Rgb;
575
- * use photon_rs::channels::selective_saturate;
576
- * use photon_rs::native::open_image;
577
- *
578
- * let ref_color = Rgb::new(20_u8, 40_u8, 60_u8);
579
- * let mut img = open_image("img.jpg").expect("File should open");
580
- * selective_saturate(&mut img, ref_color, 0.1_f32);
581
- * ```
582
- * @param {PhotonImage} img
583
- * @param {Rgb} ref_color
584
- * @param {number} amt
585
- */
586
- module.exports.selective_saturate = function(img, ref_color, amt) {
587
- _assertClass(img, PhotonImage);
588
- _assertClass(ref_color, Rgb);
589
- var ptr0 = ref_color.__destroy_into_raw();
590
- wasm.selective_saturate(img.__wbg_ptr, ptr0, amt);
591
- };
592
- /**
593
- * Selectively changes a pixel to greyscale if it is *not* visually similar or close to the colour specified.
594
- * Only changes the colour of a pixel if its RGB values are within a specified range.
595
- *
596
- * (Similarity between two colours is calculated via the CIE76 formula.)
597
- * For example, if a user wishes all pixels that are *NOT* blue to be displayed in greyscale, they can selectively specify only the blue pixels to be
598
- * kept in the photo.
599
- * # Arguments
600
- * * `img` - A PhotonImage.
601
- * * `ref_color` - The `RGB` value of the reference color (to be compared to)
602
- *
603
- * # Example
604
- *
605
- * ```no_run
606
- * // For example, to greyscale all pixels that are *not* visually similar to the RGB colour RGB{20, 40, 60}:
607
- * use photon_rs::Rgb;
608
- * use photon_rs::channels::selective_greyscale;
609
- * use photon_rs::native::open_image;
610
- *
611
- * let ref_color = Rgb::new(20_u8, 40_u8, 60_u8);
612
- * let mut img = open_image("img.jpg").expect("File should open");
613
- * selective_greyscale(img, ref_color);
614
- * ```
615
- * @param {PhotonImage} photon_image
616
- * @param {Rgb} ref_color
617
- */
618
- module.exports.selective_greyscale = function(photon_image, ref_color) {
619
- _assertClass(photon_image, PhotonImage);
620
- var ptr0 = photon_image.__destroy_into_raw();
621
- _assertClass(ref_color, Rgb);
622
- var ptr1 = ref_color.__destroy_into_raw();
623
- wasm.selective_greyscale(ptr0, ptr1);
624
- };
625
- /**
626
- * Apply a monochrome effect of a certain colour.
627
- *
628
- * It does so by averaging the R, G, and B values of a pixel, and then adding a
629
- * separate value to that averaged value for each channel to produce a tint.
630
- * # Arguments
631
- * * `photon_image` - A PhotonImage.
632
- * * `r_offset` - The value to add to the Red channel per pixel.
633
- * * `g_offset` - The value to add to the Green channel per pixel.
634
- * * `b_offset` - The value to add to the Blue channel per pixel.
635
- *
636
- * # Example
637
- *
638
- * ```no_run
639
- * // For example, to apply a monochrome effect to an image:
640
- * use photon_rs::monochrome::monochrome;
641
- * use photon_rs::native::open_image;
642
- *
643
- * let mut img = open_image("img.jpg").expect("File should open");
644
- * monochrome(&mut img, 40_u32, 50_u32, 100_u32);
645
- * ```
646
- * @param {PhotonImage} img
647
- * @param {number} r_offset
648
- * @param {number} g_offset
649
- * @param {number} b_offset
650
- */
651
- module.exports.monochrome = function(img, r_offset, g_offset, b_offset) {
652
- _assertClass(img, PhotonImage);
653
- wasm.monochrome(img.__wbg_ptr, r_offset, g_offset, b_offset);
654
- };
655
- /**
656
- * Convert an image to sepia.
657
- *
658
- * # Arguments
659
- * * `photon_image` - A PhotonImage.
660
- * # Example
661
- *
662
- * ```no_run
663
- * // For example, to sepia an image of type `PhotonImage`:
664
- * use photon_rs::monochrome::sepia;
665
- * use photon_rs::native::open_image;
666
- *
667
- * let mut img = open_image("img.jpg").expect("File should open");
668
- * sepia(&mut img);
669
- * ```
670
- * @param {PhotonImage} img
671
- */
672
- module.exports.sepia = function(img) {
673
- _assertClass(img, PhotonImage);
674
- wasm.sepia(img.__wbg_ptr);
675
- };
676
- /**
677
- * Convert an image to grayscale using the conventional averaging algorithm.
678
- *
679
- * # Arguments
680
- * * `photon_image` - A PhotonImage.
681
- * # Example
682
- *
683
- * ```no_run
684
- * // For example, to convert an image of type `PhotonImage` to grayscale:
685
- * use photon_rs::monochrome::grayscale;
686
- * use photon_rs::native::open_image;
687
- *
688
- * let mut img = open_image("img.jpg").expect("File should open");
689
- * grayscale(&mut img);
690
- * ```
691
- * @param {PhotonImage} img
692
- */
693
- module.exports.grayscale = function(img) {
694
- _assertClass(img, PhotonImage);
695
- wasm.grayscale(img.__wbg_ptr);
696
- };
697
- /**
698
- * Convert an image to grayscale with a human corrected factor, to account for human vision.
699
- *
700
- * # Arguments
701
- * * `photon_image` - A PhotonImage.
702
- * # Example
703
- *
704
- * ```no_run
705
- * // For example, to convert an image of type `PhotonImage` to grayscale with a human corrected factor:
706
- * use photon_rs::monochrome::grayscale_human_corrected;
707
- * use photon_rs::native::open_image;
708
- *
709
- * let mut img = open_image("img.jpg").expect("File should open");
710
- * grayscale_human_corrected(&mut img);
711
- * ```
712
- * @param {PhotonImage} img
713
- */
714
- module.exports.grayscale_human_corrected = function(img) {
715
- _assertClass(img, PhotonImage);
716
- wasm.grayscale_human_corrected(img.__wbg_ptr);
717
- };
718
- /**
719
- * Desaturate an image by getting the min/max of each pixel's RGB values.
720
- *
721
- * # Arguments
722
- * * `photon_image` - A PhotonImage.
723
- * # Example
724
- *
725
- * ```no_run
726
- * // For example, to desaturate an image:
727
- * use photon_rs::monochrome::desaturate;
728
- * use photon_rs::native::open_image;
729
- *
730
- * let mut img = open_image("img.jpg").expect("File should open");
731
- * desaturate(&mut img);
732
- * ```
733
- * @param {PhotonImage} img
734
- */
735
- module.exports.desaturate = function(img) {
736
- _assertClass(img, PhotonImage);
737
- wasm.desaturate(img.__wbg_ptr);
738
- };
739
- /**
740
- * Uses a min. decomposition algorithm to convert an image to greyscale.
741
- *
742
- * # Arguments
743
- * * `photon_image` - A PhotonImage.
744
- *
745
- * # Example
746
- *
747
- * ```no_run
748
- * // For example, to decompose an image with min decomposition:
749
- * use photon_rs::monochrome::decompose_min;
750
- * use photon_rs::native::open_image;
751
- *
752
- * let mut img = open_image("img.jpg").expect("File should open");
753
- * decompose_min(&mut img);
754
- * ```
755
- * @param {PhotonImage} img
756
- */
757
- module.exports.decompose_min = function(img) {
758
- _assertClass(img, PhotonImage);
759
- wasm.decompose_min(img.__wbg_ptr);
760
- };
761
- /**
762
- * Uses a max. decomposition algorithm to convert an image to greyscale.
763
- *
764
- * # Arguments
765
- * * `photon_image` - A PhotonImage.
766
- *
767
- * # Example
768
- *
769
- * ```no_run
770
- * // For example, to decompose an image with max decomposition:
771
- * use photon_rs::monochrome::decompose_max;
772
- * use photon_rs::native::open_image;
773
- *
774
- * let mut img = open_image("img.jpg").expect("File should open");
775
- * decompose_max(&mut img);
776
- * ```
777
- * @param {PhotonImage} img
778
- */
779
- module.exports.decompose_max = function(img) {
780
- _assertClass(img, PhotonImage);
781
- wasm.decompose_max(img.__wbg_ptr);
782
- };
783
- /**
784
- * Employ only a limited number of gray shades in an image.
785
- *
786
- * # Arguments
787
- * * `photon_image` - A PhotonImage.
788
- * * `num_shades` - The number of grayscale shades to be displayed in the image.
789
- *
790
- * # Example
791
- *
792
- * ```no_run
793
- * // For example, to limit an image to four shades of gray only:
794
- * use photon_rs::monochrome::grayscale_shades;
795
- * use photon_rs::native::open_image;
796
- *
797
- * let mut img = open_image("img.jpg").expect("File should open");
798
- * grayscale_shades(&mut img, 4_u8);
799
- * ```
800
- * @param {PhotonImage} photon_image
801
- * @param {number} num_shades
802
- */
803
- module.exports.grayscale_shades = function(photon_image, num_shades) {
804
- _assertClass(photon_image, PhotonImage);
805
- wasm.grayscale_shades(photon_image.__wbg_ptr, num_shades);
806
- };
807
- /**
808
- * Convert an image to grayscale by setting a pixel's 3 RGB values to the Red channel's value.
809
- *
810
- * # Arguments
811
- * * `photon_image` - A PhotonImage.
812
- *
813
- * # Example
814
- *
815
- * ```no_run
816
- * use photon_rs::monochrome::r_grayscale;
817
- * use photon_rs::native::open_image;
818
- *
819
- * let mut img = open_image("img.jpg").expect("File should open");
820
- * r_grayscale(&mut img);
821
- * ```
822
- * @param {PhotonImage} photon_image
823
- */
824
- module.exports.r_grayscale = function(photon_image) {
825
- _assertClass(photon_image, PhotonImage);
826
- wasm.r_grayscale(photon_image.__wbg_ptr);
827
- };
828
- /**
829
- * Convert an image to grayscale by setting a pixel's 3 RGB values to the Green channel's value.
830
- *
831
- * # Arguments
832
- * * `photon_image` - A PhotonImage.
833
- *
834
- * # Example
835
- *
836
- * ```no_run
837
- * use photon_rs::monochrome::g_grayscale;
838
- * use photon_rs::native::open_image;
839
- *
840
- * let mut img = open_image("img.jpg").expect("File should open");
841
- * g_grayscale(&mut img);
842
- * ```
843
- * @param {PhotonImage} photon_image
844
- */
845
- module.exports.g_grayscale = function(photon_image) {
846
- _assertClass(photon_image, PhotonImage);
847
- wasm.g_grayscale(photon_image.__wbg_ptr);
848
- };
849
- /**
850
- * Convert an image to grayscale by setting a pixel's 3 RGB values to the Blue channel's value.
851
- *
852
- * # Arguments
853
- * * `photon_image` - A PhotonImage.
854
- *
855
- * # Example
856
- *
857
- * ```no_run
858
- * use photon_rs::monochrome::b_grayscale;
859
- * use photon_rs::native::open_image;
860
- *
861
- * let mut img = open_image("img.jpg").expect("File should open");
862
- * b_grayscale(&mut img);
863
- * ```
864
- * @param {PhotonImage} photon_image
865
- */
866
- module.exports.b_grayscale = function(photon_image) {
867
- _assertClass(photon_image, PhotonImage);
868
- wasm.b_grayscale(photon_image.__wbg_ptr);
869
- };
870
- /**
871
- * Convert an image to grayscale by setting a pixel's 3 RGB values to a chosen channel's value.
872
- *
873
- * # Arguments
874
- * * `photon_image` - A PhotonImage.
875
- * * `channel` - A usize representing the channel from 0 to 2. O represents the Red channel, 1 the Green channel, and 2 the Blue channel.
876
- *
877
- * # Example
878
- * To grayscale using only values from the Red channel:
879
- * ```no_run
880
- * use photon_rs::monochrome::single_channel_grayscale;
881
- * use photon_rs::native::open_image;
882
- *
883
- * let mut img = open_image("img.jpg").expect("File should open");
884
- * single_channel_grayscale(&mut img, 0_usize);
885
- * ```
886
- * @param {PhotonImage} photon_image
887
- * @param {number} channel
888
- */
889
- module.exports.single_channel_grayscale = function(photon_image, channel) {
890
- _assertClass(photon_image, PhotonImage);
891
- wasm.single_channel_grayscale(photon_image.__wbg_ptr, channel);
892
- };
893
- /**
894
- * Threshold an image using a standard thresholding algorithm.
895
- *
896
- * # Arguments
897
- * * `photon_image` - A PhotonImage.
898
- * * `threshold` - The amount the image should be thresholded by from 0 to 255.
899
- * # Example
900
- *
901
- * ```no_run
902
- * // For example, to threshold an image of type `PhotonImage`:
903
- * use photon_rs::monochrome::threshold;
904
- * use photon_rs::native::open_image;
905
- *
906
- * let mut img = open_image("img.jpg").expect("File should open");
907
- * threshold(&mut img, 30_u32);
908
- * ```
909
- * @param {PhotonImage} img
910
- * @param {number} threshold
911
- */
912
- module.exports.threshold = function(img, threshold) {
913
- _assertClass(img, PhotonImage);
914
- wasm.threshold(img.__wbg_ptr, threshold);
915
- };
916
- /**
917
- * Applies gamma correction to an image.
918
- * # Arguments
919
- * * `photon_image` - A PhotonImage that contains a view into the image.
920
- * * `red` - Gamma value for red channel.
921
- * * `green` - Gamma value for green channel.
922
- * * `blue` - Gamma value for blue channel.
923
- * # Example
924
- *
925
- * ```no_run
926
- * // For example, to turn an image of type `PhotonImage` into a gamma corrected image:
927
- * use photon_rs::colour_spaces::gamma_correction;
928
- * use photon_rs::native::open_image;
929
- *
930
- * let mut img = open_image("img.jpg").expect("File should open");
931
- * gamma_correction(&mut img, 2.2, 2.2, 2.2);
932
- * ```
933
- * @param {PhotonImage} photon_image
934
- * @param {number} red
935
- * @param {number} green
936
- * @param {number} blue
937
- */
938
- module.exports.gamma_correction = function(photon_image, red, green, blue) {
939
- _assertClass(photon_image, PhotonImage);
940
- wasm.gamma_correction(photon_image.__wbg_ptr, red, green, blue);
941
- };
942
- /**
943
- * Image manipulation effects in the HSLuv colour space
944
- *
945
- * Effects include:
946
- * * **saturate** - Saturation increase.
947
- * * **desaturate** - Desaturate the image.
948
- * * **shift_hue** - Hue rotation by a specified number of degrees.
949
- * * **darken** - Decrease the brightness.
950
- * * **lighten** - Increase the brightness.
951
- *
952
- * # Arguments
953
- * * `photon_image` - A PhotonImage.
954
- * * `mode` - The effect desired to be applied. Choose from: `saturate`, `desaturate`, `shift_hue`, `darken`, `lighten`
955
- * * `amt` - A float value from 0 to 1 which represents the amount the effect should be increased by.
956
- * # Example
957
- * ```no_run
958
- * // For example to increase the saturation by 10%:
959
- * use photon_rs::colour_spaces::hsluv;
960
- * use photon_rs::native::open_image;
961
- *
962
- * // Open the image. A PhotonImage is returned.
963
- * let mut img = open_image("img.jpg").expect("File should open");
964
- * hsluv(&mut img, "saturate", 0.1_f32);
965
- * ```
966
- * @param {PhotonImage} photon_image
967
- * @param {string} mode
968
- * @param {number} amt
969
- */
970
- module.exports.hsluv = function(photon_image, mode, amt) {
971
- _assertClass(photon_image, PhotonImage);
972
- const ptr0 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
973
- const len0 = WASM_VECTOR_LEN;
974
- wasm.hsluv(photon_image.__wbg_ptr, ptr0, len0, amt);
975
- };
976
- /**
977
- * Image manipulation effects in the LCh colour space
978
- *
979
- * Effects include:
980
- * * **saturate** - Saturation increase.
981
- * * **desaturate** - Desaturate the image.
982
- * * **shift_hue** - Hue rotation by a specified number of degrees.
983
- * * **darken** - Decrease the brightness.
984
- * * **lighten** - Increase the brightness.
985
- *
986
- * # Arguments
987
- * * `photon_image` - A PhotonImage.
988
- * * `mode` - The effect desired to be applied. Choose from: `saturate`, `desaturate`, `shift_hue`, `darken`, `lighten`
989
- * * `amt` - A float value from 0 to 1 which represents the amount the effect should be increased by.
990
- * # Example
991
- * ```no_run
992
- * // For example to increase the saturation by 10%:
993
- * use photon_rs::colour_spaces::lch;
994
- * use photon_rs::native::open_image;
995
- *
996
- * // Open the image. A PhotonImage is returned.
997
- * let mut img = open_image("img.jpg").expect("File should open");
998
- * lch(&mut img, "saturate", 0.1_f32);
999
- * ```
1000
- * @param {PhotonImage} photon_image
1001
- * @param {string} mode
1002
- * @param {number} amt
1003
- */
1004
- module.exports.lch = function(photon_image, mode, amt) {
1005
- _assertClass(photon_image, PhotonImage);
1006
- const ptr0 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1007
- const len0 = WASM_VECTOR_LEN;
1008
- wasm.lch(photon_image.__wbg_ptr, ptr0, len0, amt);
1009
- };
1010
- /**
1011
- * Image manipulation effects in the HSL colour space.
1012
- *
1013
- * Effects include:
1014
- * * **saturate** - Saturation increase.
1015
- * * **desaturate** - Desaturate the image.
1016
- * * **shift_hue** - Hue rotation by a specified number of degrees.
1017
- * * **darken** - Decrease the brightness.
1018
- * * **lighten** - Increase the brightness.
1019
- *
1020
- * # Arguments
1021
- * * `photon_image` - A PhotonImage.
1022
- * * `mode` - The effect desired to be applied. Choose from: `saturate`, `desaturate`, `shift_hue`, `darken`, `lighten`
1023
- * * `amt` - A float value from 0 to 1 which represents the amount the effect should be increased by.
1024
- * # Example
1025
- * ```no_run
1026
- * // For example to increase the saturation by 10%:
1027
- * use photon_rs::colour_spaces::hsl;
1028
- * use photon_rs::native::open_image;
1029
- *
1030
- * // Open the image. A PhotonImage is returned.
1031
- * let mut img = open_image("img.jpg").expect("File should open");
1032
- * hsl(&mut img, "saturate", 0.1_f32);
1033
- * ```
1034
- * @param {PhotonImage} photon_image
1035
- * @param {string} mode
1036
- * @param {number} amt
1037
- */
1038
- module.exports.hsl = function(photon_image, mode, amt) {
1039
- _assertClass(photon_image, PhotonImage);
1040
- const ptr0 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1041
- const len0 = WASM_VECTOR_LEN;
1042
- wasm.hsl(photon_image.__wbg_ptr, ptr0, len0, amt);
1043
- };
1044
- /**
1045
- * Image manipulation in the HSV colour space.
1046
- *
1047
- * Effects include:
1048
- * * **saturate** - Saturation increase.
1049
- * * **desaturate** - Desaturate the image.
1050
- * * **shift_hue** - Hue rotation by a specified number of degrees.
1051
- * * **darken** - Decrease the brightness.
1052
- * * **lighten** - Increase the brightness.
1053
- *
1054
- * # Arguments
1055
- * * `photon_image` - A PhotonImage.
1056
- * * `mode` - The effect desired to be applied. Choose from: `saturate`, `desaturate`, `shift_hue`, `darken`, `lighten`
1057
- * * `amt` - A float value from 0 to 1 which represents the amount the effect should be increased by.
1058
- *
1059
- * # Example
1060
- * ```no_run
1061
- * // For example to increase the saturation by 10%:
1062
- * use photon_rs::colour_spaces::hsv;
1063
- * use photon_rs::native::open_image;
1064
- *
1065
- * // Open the image. A PhotonImage is returned.
1066
- * let mut img = open_image("img.jpg").expect("File should open");
1067
- * hsv(&mut img, "saturate", 0.1_f32);
1068
- * ```
1069
- * @param {PhotonImage} photon_image
1070
- * @param {string} mode
1071
- * @param {number} amt
1072
- */
1073
- module.exports.hsv = function(photon_image, mode, amt) {
1074
- _assertClass(photon_image, PhotonImage);
1075
- const ptr0 = passStringToWasm0(mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
1076
- const len0 = WASM_VECTOR_LEN;
1077
- wasm.hsv(photon_image.__wbg_ptr, ptr0, len0, amt);
1078
- };
1079
- /**
1080
- * Shift hue by a specified number of degrees in the HSL colour space.
1081
- * # Arguments
1082
- * * `img` - A PhotonImage.
1083
- * * `mode` - A float value from 0 to 1 which is the amount to shift the hue by, or hue rotate by.
1084
- *
1085
- * # Example
1086
- * ```no_run
1087
- * // For example to hue rotate/shift the hue by 120 degrees in the HSL colour space:
1088
- * use photon_rs::colour_spaces::hue_rotate_hsl;
1089
- * use photon_rs::native::open_image;
1090
- *
1091
- * // Open the image. A PhotonImage is returned.
1092
- * let mut img = open_image("img.jpg").expect("File should open");
1093
- * hue_rotate_hsl(&mut img, 120_f32);
1094
- * ```
1095
- * @param {PhotonImage} img
1096
- * @param {number} degrees
1097
- */
1098
- module.exports.hue_rotate_hsl = function(img, degrees) {
1099
- _assertClass(img, PhotonImage);
1100
- wasm.hue_rotate_hsl(img.__wbg_ptr, degrees);
1101
- };
1102
- /**
1103
- * Shift hue by a specified number of degrees in the HSV colour space.
1104
- * # Arguments
1105
- * * `img` - A PhotonImage.
1106
- * * `mode` - A float value from 0 to 1 which is the amount to shift the hue by, or hue rotate by.
1107
- *
1108
- * # Example
1109
- * ```no_run
1110
- * // For example to hue rotate/shift the hue by 120 degrees in the HSV colour space:
1111
- * use photon_rs::colour_spaces::hue_rotate_hsv;
1112
- * use photon_rs::native::open_image;
1113
- *
1114
- * // Open the image. A PhotonImage is returned.
1115
- * let mut img = open_image("img.jpg").expect("File should open");
1116
- * hue_rotate_hsv(&mut img, 120_f32);
1117
- * ```
1118
- * @param {PhotonImage} img
1119
- * @param {number} degrees
1120
- */
1121
- module.exports.hue_rotate_hsv = function(img, degrees) {
1122
- _assertClass(img, PhotonImage);
1123
- wasm.hue_rotate_hsv(img.__wbg_ptr, degrees);
1124
- };
1125
- /**
1126
- * Shift hue by a specified number of degrees in the LCh colour space.
1127
- * # Arguments
1128
- * * `img` - A PhotonImage.
1129
- * * `mode` - A float value from 0 to 1 which is the amount to shift the hue by, or hue rotate by.
1130
- *
1131
- * # Example
1132
- * ```no_run
1133
- * // For example to hue rotate/shift the hue by 120 degrees in the HSL colour space:
1134
- * use photon_rs::colour_spaces::hue_rotate_lch;
1135
- * use photon_rs::native::open_image;
1136
- *
1137
- * // Open the image. A PhotonImage is returned.
1138
- * let mut img = open_image("img.jpg").expect("File should open");
1139
- * hue_rotate_lch(&mut img, 120_f32);
1140
- * ```
1141
- * @param {PhotonImage} img
1142
- * @param {number} degrees
1143
- */
1144
- module.exports.hue_rotate_lch = function(img, degrees) {
1145
- _assertClass(img, PhotonImage);
1146
- wasm.hue_rotate_lch(img.__wbg_ptr, degrees);
1147
- };
1148
- /**
1149
- * Shift hue by a specified number of degrees in the HSLuv colour space.
1150
- * # Arguments
1151
- * * `img` - A PhotonImage.
1152
- * * `mode` - A float value from 0 to 1 which is the amount to shift the hue by, or hue rotate by.
1153
- *
1154
- * # Example
1155
- * ```no_run
1156
- * // For example to hue rotate/shift the hue by 120 degrees in the HSL colour space:
1157
- * use photon_rs::colour_spaces::hue_rotate_hsluv;
1158
- * use photon_rs::native::open_image;
1159
- *
1160
- * // Open the image. A PhotonImage is returned.
1161
- * let mut img = open_image("img.jpg").expect("File should open");
1162
- * hue_rotate_hsluv(&mut img, 120_f32);
1163
- * ```
1164
- * @param {PhotonImage} img
1165
- * @param {number} degrees
1166
- */
1167
- module.exports.hue_rotate_hsluv = function(img, degrees) {
1168
- _assertClass(img, PhotonImage);
1169
- wasm.hue_rotate_hsluv(img.__wbg_ptr, degrees);
1170
- };
1171
- /**
1172
- * Increase the image's saturation by converting each pixel's colour to the HSL colour space
1173
- * and increasing the colour's saturation.
1174
- * # Arguments
1175
- * * `img` - A PhotonImage.
1176
- * * `level` - Float value from 0 to 1 representing the level to which to increase the saturation by.
1177
- * The `level` must be from 0 to 1 in floating-point, `f32` format.
1178
- * Increasing saturation by 80% would be represented by a `level` of 0.8
1179
- *
1180
- * # Example
1181
- * ```no_run
1182
- * // For example to increase saturation by 10% in the HSL colour space:
1183
- * use photon_rs::colour_spaces::saturate_hsl;
1184
- * use photon_rs::native::open_image;
1185
- *
1186
- * // Open the image. A PhotonImage is returned.
1187
- * let mut img = open_image("img.jpg").expect("File should open");
1188
- * saturate_hsl(&mut img, 0.1_f32);
1189
- * ```
1190
- * @param {PhotonImage} img
1191
- * @param {number} level
1192
- */
1193
- module.exports.saturate_hsl = function(img, level) {
1194
- _assertClass(img, PhotonImage);
1195
- wasm.saturate_hsl(img.__wbg_ptr, level);
1196
- };
1197
- /**
1198
- * Increase the image's saturation in the LCh colour space.
1199
- * # Arguments
1200
- * * `img` - A PhotonImage.
1201
- * * `level` - Float value from 0 to 1 representing the level to which to increase the saturation by.
1202
- * The `level` must be from 0 to 1 in floating-point, `f32` format.
1203
- * Increasing saturation by 80% would be represented by a `level` of 0.8
1204
- *
1205
- * # Example
1206
- * ```no_run
1207
- * // For example to increase saturation by 40% in the Lch colour space:
1208
- * use photon_rs::colour_spaces::saturate_lch;
1209
- * use photon_rs::native::open_image;
1210
- *
1211
- * // Open the image. A PhotonImage is returned.
1212
- * let mut img = open_image("img.jpg").expect("File should open");
1213
- * saturate_lch(&mut img, 0.4_f32);
1214
- * ```
1215
- * @param {PhotonImage} img
1216
- * @param {number} level
1217
- */
1218
- module.exports.saturate_lch = function(img, level) {
1219
- _assertClass(img, PhotonImage);
1220
- wasm.saturate_lch(img.__wbg_ptr, level);
1221
- };
1222
- /**
1223
- * Increase the image's saturation in the HSLuv colour space.
1224
- * # Arguments
1225
- * * `img` - A PhotonImage.
1226
- * * `level` - Float value from 0 to 1 representing the level to which to increase the saturation by.
1227
- * The `level` must be from 0 to 1 in floating-point, `f32` format.
1228
- * Increasing saturation by 80% would be represented by a `level` of 0.8
1229
- *
1230
- * # Example
1231
- * ```no_run
1232
- * // For example to increase saturation by 40% in the HSLuv colour space:
1233
- * use photon_rs::colour_spaces::saturate_hsluv;
1234
- * use photon_rs::native::open_image;
1235
- *
1236
- * // Open the image. A PhotonImage is returned.
1237
- * let mut img = open_image("img.jpg").expect("File should open");
1238
- * saturate_hsluv(&mut img, 0.4_f32);
1239
- * ```
1240
- * @param {PhotonImage} img
1241
- * @param {number} level
1242
- */
1243
- module.exports.saturate_hsluv = function(img, level) {
1244
- _assertClass(img, PhotonImage);
1245
- wasm.saturate_hsluv(img.__wbg_ptr, level);
1246
- };
1247
- /**
1248
- * Increase the image's saturation in the HSV colour space.
1249
- * # Arguments
1250
- * * `img` - A PhotonImage.
1251
- * * `level` - Float value from 0 to 1 representing the level by which to increase the saturation by.
1252
- * The `level` must be from 0 to 1 in floating-point, `f32` format.
1253
- * Increasing saturation by 80% would be represented by a `level` of 0.8
1254
- *
1255
- * # Example
1256
- * ```no_run
1257
- * // For example to increase saturation by 30% in the HSV colour space:
1258
- * use photon_rs::colour_spaces::saturate_hsv;
1259
- * use photon_rs::native::open_image;
1260
- *
1261
- * // Open the image. A PhotonImage is returned.
1262
- * let mut img = open_image("img.jpg").expect("File should open");
1263
- * saturate_hsv(&mut img, 0.3_f32);
1264
- * ```
1265
- * @param {PhotonImage} img
1266
- * @param {number} level
1267
- */
1268
- module.exports.saturate_hsv = function(img, level) {
1269
- _assertClass(img, PhotonImage);
1270
- wasm.saturate_hsv(img.__wbg_ptr, level);
1271
- };
1272
- /**
1273
- * Lighten an image by a specified amount in the LCh colour space.
1274
- *
1275
- * # Arguments
1276
- * * `img` - A PhotonImage.
1277
- * * `level` - Float value from 0 to 1 representing the level to which to lighten the image by.
1278
- * The `level` must be from 0 to 1 in floating-point, `f32` format.
1279
- * Lightening by 80% would be represented by a `level` of 0.8
1280
- *
1281
- * # Example
1282
- * ```no_run
1283
- * // For example to lighten an image by 10% in the LCh colour space:
1284
- * use photon_rs::colour_spaces::lighten_lch;
1285
- * use photon_rs::native::open_image;
1286
- *
1287
- * // Open the image. A PhotonImage is returned.
1288
- * let mut img = open_image("img.jpg").expect("File should open");
1289
- * lighten_lch(&mut img, 0.1_f32);
1290
- * ```
1291
- * @param {PhotonImage} img
1292
- * @param {number} level
1293
- */
1294
- module.exports.lighten_lch = function(img, level) {
1295
- _assertClass(img, PhotonImage);
1296
- wasm.lighten_lch(img.__wbg_ptr, level);
1297
- };
1298
- /**
1299
- * Lighten an image by a specified amount in the HSLuv colour space.
1300
- *
1301
- * # Arguments
1302
- * * `img` - A PhotonImage.
1303
- * * `level` - Float value from 0 to 1 representing the level to which to lighten the image by.
1304
- * The `level` must be from 0 to 1 in floating-point, `f32` format.
1305
- * Lightening by 80% would be represented by a `level` of 0.8
1306
- *
1307
- * # Example
1308
- * ```no_run
1309
- * // For example to lighten an image by 10% in the HSLuv colour space:
1310
- * use photon_rs::colour_spaces::lighten_hsluv;
1311
- * use photon_rs::native::open_image;
1312
- *
1313
- * // Open the image. A PhotonImage is returned.
1314
- * let mut img = open_image("img.jpg").expect("File should open");
1315
- * lighten_hsluv(&mut img, 0.1_f32);
1316
- * ```
1317
- * @param {PhotonImage} img
1318
- * @param {number} level
1319
- */
1320
- module.exports.lighten_hsluv = function(img, level) {
1321
- _assertClass(img, PhotonImage);
1322
- wasm.lighten_hsluv(img.__wbg_ptr, level);
1323
- };
1324
- /**
1325
- * Lighten an image by a specified amount in the HSL colour space.
1326
- * # Arguments
1327
- * * `img` - A PhotonImage.
1328
- * * `level` - Float value from 0 to 1 representing the level to which to lighten the image by.
1329
- * The `level` must be from 0 to 1 in floating-point, `f32` format.
1330
- * Lightening by 80% would be represented by a `level` of 0.8
1331
- *
1332
- * # Example
1333
- * ```no_run
1334
- * // For example to lighten an image by 10% in the HSL colour space:
1335
- * use photon_rs::colour_spaces::lighten_hsl;
1336
- * use photon_rs::native::open_image;
1337
- *
1338
- * // Open the image. A PhotonImage is returned.
1339
- * let mut img = open_image("img.jpg").expect("File should open");
1340
- * lighten_hsl(&mut img, 0.1_f32);
1341
- * ```
1342
- * @param {PhotonImage} img
1343
- * @param {number} level
1344
- */
1345
- module.exports.lighten_hsl = function(img, level) {
1346
- _assertClass(img, PhotonImage);
1347
- wasm.lighten_hsl(img.__wbg_ptr, level);
1348
- };
1349
- /**
1350
- * Lighten an image by a specified amount in the HSV colour space.
1351
- *
1352
- * # Arguments
1353
- * * `img` - A PhotonImage.
1354
- * * `level` - Float value from 0 to 1 representing the level to which to lighten the image by.
1355
- * The `level` must be from 0 to 1 in floating-point, `f32` format.
1356
- * Lightening by 80% would be represented by a `level` of 0.8
1357
- *
1358
- * # Example
1359
- * ```no_run
1360
- * // For example to lighten an image by 10% in the HSV colour space:
1361
- * use photon_rs::colour_spaces::lighten_hsv;
1362
- * use photon_rs::native::open_image;
1363
- *
1364
- * // Open the image. A PhotonImage is returned.
1365
- * let mut img = open_image("img.jpg").expect("File should open");
1366
- * lighten_hsv(&mut img, 0.1_f32);
1367
- * ```
1368
- * @param {PhotonImage} img
1369
- * @param {number} level
1370
- */
1371
- module.exports.lighten_hsv = function(img, level) {
1372
- _assertClass(img, PhotonImage);
1373
- wasm.lighten_hsv(img.__wbg_ptr, level);
1374
- };
1375
- /**
1376
- * Darken the image by a specified amount in the LCh colour space.
1377
- *
1378
- * # Arguments
1379
- * * `img` - A PhotonImage.
1380
- * * `level` - Float value from 0 to 1 representing the level to which to darken the image by.
1381
- * The `level` must be from 0 to 1 in floating-point, `f32` format.
1382
- * Darkening by 80% would be represented by a `level` of 0.8
1383
- *
1384
- * # Example
1385
- * ```no_run
1386
- * // For example to darken an image by 10% in the LCh colour space:
1387
- * use photon_rs::colour_spaces::darken_lch;
1388
- * use photon_rs::native::open_image;
1389
- *
1390
- * // Open the image. A PhotonImage is returned.
1391
- * let mut img = open_image("img.jpg").expect("File should open");
1392
- * darken_lch(&mut img, 0.1_f32);
1393
- * ```
1394
- * @param {PhotonImage} img
1395
- * @param {number} level
1396
- */
1397
- module.exports.darken_lch = function(img, level) {
1398
- _assertClass(img, PhotonImage);
1399
- wasm.darken_lch(img.__wbg_ptr, level);
1400
- };
1401
- /**
1402
- * Darken the image by a specified amount in the HSLuv colour space.
1403
- *
1404
- * # Arguments
1405
- * * `img` - A PhotonImage.
1406
- * * `level` - Float value from 0 to 1 representing the level to which to darken the image by.
1407
- * The `level` must be from 0 to 1 in floating-point, `f32` format.
1408
- * Darkening by 80% would be represented by a `level` of 0.8
1409
- *
1410
- * # Example
1411
- * ```no_run
1412
- * // For example to darken an image by 10% in the HSLuv colour space:
1413
- * use photon_rs::colour_spaces::darken_hsluv;
1414
- * use photon_rs::native::open_image;
1415
- *
1416
- * // Open the image. A PhotonImage is returned.
1417
- * let mut img = open_image("img.jpg").expect("File should open");
1418
- * darken_hsluv(&mut img, 0.1_f32);
1419
- * ```
1420
- * @param {PhotonImage} img
1421
- * @param {number} level
1422
- */
1423
- module.exports.darken_hsluv = function(img, level) {
1424
- _assertClass(img, PhotonImage);
1425
- wasm.darken_hsluv(img.__wbg_ptr, level);
1426
- };
1427
- /**
1428
- * Darken the image by a specified amount in the HSL colour space.
1429
- *
1430
- * # Arguments
1431
- * * `img` - A PhotonImage.
1432
- * * `level` - Float value from 0 to 1 representing the level to which to darken the image by.
1433
- * The `level` must be from 0 to 1 in floating-point, `f32` format.
1434
- * Darkening by 80% would be represented by a `level` of 0.8
1435
- *
1436
- * # Example
1437
- * ```no_run
1438
- * // For example to darken an image by 10% in the HSL colour space:
1439
- * use photon_rs::colour_spaces::darken_hsl;
1440
- * use photon_rs::native::open_image;
1441
- *
1442
- * // Open the image. A PhotonImage is returned.
1443
- * let mut img = open_image("img.jpg").expect("File should open");
1444
- * darken_hsl(&mut img, 0.1_f32);
1445
- * ```
1446
- * @param {PhotonImage} img
1447
- * @param {number} level
1448
- */
1449
- module.exports.darken_hsl = function(img, level) {
1450
- _assertClass(img, PhotonImage);
1451
- wasm.darken_hsl(img.__wbg_ptr, level);
1452
- };
1453
- /**
1454
- * Darken the image's colours by a specified amount in the HSV colour space.
1455
- *
1456
- * # Arguments
1457
- * * `img` - A PhotonImage.
1458
- * * `level` - Float value from 0 to 1 representing the level to which to darken the image by.
1459
- * The `level` must be from 0 to 1 in floating-point, `f32` format.
1460
- * Darkening by 80% would be represented by a `level` of 0.8
1461
- *
1462
- * # Example
1463
- * ```no_run
1464
- * // For example to darken an image by 10% in the HSV colour space:
1465
- * use photon_rs::colour_spaces::darken_hsv;
1466
- * use photon_rs::native::open_image;
1467
- *
1468
- * // Open the image. A PhotonImage is returned.
1469
- * let mut img = open_image("img.jpg").expect("File should open");
1470
- * darken_hsv(&mut img, 0.1_f32);
1471
- * ```
1472
- * @param {PhotonImage} img
1473
- * @param {number} level
1474
- */
1475
- module.exports.darken_hsv = function(img, level) {
1476
- _assertClass(img, PhotonImage);
1477
- wasm.darken_hsv(img.__wbg_ptr, level);
1478
- };
1479
- /**
1480
- * Desaturate the image by a specified amount in the HSV colour space.
1481
- *
1482
- * # Arguments
1483
- * * `img` - A PhotonImage.
1484
- * * `level` - Float value from 0 to 1 representing the level to which to desaturate the image by.
1485
- * The `level` must be from 0 to 1 in floating-point, `f32` format.
1486
- * Desaturating by 80% would be represented by a `level` of 0.8
1487
- *
1488
- * # Example
1489
- * ```no_run
1490
- * // For example to desaturate an image by 10% in the HSV colour space:
1491
- * use photon_rs::colour_spaces::desaturate_hsv;
1492
- * use photon_rs::native::open_image;
1493
- *
1494
- * // Open the image. A PhotonImage is returned.
1495
- * let mut img = open_image("img.jpg").expect("File should open");
1496
- * desaturate_hsv(&mut img, 0.1_f32);
1497
- * ```
1498
- * @param {PhotonImage} img
1499
- * @param {number} level
1500
- */
1501
- module.exports.desaturate_hsv = function(img, level) {
1502
- _assertClass(img, PhotonImage);
1503
- wasm.desaturate_hsv(img.__wbg_ptr, level);
1504
- };
1505
- /**
1506
- * Desaturate the image by a specified amount in the HSL colour space.
1507
- *
1508
- * # Arguments
1509
- * * `img` - A PhotonImage.
1510
- * * `level` - Float value from 0 to 1 representing the level to which to desaturate the image by.
1511
- * The `level` must be from 0 to 1 in floating-point, `f32` format.
1512
- * Desaturating by 80% would be represented by a `level` of 0.8
1513
- *
1514
- * # Example
1515
- * ```no_run
1516
- * // For example to desaturate an image by 10% in the LCh colour space:
1517
- * use photon_rs::colour_spaces::desaturate_hsl;
1518
- * use photon_rs::native::open_image;
1519
- *
1520
- * // Open the image. A PhotonImage is returned.
1521
- * let mut img = open_image("img.jpg").expect("File should open");
1522
- * desaturate_hsl(&mut img, 0.1_f32);
1523
- * ```
1524
- * @param {PhotonImage} img
1525
- * @param {number} level
1526
- */
1527
- module.exports.desaturate_hsl = function(img, level) {
1528
- _assertClass(img, PhotonImage);
1529
- wasm.desaturate_hsl(img.__wbg_ptr, level);
1530
- };
1531
- /**
1532
- * Desaturate the image by a specified amount in the LCh colour space.
1533
- *
1534
- * # Arguments
1535
- * * `img` - A PhotonImage.
1536
- * * `level` - Float value from 0 to 1 representing the level to which to desaturate the image by.
1537
- * The `level` must be from 0 to 1 in floating-point, `f32` format.
1538
- * Desaturating by 80% would be represented by a `level` of 0.8
1539
- *
1540
- * # Example
1541
- * ```no_run
1542
- * // For example to desaturate an image by 10% in the LCh colour space:
1543
- * use photon_rs::colour_spaces::desaturate_lch;
1544
- * use photon_rs::native::open_image;
1545
- *
1546
- * // Open the image. A PhotonImage is returned.
1547
- * let mut img = open_image("img.jpg").expect("File should open");
1548
- * desaturate_lch(&mut img, 0.1_f32);
1549
- * ```
1550
- * @param {PhotonImage} img
1551
- * @param {number} level
1552
- */
1553
- module.exports.desaturate_lch = function(img, level) {
1554
- _assertClass(img, PhotonImage);
1555
- wasm.desaturate_lch(img.__wbg_ptr, level);
1556
- };
1557
- /**
1558
- * Desaturate the image by a specified amount in the HSLuv colour space.
1559
- *
1560
- * # Arguments
1561
- * * `img` - A PhotonImage.
1562
- * * `level` - Float value from 0 to 1 representing the level to which to desaturate the image by.
1563
- * The `level` must be from 0 to 1 in floating-point, `f32` format.
1564
- * Desaturating by 80% would be represented by a `level` of 0.8
1565
- *
1566
- * # Example
1567
- * ```no_run
1568
- * // For example to desaturate an image by 10% in the HSLuv colour space:
1569
- * use photon_rs::colour_spaces::desaturate_hsluv;
1570
- * use photon_rs::native::open_image;
1571
- *
1572
- * // Open the image. A PhotonImage is returned.
1573
- * let mut img = open_image("img.jpg").expect("File should open");
1574
- * desaturate_hsluv(&mut img, 0.1_f32);
1575
- * ```
1576
- * @param {PhotonImage} img
1577
- * @param {number} level
1578
- */
1579
- module.exports.desaturate_hsluv = function(img, level) {
1580
- _assertClass(img, PhotonImage);
1581
- wasm.desaturate_hsluv(img.__wbg_ptr, level);
1582
- };
1583
- /**
1584
- * Mix image with a single color, supporting passing `opacity`.
1585
- * The algorithm comes from Jimp. See `function mix` and `function colorFn` at following link:
1586
- * https://github.com/oliver-moran/jimp/blob/29679faa597228ff2f20d34c5758e4d2257065a3/packages/plugin-color/src/index.js
1587
- * Specifically, result_value = (mix_color_value - origin_value) * opacity + origin_value =
1588
- * mix_color_value * opacity + (1 - opacity) * origin_value for each
1589
- * of RGB channel.
1590
- *
1591
- * # Arguments
1592
- * * `photon_image` - A PhotonImage that contains a view into the image.
1593
- * * `mix_color` - the color to be mixed in, as an RGB value.
1594
- * * `opacity` - the opacity of color when mixed to image. Float value from 0 to 1.
1595
- * # Example
1596
- *
1597
- * ```no_run
1598
- * // For example, to mix an image with rgb (50, 255, 254) and opacity 0.4:
1599
- * use photon_rs::Rgb;
1600
- * use photon_rs::colour_spaces::mix_with_colour;
1601
- * use photon_rs::native::open_image;
1602
- *
1603
- * let mix_colour = Rgb::new(50_u8, 255_u8, 254_u8);
1604
- * let mut img = open_image("img.jpg").expect("File should open");
1605
- * mix_with_colour(&mut img, mix_colour, 0.4_f32);
1606
- * ```
1607
- * @param {PhotonImage} photon_image
1608
- * @param {Rgb} mix_colour
1609
- * @param {number} opacity
1610
- */
1611
- module.exports.mix_with_colour = function(photon_image, mix_colour, opacity) {
1612
- _assertClass(photon_image, PhotonImage);
1613
- _assertClass(mix_colour, Rgb);
1614
- var ptr0 = mix_colour.__destroy_into_raw();
1615
- wasm.mix_with_colour(photon_image.__wbg_ptr, ptr0, opacity);
1616
- };
1617
- /**
1618
- * Noise reduction.
1619
- *
1620
- * # Arguments
1621
- * * `img` - A PhotonImage.
1622
- *
1623
- * # Example
1624
- *
1625
- * ```no_run
1626
- * // For example, to noise reduct an image:
1627
- * use photon_rs::conv::noise_reduction;
1628
- * use photon_rs::native::open_image;
1629
- *
1630
- * let mut img = open_image("img.jpg").expect("File should open");
1631
- * noise_reduction(&mut img);
1632
- * ```
1633
- * Adds a constant to a select R, G, or B channel's value.
1634
- * @param {PhotonImage} photon_image
1635
- */
1636
- module.exports.noise_reduction = function(photon_image) {
1637
- _assertClass(photon_image, PhotonImage);
1638
- wasm.noise_reduction(photon_image.__wbg_ptr);
1639
- };
1640
- /**
1641
- * Sharpen an image.
1642
- *
1643
- * # Arguments
1644
- * * `img` - A PhotonImage.
1645
- *
1646
- * # Example
1647
- *
1648
- * ```no_run
1649
- * // For example, to sharpen an image:
1650
- * use photon_rs::conv::sharpen;
1651
- * use photon_rs::native::open_image;
1652
- *
1653
- * let mut img = open_image("img.jpg").expect("File should open");
1654
- * sharpen(&mut img);
1655
- * ```
1656
- * Adds a constant to a select R, G, or B channel's value.
1657
- * @param {PhotonImage} photon_image
1658
- */
1659
- module.exports.sharpen = function(photon_image) {
1660
- _assertClass(photon_image, PhotonImage);
1661
- wasm.sharpen(photon_image.__wbg_ptr);
1662
- };
1663
- /**
1664
- * Apply edge detection to an image, to create a dark version with its edges highlighted.
1665
- *
1666
- * # Arguments
1667
- * * `img` - A PhotonImage.
1668
- *
1669
- * # Example
1670
- *
1671
- * ```no_run
1672
- * // For example, to increase the Red channel for all pixels by 10:
1673
- * use photon_rs::conv::edge_detection;
1674
- * use photon_rs::native::open_image;
1675
- *
1676
- * let mut img = open_image("img.jpg").expect("File should open");
1677
- * edge_detection(&mut img);
1678
- * ```
1679
- * @param {PhotonImage} photon_image
1680
- */
1681
- module.exports.edge_detection = function(photon_image) {
1682
- _assertClass(photon_image, PhotonImage);
1683
- wasm.edge_detection(photon_image.__wbg_ptr);
1684
- };
1685
- /**
1686
- * Apply an identity kernel convolution to an image.
1687
- *
1688
- * # Arguments
1689
- * * `img` -A PhotonImage.
1690
- *
1691
- * # Example
1692
- *
1693
- * ```no_run
1694
- * // For example, to apply an identity kernel convolution:
1695
- * use photon_rs::conv::identity;
1696
- * use photon_rs::native::open_image;
1697
- *
1698
- * let mut img = open_image("img.jpg").expect("File should open");
1699
- * identity(&mut img);
1700
- * ```
1701
- * @param {PhotonImage} photon_image
1702
- */
1703
- module.exports.identity = function(photon_image) {
1704
- _assertClass(photon_image, PhotonImage);
1705
- wasm.identity(photon_image.__wbg_ptr);
1706
- };
1707
- /**
1708
- * Apply a box blur effect.
1709
- *
1710
- * # Arguments
1711
- * * `img` - A PhotonImage.
1712
- *
1713
- * # Example
1714
- *
1715
- * ```no_run
1716
- * // For example, to apply a box blur effect:
1717
- * use photon_rs::conv::box_blur;
1718
- * use photon_rs::native::open_image;
1719
- *
1720
- * let mut img = open_image("img.jpg").expect("File should open");
1721
- * box_blur(&mut img);
1722
- * ```
1723
- * @param {PhotonImage} photon_image
1724
- */
1725
- module.exports.box_blur = function(photon_image) {
1726
- _assertClass(photon_image, PhotonImage);
1727
- wasm.box_blur(photon_image.__wbg_ptr);
1728
- };
1729
- /**
1730
- * Gaussian blur in linear time.
1731
- *
1732
- * Reference: http://blog.ivank.net/fastest-gaussian-blur.html
1733
- *
1734
- * # Arguments
1735
- * * `photon_image` - A PhotonImage
1736
- * * `radius` - blur radius
1737
- * # Example
1738
- *
1739
- * ```no_run
1740
- * use photon_rs::conv::gaussian_blur;
1741
- * use photon_rs::native::open_image;
1742
- *
1743
- * let mut img = open_image("img.jpg").expect("File should open");
1744
- * gaussian_blur(&mut img, 3_i32);
1745
- * ```
1746
- * @param {PhotonImage} photon_image
1747
- * @param {number} radius
1748
- */
1749
- module.exports.gaussian_blur = function(photon_image, radius) {
1750
- _assertClass(photon_image, PhotonImage);
1751
- wasm.gaussian_blur(photon_image.__wbg_ptr, radius);
1752
- };
1753
- /**
1754
- * Detect horizontal lines in an image, and highlight these only.
1755
- *
1756
- * # Arguments
1757
- * * `img` - A PhotonImage.
1758
- *
1759
- * # Example
1760
- *
1761
- * ```no_run
1762
- * // For example, to display the horizontal lines in an image:
1763
- * use photon_rs::conv::detect_horizontal_lines;
1764
- * use photon_rs::native::open_image;
1765
- *
1766
- * let mut img = open_image("img.jpg").expect("File should open");
1767
- * detect_horizontal_lines(&mut img);
1768
- * ```
1769
- * @param {PhotonImage} photon_image
1770
- */
1771
- module.exports.detect_horizontal_lines = function(photon_image) {
1772
- _assertClass(photon_image, PhotonImage);
1773
- wasm.detect_horizontal_lines(photon_image.__wbg_ptr);
1774
- };
1775
- /**
1776
- * Detect vertical lines in an image, and highlight these only.
1777
- *
1778
- * # Arguments
1779
- * * `img` - A PhotonImage.
1780
- *
1781
- * # Example
1782
- *
1783
- * ```no_run
1784
- * // For example, to display the vertical lines in an image:
1785
- * use photon_rs::conv::detect_vertical_lines;
1786
- * use photon_rs::native::open_image;
1787
- *
1788
- * let mut img = open_image("img.jpg").expect("File should open");
1789
- * detect_vertical_lines(&mut img);
1790
- * ```
1791
- * @param {PhotonImage} photon_image
1792
- */
1793
- module.exports.detect_vertical_lines = function(photon_image) {
1794
- _assertClass(photon_image, PhotonImage);
1795
- wasm.detect_vertical_lines(photon_image.__wbg_ptr);
1796
- };
1797
- /**
1798
- * Detect lines at a forty five degree angle in an image, and highlight these only.
1799
- *
1800
- * # Arguments
1801
- * * `img` - A PhotonImage.
1802
- *
1803
- * # Example
1804
- *
1805
- * ```no_run
1806
- * // For example, to display the lines at a forty five degree angle in an image:
1807
- * use photon_rs::conv::detect_45_deg_lines;
1808
- * use photon_rs::native::open_image;
1809
- *
1810
- * let mut img = open_image("img.jpg").expect("File should open");
1811
- * detect_45_deg_lines(&mut img);
1812
- * ```
1813
- * @param {PhotonImage} photon_image
1814
- */
1815
- module.exports.detect_45_deg_lines = function(photon_image) {
1816
- _assertClass(photon_image, PhotonImage);
1817
- wasm.detect_45_deg_lines(photon_image.__wbg_ptr);
1818
- };
1819
- /**
1820
- * Detect lines at a 135 degree angle in an image, and highlight these only.
1821
- *
1822
- * # Arguments
1823
- * * `img` - A PhotonImage.
1824
- *
1825
- * # Example
1826
- *
1827
- * ```no_run
1828
- * // For example, to display the lines at a 135 degree angle in an image:
1829
- * use photon_rs::conv::detect_135_deg_lines;
1830
- * use photon_rs::native::open_image;
1831
- *
1832
- * let mut img = open_image("img.jpg").expect("File should open");
1833
- * detect_135_deg_lines(&mut img);
1834
- * ```
1835
- * @param {PhotonImage} photon_image
1836
- */
1837
- module.exports.detect_135_deg_lines = function(photon_image) {
1838
- _assertClass(photon_image, PhotonImage);
1839
- wasm.detect_135_deg_lines(photon_image.__wbg_ptr);
1840
- };
1841
- /**
1842
- * Apply a standard laplace convolution.
1843
- *
1844
- * # Arguments
1845
- * * `img` - A PhotonImage.
1846
- *
1847
- * # Example
1848
- *
1849
- * ```no_run
1850
- * // For example, to apply a laplace effect:
1851
- * use photon_rs::conv::laplace;
1852
- * use photon_rs::native::open_image;
1853
- *
1854
- * let mut img = open_image("img.jpg").expect("File should open");
1855
- * laplace(&mut img);
1856
- * ```
1857
- * @param {PhotonImage} photon_image
1858
- */
1859
- module.exports.laplace = function(photon_image) {
1860
- _assertClass(photon_image, PhotonImage);
1861
- wasm.laplace(photon_image.__wbg_ptr);
1862
- };
1863
- /**
1864
- * Preset edge effect.
1865
- *
1866
- * # Arguments
1867
- * * `img` - A PhotonImage.
1868
- *
1869
- * # Example
1870
- *
1871
- * ```no_run
1872
- * // For example, to apply this effect:
1873
- * use photon_rs::conv::edge_one;
1874
- * use photon_rs::native::open_image;
1875
- *
1876
- * let mut img = open_image("img.jpg").expect("File should open");
1877
- * edge_one(&mut img);
1878
- * ```
1879
- * @param {PhotonImage} photon_image
1880
- */
1881
- module.exports.edge_one = function(photon_image) {
1882
- _assertClass(photon_image, PhotonImage);
1883
- wasm.edge_one(photon_image.__wbg_ptr);
1884
- };
1885
- /**
1886
- * Apply an emboss effect to an image.
1887
- *
1888
- * # Arguments
1889
- * * `img` - A PhotonImage.
1890
- *
1891
- * # Example
1892
- *
1893
- * ```no_run
1894
- * // For example, to apply an emboss effect:
1895
- * use photon_rs::conv::emboss;
1896
- * use photon_rs::native::open_image;
1897
- *
1898
- * let mut img = open_image("img.jpg").expect("File should open");
1899
- * emboss(&mut img);
1900
- * ```
1901
- * @param {PhotonImage} photon_image
1902
- */
1903
- module.exports.emboss = function(photon_image) {
1904
- _assertClass(photon_image, PhotonImage);
1905
- wasm.emboss(photon_image.__wbg_ptr);
1906
- };
1907
- /**
1908
- * Apply a horizontal Sobel filter to an image.
1909
- *
1910
- * # Arguments
1911
- * * `img` - A PhotonImage.
1912
- *
1913
- * # Example
1914
- *
1915
- * ```no_run
1916
- * // For example, to apply a horizontal Sobel filter:
1917
- * use photon_rs::conv::sobel_horizontal;
1918
- * use photon_rs::native::open_image;
1919
- *
1920
- * let mut img = open_image("img.jpg").expect("File should open");
1921
- * sobel_horizontal(&mut img);
1922
- * ```
1923
- * @param {PhotonImage} photon_image
1924
- */
1925
- module.exports.sobel_horizontal = function(photon_image) {
1926
- _assertClass(photon_image, PhotonImage);
1927
- wasm.sobel_horizontal(photon_image.__wbg_ptr);
1928
- };
1929
- /**
1930
- * Apply a horizontal Prewitt convolution to an image.
1931
- *
1932
- * # Arguments
1933
- * * `img` - A PhotonImage.
1934
- *
1935
- * # Example
1936
- *
1937
- * ```no_run
1938
- * // For example, to apply a horizontal Prewitt convolution effect:
1939
- * use photon_rs::conv::prewitt_horizontal;
1940
- * use photon_rs::native::open_image;
1941
- *
1942
- * let mut img = open_image("img.jpg").expect("File should open");
1943
- * prewitt_horizontal(&mut img);
1944
- * ```
1945
- * @param {PhotonImage} photon_image
1946
- */
1947
- module.exports.prewitt_horizontal = function(photon_image) {
1948
- _assertClass(photon_image, PhotonImage);
1949
- wasm.prewitt_horizontal(photon_image.__wbg_ptr);
1950
- };
1951
- /**
1952
- * Apply a vertical Sobel filter to an image.
1953
- *
1954
- * # Arguments
1955
- * * `img` - A PhotonImage.
1956
- *
1957
- * # Example
1958
- *
1959
- * ```no_run
1960
- * // For example, to apply a vertical Sobel filter:
1961
- * use photon_rs::conv::sobel_vertical;
1962
- * use photon_rs::native::open_image;
1963
- *
1964
- * let mut img = open_image("img.jpg").expect("File should open");
1965
- * sobel_vertical(&mut img);
1966
- * ```
1967
- * @param {PhotonImage} photon_image
1968
- */
1969
- module.exports.sobel_vertical = function(photon_image) {
1970
- _assertClass(photon_image, PhotonImage);
1971
- wasm.sobel_vertical(photon_image.__wbg_ptr);
1972
- };
1973
- /**
1974
- * Apply a global Sobel filter to an image
1975
- *
1976
- * Each pixel is calculated as the magnitude of the horizontal and vertical components of the Sobel filter,
1977
- * ie if X is the horizontal sobel and Y is the vertical, for each pixel, we calculate sqrt(X^2 + Y^2)
1978
- *
1979
- * # Arguments
1980
- * * `img` - A PhotonImage.
1981
- *
1982
- * # Example
1983
- *
1984
- * ```no_run
1985
- * // For example, to apply a global Sobel filter:
1986
- * use photon_rs::conv::sobel_global;
1987
- * use photon_rs::native::open_image;
1988
- *
1989
- * let mut img = open_image("img.jpg").expect("File should open");
1990
- * sobel_global(&mut img);
1991
- * ```
1992
- * @param {PhotonImage} photon_image
1993
- */
1994
- module.exports.sobel_global = function(photon_image) {
1995
- _assertClass(photon_image, PhotonImage);
1996
- wasm.sobel_global(photon_image.__wbg_ptr);
1997
- };
1998
- /**
1999
- * Add randomized noise to an image.
2000
- * This function adds a Gaussian Noise Sample to each pixel through incrementing each channel by a randomized offset.
2001
- * This randomized offset is generated by creating a randomized thread pool.
2002
- * **[WASM SUPPORT IS AVAILABLE]**: Randomized thread pools cannot be created with WASM, but
2003
- * a workaround using js_sys::Math::random works now.
2004
- * # Arguments
2005
- * * `img` - A PhotonImage.
2006
- *
2007
- * # Example
2008
- *
2009
- * ```no_run
2010
- * // For example:
2011
- * use photon_rs::native::open_image;
2012
- * use photon_rs::noise::add_noise_rand;
2013
- * use photon_rs::PhotonImage;
2014
- *
2015
- * let mut img = open_image("img.jpg").expect("File should open");
2016
- * add_noise_rand(&mut img);
2017
- * ```
2018
- * @param {PhotonImage} photon_image
2019
- */
2020
- module.exports.add_noise_rand = function(photon_image) {
2021
- _assertClass(photon_image, PhotonImage);
2022
- wasm.add_noise_rand(photon_image.__wbg_ptr);
2023
- };
2024
- /**
2025
- * Add pink-tinted noise to an image.
2026
- *
2027
- * **[WASM SUPPORT IS AVAILABLE]**: Randomized thread pools cannot be created with WASM, but
2028
- * a workaround using js_sys::Math::random works now.
2029
- * # Arguments
2030
- * * `name` - A PhotonImage that contains a view into the image.
2031
- *
2032
- * # Example
2033
- *
2034
- * ```no_run
2035
- * // For example, to add pink-tinted noise to an image:
2036
- * use photon_rs::native::open_image;
2037
- * use photon_rs::noise::pink_noise;
2038
- *
2039
- * let mut img = open_image("img.jpg").expect("File should open");
2040
- * pink_noise(&mut img);
2041
- * ```
2042
- * @param {PhotonImage} photon_image
2043
- */
2044
- module.exports.pink_noise = function(photon_image) {
2045
- _assertClass(photon_image, PhotonImage);
2046
- wasm.pink_noise(photon_image.__wbg_ptr);
2047
- };
2048
- /**
2049
- * Add a watermark to an image.
2050
- *
2051
- * # Arguments
2052
- * * `img` - A DynamicImage that contains a view into the image.
2053
- * * `watermark` - The watermark to be placed onto the `img` image.
2054
- * * `x` - The x coordinate where the watermark's top corner should be positioned.
2055
- * * `y` - The y coordinate where the watermark's top corner should be positioned.
2056
- * # Example
2057
- *
2058
- * ```no_run
2059
- * // For example, to add a watermark to an image at x: 30, y: 40:
2060
- * use photon_rs::multiple::watermark;
2061
- * use photon_rs::native::open_image;
2062
- *
2063
- * let mut img = open_image("img.jpg").expect("File should open");
2064
- * let water_mark = open_image("watermark.jpg").expect("File should open");
2065
- * watermark(&mut img, &water_mark, 30_i64, 40_i64);
2066
- * ```
2067
- * @param {PhotonImage} img
2068
- * @param {PhotonImage} watermark
2069
- * @param {bigint} x
2070
- * @param {bigint} y
2071
- */
2072
- module.exports.watermark = function(img, watermark, x, y) {
2073
- _assertClass(img, PhotonImage);
2074
- _assertClass(watermark, PhotonImage);
2075
- wasm.watermark(img.__wbg_ptr, watermark.__wbg_ptr, x, y);
2076
- };
2077
- /**
2078
- * Blend two images together.
2079
- *
2080
- * The `blend_mode` (3rd param) determines which blending mode to use; change this for varying effects.
2081
- * The blend modes available include: `overlay`, `over`, `atop`, `xor`, `plus`, `multiply`, `burn`,
2082
- * `difference`, `soft_light`, `screen`, `hard_light`, `dodge`, `exclusion`, `lighten`, `darken` (more to come)
2083
- * NOTE: The first image must be smaller than the second image passed as params.
2084
- * If the first image were larger than the second, then there would be overflowing pixels which would have no corresponding pixels
2085
- * in the second image.
2086
- * # Arguments
2087
- * * `img` - A DynamicImage that contains a view into the image.
2088
- * * `img2` - The 2nd DynamicImage to be blended with the first.
2089
- * * `blend_mode` - The blending mode to use. See above for complete list of blend modes available.
2090
- * # Example
2091
- *
2092
- * ```no_run
2093
- * // For example, to blend two images with the `multiply` blend mode:
2094
- * use photon_rs::multiple::blend;
2095
- * use photon_rs::native::open_image;
2096
- *
2097
- * let mut img = open_image("img.jpg").expect("File should open");
2098
- * let img2 = open_image("img2.jpg").expect("File should open");
2099
- * blend(&mut img, &img2, "multiply");
2100
- * ```
2101
- * @param {PhotonImage} photon_image
2102
- * @param {PhotonImage} photon_image2
2103
- * @param {string} blend_mode
2104
- */
2105
- module.exports.blend = function(photon_image, photon_image2, blend_mode) {
2106
- _assertClass(photon_image, PhotonImage);
2107
- _assertClass(photon_image2, PhotonImage);
2108
- const ptr0 = passStringToWasm0(blend_mode, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2109
- const len0 = WASM_VECTOR_LEN;
2110
- wasm.blend(photon_image.__wbg_ptr, photon_image2.__wbg_ptr, ptr0, len0);
2111
- };
2112
- /**
2113
- * @param {number} width
2114
- * @param {number} height
2115
- * @returns {PhotonImage}
2116
- */
2117
- module.exports.create_gradient = function(width, height) {
2118
- const ret = wasm.create_gradient(width, height);
2119
- return PhotonImage.__wrap(ret);
2120
- };
2121
- /**
2122
- * Apply a gradient to an image.
2123
- * @param {PhotonImage} image
2124
- */
2125
- module.exports.apply_gradient = function(image) {
2126
- _assertClass(image, PhotonImage);
2127
- wasm.apply_gradient(image.__wbg_ptr);
2128
- };
2129
- /**
2130
- * Solarization on the Blue channel.
2131
- *
2132
- * # Arguments
2133
- * * `img` - A PhotonImage.
2134
- * # Example
2135
- *
2136
- * ```no_run
2137
- * use photon_rs::filters::neue;
2138
- * use photon_rs::native::open_image;
2139
- *
2140
- * let mut img = open_image("img.jpg").expect("File should open");
2141
- * neue(&mut img);
2142
- * ```
2143
- * @param {PhotonImage} photon_image
2144
- */
2145
- module.exports.neue = function(photon_image) {
2146
- _assertClass(photon_image, PhotonImage);
2147
- wasm.neue(photon_image.__wbg_ptr);
2148
- };
2149
- /**
2150
- * Solarization on the Red and Green channels.
2151
- *
2152
- * # Arguments
2153
- * * `img` - A PhotonImage.
2154
- * # Example
2155
- *
2156
- * ```no_run
2157
- * use photon_rs::filters::lix;
2158
- * use photon_rs::native::open_image;
2159
- *
2160
- * let mut img = open_image("img.jpg").expect("File should open");
2161
- * lix(&mut img);
2162
- * ```
2163
- * @param {PhotonImage} photon_image
2164
- */
2165
- module.exports.lix = function(photon_image) {
2166
- _assertClass(photon_image, PhotonImage);
2167
- wasm.lix(photon_image.__wbg_ptr);
2168
- };
2169
- /**
2170
- * Solarization on the Red and Blue channels.
2171
- *
2172
- * # Arguments
2173
- * * `img` - A PhotonImage.
2174
- * # Example
2175
- *
2176
- * ```no_run
2177
- * use photon_rs::filters::ryo;
2178
- * use photon_rs::native::open_image;
2179
- *
2180
- * let mut img = open_image("img.jpg").expect("File should open");
2181
- * ryo(&mut img);
2182
- * ```
2183
- * @param {PhotonImage} photon_image
2184
- */
2185
- module.exports.ryo = function(photon_image) {
2186
- _assertClass(photon_image, PhotonImage);
2187
- wasm.ryo(photon_image.__wbg_ptr);
2188
- };
2189
- /**
2190
- * Apply a filter to an image. Over 20 filters are available.
2191
- * The filters are as follows:
2192
- * * **oceanic**: Add an aquamarine-tinted hue to an image.
2193
- * * **islands**: Aquamarine tint.
2194
- * * **marine**: Add a green/blue mixed hue to an image.
2195
- * * **seagreen**: Dark green hue, with tones of blue.
2196
- * * **flagblue**: Royal blue tint
2197
- * * **liquid**: Blue-inspired tint.
2198
- * * **diamante**: Custom filter with a blue/turquoise tint.
2199
- * * **radio**: Fallout-style radio effect.
2200
- * * **twenties**: Slight-blue tinted historical effect.
2201
- * * **rosetint**: Rose-tinted filter.
2202
- * * **mauve**: Purple-infused filter.
2203
- * * **bluechrome**: Blue monochrome effect.
2204
- * * **vintage**: Vintage filter with a red tint.
2205
- * * **perfume**: Increase the blue channel, with moderate increases in the Red and Green channels.
2206
- * * **serenity**: Custom filter with an increase in the Blue channel's values.
2207
- * # Arguments
2208
- * * `img` - A PhotonImage.
2209
- * * `filter_name` - The filter's name. Choose from the selection above, eg: "oceanic"
2210
- * # Example
2211
- *
2212
- * ```no_run
2213
- * // For example, to add a filter called "vintage" to an image:
2214
- * use photon_rs::filters::filter;
2215
- * use photon_rs::native::open_image;
2216
- *
2217
- * let mut img = open_image("img.jpg").expect("File should open");
2218
- * filter(&mut img, "vintage");
2219
- * ```
2220
- * @param {PhotonImage} img
2221
- * @param {string} filter_name
2222
- */
2223
- module.exports.filter = function(img, filter_name) {
2224
- _assertClass(img, PhotonImage);
2225
- const ptr0 = passStringToWasm0(filter_name, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
2226
- const len0 = WASM_VECTOR_LEN;
2227
- wasm.filter(img.__wbg_ptr, ptr0, len0);
2228
- };
2229
- /**
2230
- * Apply a lofi effect to an image.
2231
- *
2232
- * # Arguments
2233
- * * `img` - A PhotonImage.
2234
- * # Example
2235
- *
2236
- * ```no_run
2237
- * use photon_rs::filters::lofi;
2238
- * use photon_rs::native::open_image;
2239
- *
2240
- * let mut img = open_image("img.jpg").expect("File should open");
2241
- * lofi(&mut img);
2242
- * ```
2243
- * @param {PhotonImage} img
2244
- */
2245
- module.exports.lofi = function(img) {
2246
- _assertClass(img, PhotonImage);
2247
- wasm.lofi(img.__wbg_ptr);
2248
- };
2249
- /**
2250
- * Apply a rose tint to an image.
2251
- *
2252
- * # Arguments
2253
- * * `img` - A PhotonImage.
2254
- * # Example
2255
- *
2256
- * ```no_run
2257
- * use photon_rs::filters::pastel_pink;
2258
- * use photon_rs::native::open_image;
2259
- *
2260
- * let mut img = open_image("img.jpg").expect("File should open");
2261
- * pastel_pink(&mut img);
2262
- * ```
2263
- * @param {PhotonImage} img
2264
- */
2265
- module.exports.pastel_pink = function(img) {
2266
- _assertClass(img, PhotonImage);
2267
- wasm.pastel_pink(img.__wbg_ptr);
2268
- };
2269
- /**
2270
- * Apply a vintage, golden hue to an image.
2271
- *
2272
- * # Arguments
2273
- * * `img` - A PhotonImage.
2274
- * # Example
2275
- *
2276
- * ```no_run
2277
- * use photon_rs::filters::golden;
2278
- * use photon_rs::native::open_image;
2279
- *
2280
- * let mut img = open_image("img.jpg").expect("File should open");
2281
- * golden(&mut img);
2282
- * ```
2283
- * @param {PhotonImage} img
2284
- */
2285
- module.exports.golden = function(img) {
2286
- _assertClass(img, PhotonImage);
2287
- wasm.golden(img.__wbg_ptr);
2288
- };
2289
- /**
2290
- * Increased contrast filter effect.
2291
- *
2292
- * # Arguments
2293
- * * `img` - A PhotonImage.
2294
- * # Example
2295
- *
2296
- * ```no_run
2297
- * use photon_rs::filters::cali;
2298
- * use photon_rs::native::open_image;
2299
- *
2300
- * let mut img = open_image("img.jpg").expect("File should open");
2301
- * cali(&mut img);
2302
- * ```
2303
- * @param {PhotonImage} img
2304
- */
2305
- module.exports.cali = function(img) {
2306
- _assertClass(img, PhotonImage);
2307
- wasm.cali(img.__wbg_ptr);
2308
- };
2309
- /**
2310
- * Greyscale effect with increased contrast.
2311
- *
2312
- * # Arguments
2313
- * * `img` - A PhotonImage.
2314
- * # Example
2315
- *
2316
- * ```no_run
2317
- * use photon_rs::filters::dramatic;
2318
- * use photon_rs::native::open_image;
2319
- *
2320
- * let mut img = open_image("img.jpg").expect("File should open");
2321
- * dramatic(&mut img);
2322
- * ```
2323
- * @param {PhotonImage} img
2324
- */
2325
- module.exports.dramatic = function(img) {
2326
- _assertClass(img, PhotonImage);
2327
- wasm.dramatic(img.__wbg_ptr);
2328
- };
2329
- /**
2330
- * Monochrome tint effect with increased contrast
2331
- *
2332
- * # Arguments
2333
- * * `img` - A PhotonImage.
2334
- * * `rgb_color` - RGB color
2335
- * # Example
2336
- *
2337
- * ```no_run
2338
- * use photon_rs::filters::monochrome_tint;
2339
- * use photon_rs::native::open_image;
2340
- * use photon_rs::Rgb;
2341
- *
2342
- * let mut img = open_image("img.jpg").expect("File should open");
2343
- * let rgb_color = Rgb::new(12, 12, 10);
2344
- * monochrome_tint(&mut img, rgb_color);
2345
- * ```
2346
- * @param {PhotonImage} img
2347
- * @param {Rgb} rgb_color
2348
- */
2349
- module.exports.monochrome_tint = function(img, rgb_color) {
2350
- _assertClass(img, PhotonImage);
2351
- _assertClass(rgb_color, Rgb);
2352
- var ptr0 = rgb_color.__destroy_into_raw();
2353
- wasm.monochrome_tint(img.__wbg_ptr, ptr0);
2354
- };
2355
- /**
2356
- * Duotone effect with blue and purple tones.
2357
- *
2358
- * # Arguments
2359
- * * `img` - A PhotonImage.
2360
- * # Example
2361
- *
2362
- * ```no_run
2363
- * use photon_rs::filters::duotone_violette;
2364
- * use photon_rs::native::open_image;
2365
- *
2366
- * let mut img = open_image("img.jpg").expect("File should open");
2367
- * duotone_violette(&mut img);
2368
- * ```
2369
- * @param {PhotonImage} img
2370
- */
2371
- module.exports.duotone_violette = function(img) {
2372
- _assertClass(img, PhotonImage);
2373
- wasm.duotone_violette(img.__wbg_ptr);
2374
- };
2375
- /**
2376
- * Duotone effect with purple tones.
2377
- *
2378
- * # Arguments
2379
- * * `img` - A PhotonImage.
2380
- * # Example
2381
- *
2382
- * ```no_run
2383
- * use photon_rs::filters::duotone_horizon;
2384
- * use photon_rs::native::open_image;
2385
- *
2386
- * let mut img = open_image("img.jpg").expect("File should open");
2387
- * duotone_horizon(&mut img);
2388
- * ```
2389
- * @param {PhotonImage} img
2390
- */
2391
- module.exports.duotone_horizon = function(img) {
2392
- _assertClass(img, PhotonImage);
2393
- wasm.duotone_horizon(img.__wbg_ptr);
2394
- };
2395
- /**
2396
- * A duotone filter with a user-specified color and a gray color
2397
- *
2398
- * # Arguments
2399
- * * `img` - A PhotonImage.
2400
- * * `rgb_color` - RGB color
2401
- * # Example
2402
- *
2403
- * ```no_run
2404
- * use photon_rs::filters::duotone_tint;
2405
- * use photon_rs::native::open_image;
2406
- * use photon_rs::Rgb;
2407
- *
2408
- * let mut img = open_image("img.jpg").expect("File should open");
2409
- * let rgb_color = Rgb::new(12, 12, 10);
2410
- * duotone_tint(&mut img, rgb_color);
2411
- * ```
2412
- * @param {PhotonImage} img
2413
- * @param {Rgb} rgb_color
2414
- */
2415
- module.exports.duotone_tint = function(img, rgb_color) {
2416
- _assertClass(img, PhotonImage);
2417
- _assertClass(rgb_color, Rgb);
2418
- var ptr0 = rgb_color.__destroy_into_raw();
2419
- wasm.duotone_tint(img.__wbg_ptr, ptr0);
2420
- };
2421
- /**
2422
- * Duotone effect with a lilac hue
2423
- *
2424
- * # Arguments
2425
- * * `img` - A PhotonImage.
2426
- * # Example
2427
- *
2428
- * ```no_run
2429
- * use photon_rs::filters::duotone_lilac;
2430
- * use photon_rs::native::open_image;
2431
- *
2432
- * let mut img = open_image("img.jpg").expect("File should open");
2433
- * duotone_lilac(&mut img);
2434
- * ```
2435
- * @param {PhotonImage} img
2436
- */
2437
- module.exports.duotone_lilac = function(img) {
2438
- _assertClass(img, PhotonImage);
2439
- wasm.duotone_lilac(img.__wbg_ptr);
2440
- };
2441
- /**
2442
- * A duotone ochre tint effect
2443
- *
2444
- * # Arguments
2445
- * * `img` - A PhotonImage.
2446
- * # Example
2447
- *
2448
- * ```no_run
2449
- * use photon_rs::filters::duotone_ochre;
2450
- * use photon_rs::native::open_image;
2451
- *
2452
- * let mut img = open_image("img.jpg").expect("File should open");
2453
- * duotone_ochre(&mut img);
2454
- * ```
2455
- * @param {PhotonImage} img
2456
- */
2457
- module.exports.duotone_ochre = function(img) {
2458
- _assertClass(img, PhotonImage);
2459
- wasm.duotone_ochre(img.__wbg_ptr);
2460
- };
2461
- /**
2462
- * Apply a red hue, with increased contrast and brightness.
2463
- *
2464
- * # Arguments
2465
- * * `img` - A PhotonImage.
2466
- * # Example
2467
- *
2468
- * ```no_run
2469
- * use photon_rs::filters::firenze;
2470
- * use photon_rs::native::open_image;
2471
- *
2472
- * let mut img = open_image("img.jpg").expect("File should open");
2473
- * firenze(&mut img);
2474
- * ```
2475
- * @param {PhotonImage} img
2476
- */
2477
- module.exports.firenze = function(img) {
2478
- _assertClass(img, PhotonImage);
2479
- wasm.firenze(img.__wbg_ptr);
2480
- };
2481
- /**
2482
- * Apply a greyscale effect with increased contrast.
2483
- *
2484
- * # Arguments
2485
- * * `img` - A PhotonImage.
2486
- * # Example
2487
- *
2488
- * ```no_run
2489
- * use photon_rs::filters::obsidian;
2490
- * use photon_rs::native::open_image;
2491
- *
2492
- * let mut img = open_image("img.jpg").expect("File should open");
2493
- * obsidian(&mut img);
2494
- * ```
2495
- * @param {PhotonImage} img
2496
- */
2497
- module.exports.obsidian = function(img) {
2498
- _assertClass(img, PhotonImage);
2499
- wasm.obsidian(img.__wbg_ptr);
2500
- };
2501
- /**
2502
- * Crop an image.
2503
- *
2504
- * # Arguments
2505
- * * `img` - A PhotonImage.
2506
- *
2507
- * # Example
2508
- *
2509
- * ```no_run
2510
- * // For example, to crop an image at (0, 0) to (500, 800)
2511
- * use photon_rs::native::{open_image};
2512
- * use photon_rs::transform::crop;
2513
- * use photon_rs::PhotonImage;
2514
- *
2515
- * let mut img = open_image("img.jpg").expect("File should open");
2516
- * let cropped_img: PhotonImage = crop(&img, 0_u32, 0_u32, 500_u32, 800_u32);
2517
- * // Write the contents of this image in JPG format.
2518
- * ```
2519
- * @param {PhotonImage} photon_image
2520
- * @param {number} x1
2521
- * @param {number} y1
2522
- * @param {number} x2
2523
- * @param {number} y2
2524
- * @returns {PhotonImage}
2525
- */
2526
- module.exports.crop = function(photon_image, x1, y1, x2, y2) {
2527
- _assertClass(photon_image, PhotonImage);
2528
- const ret = wasm.crop(photon_image.__wbg_ptr, x1, y1, x2, y2);
2529
- return PhotonImage.__wrap(ret);
2530
- };
2531
- /**
2532
- * @param {HTMLCanvasElement} source_canvas
2533
- * @param {number} width
2534
- * @param {number} height
2535
- * @param {number} left
2536
- * @param {number} top
2537
- * @returns {HTMLCanvasElement}
2538
- */
2539
- module.exports.crop_img_browser = function(source_canvas, width, height, left, top) {
2540
- return wasm.crop_img_browser(source_canvas, width, height, left, top);
2541
- };
2542
- /**
2543
- * Flip an image horizontally.
2544
- *
2545
- * # Arguments
2546
- * * `img` - A PhotonImage.
2547
- *
2548
- * # Example
2549
- *
2550
- * ```no_run
2551
- * // For example, to flip an image horizontally:
2552
- * use photon_rs::native::open_image;
2553
- * use photon_rs::transform::fliph;
2554
- *
2555
- * let mut img = open_image("img.jpg").expect("File should open");
2556
- * fliph(&mut img);
2557
- * ```
2558
- * @param {PhotonImage} photon_image
2559
- */
2560
- module.exports.fliph = function(photon_image) {
2561
- _assertClass(photon_image, PhotonImage);
2562
- wasm.fliph(photon_image.__wbg_ptr);
2563
- };
2564
- /**
2565
- * Flip an image vertically.
2566
- *
2567
- * # Arguments
2568
- * * `img` - A PhotonImage.
2569
- *
2570
- * # Example
2571
- *
2572
- * ```no_run
2573
- * // For example, to flip an image vertically:
2574
- * use photon_rs::native::open_image;
2575
- * use photon_rs::transform::flipv;
2576
- *
2577
- * let mut img = open_image("img.jpg").expect("File should open");
2578
- * flipv(&mut img);
2579
- * ```
2580
- * @param {PhotonImage} photon_image
2581
- */
2582
- module.exports.flipv = function(photon_image) {
2583
- _assertClass(photon_image, PhotonImage);
2584
- wasm.flipv(photon_image.__wbg_ptr);
2585
- };
2586
- /**
2587
- * Resize an image on the web.
2588
- *
2589
- * # Arguments
2590
- * * `img` - A PhotonImage.
2591
- * * `width` - New width.
2592
- * * `height` - New height.
2593
- * * `sampling_filter` - Nearest = 1, Triangle = 2, CatmullRom = 3, Gaussian = 4, Lanczos3 = 5
2594
- * @param {PhotonImage} photon_img
2595
- * @param {number} width
2596
- * @param {number} height
2597
- * @param {SamplingFilter} sampling_filter
2598
- * @returns {HTMLCanvasElement}
2599
- */
2600
- module.exports.resize_img_browser = function(photon_img, width, height, sampling_filter) {
2601
- _assertClass(photon_img, PhotonImage);
2602
- return wasm.resize_img_browser(photon_img.__wbg_ptr, width, height, sampling_filter);
2603
- };
2604
- /**
2605
- * Resize an image.
2606
- *
2607
- * # Arguments
2608
- * * `img` - A PhotonImage.
2609
- * * `width` - New width.
2610
- * * `height` - New height.
2611
- * * `sampling_filter` - Nearest = 1, Triangle = 2, CatmullRom = 3, Gaussian = 4, Lanczos3 = 5
2612
- * @param {PhotonImage} photon_img
2613
- * @param {number} width
2614
- * @param {number} height
2615
- * @param {SamplingFilter} sampling_filter
2616
- * @returns {PhotonImage}
2617
- */
2618
- module.exports.resize = function(photon_img, width, height, sampling_filter) {
2619
- _assertClass(photon_img, PhotonImage);
2620
- const ret = wasm.resize(photon_img.__wbg_ptr, width, height, sampling_filter);
2621
- return PhotonImage.__wrap(ret);
2622
- };
2623
- /**
2624
- * Resize image using seam carver.
2625
- * Resize only if new dimensions are smaller, than original image.
2626
- * # NOTE: This is still experimental feature, and pretty slow.
2627
- *
2628
- * # Arguments
2629
- * * `img` - A PhotonImage.
2630
- * * `width` - New width.
2631
- * * `height` - New height.
2632
- *
2633
- * # Example
2634
- *
2635
- * ```no_run
2636
- * // For example, resize image using seam carver:
2637
- * use photon_rs::native::open_image;
2638
- * use photon_rs::transform::seam_carve;
2639
- * use photon_rs::PhotonImage;
2640
- *
2641
- * let img = open_image("img.jpg").expect("File should open");
2642
- * let result: PhotonImage = seam_carve(&img, 100_u32, 100_u32);
2643
- * ```
2644
- * @param {PhotonImage} img
2645
- * @param {number} width
2646
- * @param {number} height
2647
- * @returns {PhotonImage}
2648
- */
2649
- module.exports.seam_carve = function(img, width, height) {
2650
- _assertClass(img, PhotonImage);
2651
- const ret = wasm.seam_carve(img.__wbg_ptr, width, height);
2652
- return PhotonImage.__wrap(ret);
2653
- };
2654
- /**
2655
- * Shear the image along the X axis.
2656
- * A sheared PhotonImage is returned.
2657
- *
2658
- * # Arguments
2659
- * * `img` - A PhotonImage. See the PhotonImage struct for details.
2660
- * * `shear` - Amount to shear.
2661
- *
2662
- * # Example
2663
- *
2664
- * ```no_run
2665
- * // For example, to shear an image by 0.5:
2666
- * use photon_rs::native::open_image;
2667
- * use photon_rs::transform::shearx;
2668
- *
2669
- * let img = open_image("img.jpg").expect("File should open");
2670
- * let sheared_img = shearx(&img, 0.5);
2671
- * ```
2672
- * @param {PhotonImage} photon_img
2673
- * @param {number} shear
2674
- * @returns {PhotonImage}
2675
- */
2676
- module.exports.shearx = function(photon_img, shear) {
2677
- _assertClass(photon_img, PhotonImage);
2678
- const ret = wasm.shearx(photon_img.__wbg_ptr, shear);
2679
- return PhotonImage.__wrap(ret);
2680
- };
2681
- /**
2682
- * Shear the image along the Y axis.
2683
- * A sheared PhotonImage is returned.
2684
- *
2685
- * # Arguments
2686
- * * `img` - A PhotonImage. See the PhotonImage struct for details.
2687
- * * `shear` - Amount to shear.
2688
- *
2689
- * # Example
2690
- *
2691
- * ```no_run
2692
- * // For example, to shear an image by 0.5:
2693
- * use photon_rs::native::open_image;
2694
- * use photon_rs::transform::sheary;
2695
- *
2696
- * let img = open_image("img.jpg").expect("File should open");
2697
- * let sheared_img = sheary(&img, 0.5);
2698
- * ```
2699
- * @param {PhotonImage} photon_img
2700
- * @param {number} shear
2701
- * @returns {PhotonImage}
2702
- */
2703
- module.exports.sheary = function(photon_img, shear) {
2704
- _assertClass(photon_img, PhotonImage);
2705
- const ret = wasm.sheary(photon_img.__wbg_ptr, shear);
2706
- return PhotonImage.__wrap(ret);
2707
- };
2708
- /**
2709
- * Apply uniform padding around the PhotonImage
2710
- * A padded PhotonImage is returned.
2711
- * # Arguments
2712
- * * `img` - A PhotonImage. See the PhotonImage struct for details.
2713
- * * `padding` - The amount of padding to be applied to the PhotonImage.
2714
- * * `padding_rgba` - Tuple containing the RGBA code for padding color.
2715
- *
2716
- * # Example
2717
- *
2718
- * ```no_run
2719
- * // For example, to apply a padding of 10 pixels around a PhotonImage:
2720
- * use photon_rs::transform::padding_uniform;
2721
- * use photon_rs::native::open_image;
2722
- * use photon_rs::Rgba;
2723
- *
2724
- * let mut img = open_image("img.jpg").expect("File should open");
2725
- * let rgba = Rgba::new(200_u8, 100_u8, 150_u8, 255_u8);
2726
- * padding_uniform(&img, 10_u32, rgba);
2727
- * ```
2728
- * @param {PhotonImage} img
2729
- * @param {number} padding
2730
- * @param {Rgba} padding_rgba
2731
- * @returns {PhotonImage}
2732
- */
2733
- module.exports.padding_uniform = function(img, padding, padding_rgba) {
2734
- _assertClass(img, PhotonImage);
2735
- _assertClass(padding_rgba, Rgba);
2736
- var ptr0 = padding_rgba.__destroy_into_raw();
2737
- const ret = wasm.padding_uniform(img.__wbg_ptr, padding, ptr0);
2738
- return PhotonImage.__wrap(ret);
2739
- };
2740
- /**
2741
- * Apply padding on the left side of the PhotonImage
2742
- * A padded PhotonImage is returned.
2743
- * # Arguments
2744
- * * `img` - A PhotonImage. See the PhotonImage struct for details.
2745
- * * `padding` - The amount of padding to be applied to the PhotonImage.
2746
- * * `padding_rgba` - Tuple containing the RGBA code for padding color.
2747
- *
2748
- * # Example
2749
- *
2750
- * ```no_run
2751
- * // For example, to apply a padding of 10 pixels on the left side of a PhotonImage:
2752
- * use photon_rs::transform::padding_left;
2753
- * use photon_rs::native::open_image;
2754
- * use photon_rs::Rgba;
2755
- *
2756
- * let mut img = open_image("img.jpg").expect("File should open");
2757
- * let rgba = Rgba::new(200_u8, 100_u8, 150_u8, 255_u8);
2758
- * padding_left(&img, 10_u32, rgba);
2759
- * ```
2760
- * @param {PhotonImage} img
2761
- * @param {number} padding
2762
- * @param {Rgba} padding_rgba
2763
- * @returns {PhotonImage}
2764
- */
2765
- module.exports.padding_left = function(img, padding, padding_rgba) {
2766
- _assertClass(img, PhotonImage);
2767
- _assertClass(padding_rgba, Rgba);
2768
- var ptr0 = padding_rgba.__destroy_into_raw();
2769
- const ret = wasm.padding_left(img.__wbg_ptr, padding, ptr0);
2770
- return PhotonImage.__wrap(ret);
2771
- };
2772
- /**
2773
- * Apply padding on the left side of the PhotonImage
2774
- * A padded PhotonImage is returned.
2775
- * # Arguments
2776
- * * `img` - A PhotonImage. See the PhotonImage struct for details.
2777
- * * `padding` - The amount of padding to be applied to the PhotonImage.
2778
- * * `padding_rgba` - Tuple containing the RGBA code for padding color.
2779
- *
2780
- * # Example
2781
- *
2782
- * ```no_run
2783
- * // For example, to apply a padding of 10 pixels on the right side of a PhotonImage:
2784
- * use photon_rs::transform::padding_right;
2785
- * use photon_rs::native::open_image;
2786
- * use photon_rs::Rgba;
2787
- *
2788
- * let mut img = open_image("img.jpg").expect("File should open");
2789
- * let rgba = Rgba::new(200_u8, 100_u8, 150_u8, 255_u8);
2790
- * padding_right(&img, 10_u32, rgba);
2791
- * ```
2792
- * @param {PhotonImage} img
2793
- * @param {number} padding
2794
- * @param {Rgba} padding_rgba
2795
- * @returns {PhotonImage}
2796
- */
2797
- module.exports.padding_right = function(img, padding, padding_rgba) {
2798
- _assertClass(img, PhotonImage);
2799
- _assertClass(padding_rgba, Rgba);
2800
- var ptr0 = padding_rgba.__destroy_into_raw();
2801
- const ret = wasm.padding_right(img.__wbg_ptr, padding, ptr0);
2802
- return PhotonImage.__wrap(ret);
2803
- };
2804
- /**
2805
- * Apply padding on the left side of the PhotonImage
2806
- * A padded PhotonImage is returned.
2807
- * # Arguments
2808
- * * `img` - A PhotonImage. See the PhotonImage struct for details.
2809
- * * `padding` - The amount of padding to be applied to the PhotonImage.
2810
- * * `padding_rgba` - Tuple containing the RGBA code for padding color.
2811
- *
2812
- * # Example
2813
- *
2814
- * ```no_run
2815
- * // For example, to apply a padding of 10 pixels on the top of a PhotonImage:
2816
- * use photon_rs::transform::padding_top;
2817
- * use photon_rs::native::open_image;
2818
- * use photon_rs::Rgba;
2819
- *
2820
- * let mut img = open_image("img.jpg").expect("File should open");
2821
- * let rgba = Rgba::new(200_u8, 100_u8, 150_u8, 255_u8);
2822
- * padding_top(&img, 10_u32, rgba);
2823
- * ```
2824
- * @param {PhotonImage} img
2825
- * @param {number} padding
2826
- * @param {Rgba} padding_rgba
2827
- * @returns {PhotonImage}
2828
- */
2829
- module.exports.padding_top = function(img, padding, padding_rgba) {
2830
- _assertClass(img, PhotonImage);
2831
- _assertClass(padding_rgba, Rgba);
2832
- var ptr0 = padding_rgba.__destroy_into_raw();
2833
- const ret = wasm.padding_top(img.__wbg_ptr, padding, ptr0);
2834
- return PhotonImage.__wrap(ret);
2835
- };
2836
- /**
2837
- * Apply padding on the left side of the PhotonImage
2838
- * A padded PhotonImage is returned.
2839
- * # Arguments
2840
- * * `img` - A PhotonImage. See the PhotonImage struct for details.
2841
- * * `padding` - The amount of padding to be applied to the PhotonImage.
2842
- * * `padding_rgba` - Tuple containing the RGBA code for padding color.
2843
- *
2844
- * # Example
2845
- *
2846
- * ```no_run
2847
- * // For example, to apply a padding of 10 pixels on the bottom of a PhotonImage:
2848
- * use photon_rs::transform::padding_bottom;
2849
- * use photon_rs::native::open_image;
2850
- * use photon_rs::Rgba;
2851
- *
2852
- * let mut img = open_image("img.jpg").expect("File should open");
2853
- * let rgba = Rgba::new(200_u8, 100_u8, 150_u8, 255_u8);
2854
- * padding_bottom(&img, 10_u32, rgba);
2855
- * ```
2856
- * @param {PhotonImage} img
2857
- * @param {number} padding
2858
- * @param {Rgba} padding_rgba
2859
- * @returns {PhotonImage}
2860
- */
2861
- module.exports.padding_bottom = function(img, padding, padding_rgba) {
2862
- _assertClass(img, PhotonImage);
2863
- _assertClass(padding_rgba, Rgba);
2864
- var ptr0 = padding_rgba.__destroy_into_raw();
2865
- const ret = wasm.padding_bottom(img.__wbg_ptr, padding, ptr0);
2866
- return PhotonImage.__wrap(ret);
2867
- };
2868
- /**
2869
- * Rotate the PhotonImage on an arbitrary angle
2870
- * A rotated PhotonImage is returned.
2871
- *
2872
- * # Arguments
2873
- * * `img` - A PhotonImage. See the PhotonImage struct for details.
2874
- * * `angle` - Rotation angle in degrees.
2875
- *
2876
- * # Example
2877
- *
2878
- * ```no_run
2879
- * // For example, to rotate a PhotonImage by 30 degrees:
2880
- * use photon_rs::native::open_image;
2881
- * use photon_rs::transform::rotate;
2882
- *
2883
- * let img = open_image("img.jpg").expect("File should open");
2884
- * let rotated_img = rotate(&img, 30.0);
2885
- * ```
2886
- * @param {PhotonImage} photon_img
2887
- * @param {number} angle
2888
- * @returns {PhotonImage}
2889
- */
2890
- module.exports.rotate = function(photon_img, angle) {
2891
- _assertClass(photon_img, PhotonImage);
2892
- const ret = wasm.rotate(photon_img.__wbg_ptr, angle);
2893
- return PhotonImage.__wrap(ret);
2894
- };
2895
- /**
2896
- * Resample the PhotonImage.
2897
- *
2898
- * # Arguments
2899
- * * `img` - A PhotonImage. See the PhotonImage struct for details.
2900
- * * `dst_width` - Target width.
2901
- * * `dst_height` - Target height.
2902
- *
2903
- * # Example
2904
- *
2905
- * ```no_run
2906
- * // For example, to resample a PhotonImage to 1920x1080 size:
2907
- * use photon_rs::native::open_image;
2908
- * use photon_rs::transform::resample;
2909
- *
2910
- * let img = open_image("img.jpg").expect("File should open");
2911
- * let rotated_img = resample(&img, 1920, 1080);
2912
- * ```
2913
- * @param {PhotonImage} img
2914
- * @param {number} dst_width
2915
- * @param {number} dst_height
2916
- * @returns {PhotonImage}
2917
- */
2918
- module.exports.resample = function(img, dst_width, dst_height) {
2919
- _assertClass(img, PhotonImage);
2920
- const ret = wasm.resample(img.__wbg_ptr, dst_width, dst_height);
2921
- return PhotonImage.__wrap(ret);
2922
- };
2923
- /**
2924
- * Adds an offset to the image by a certain number of pixels.
2925
- *
2926
- * This creates an RGB shift effect.
2927
- *
2928
- * # Arguments
2929
- * * `img` - A PhotonImage that contains a view into the image.
2930
- * * `channel_index`: The index of the channel to increment. 0 for red, 1 for green and 2 for blue.
2931
- * * `offset` - The offset is added to the pixels in the image.
2932
- * # Example
2933
- *
2934
- * ```no_run
2935
- * // For example, to offset pixels by 30 pixels on the red channel:
2936
- * use photon_rs::effects::offset;
2937
- * use photon_rs::native::open_image;
2938
- *
2939
- * let mut img = open_image("img.jpg").expect("File should open");
2940
- * offset(&mut img, 0_usize, 30_u32);
2941
- * ```
2942
- * @param {PhotonImage} photon_image
2943
- * @param {number} channel_index
2944
- * @param {number} offset
2945
- */
2946
- module.exports.offset = function(photon_image, channel_index, offset) {
2947
- _assertClass(photon_image, PhotonImage);
2948
- wasm.offset(photon_image.__wbg_ptr, channel_index, offset);
2949
- };
2950
- /**
2951
- * Adds an offset to the red channel by a certain number of pixels.
2952
- *
2953
- * # Arguments
2954
- * * `img` - A PhotonImage that contains a view into the image.
2955
- * * `offset` - The offset you want to move the red channel by.
2956
- * # Example
2957
- *
2958
- * ```no_run
2959
- * // For example, to add an offset to the red channel by 30 pixels.
2960
- * use photon_rs::effects::offset_red;
2961
- * use photon_rs::native::open_image;
2962
- *
2963
- * let mut img = open_image("img.jpg").expect("File should open");
2964
- * offset_red(&mut img, 30_u32);
2965
- * ```
2966
- * @param {PhotonImage} img
2967
- * @param {number} offset_amt
2968
- */
2969
- module.exports.offset_red = function(img, offset_amt) {
2970
- _assertClass(img, PhotonImage);
2971
- wasm.offset_red(img.__wbg_ptr, offset_amt);
2972
- };
2973
- /**
2974
- * Adds an offset to the green channel by a certain number of pixels.
2975
- *
2976
- * # Arguments
2977
- * * `img` - A PhotonImage that contains a view into the image.
2978
- * * `offset` - The offset you want to move the green channel by.
2979
- * # Example
2980
- *
2981
- * ```no_run
2982
- * // For example, to add an offset to the green channel by 30 pixels.
2983
- * use photon_rs::effects::offset_green;
2984
- * use photon_rs::native::open_image;
2985
- *
2986
- * let mut img = open_image("img.jpg").expect("File should open");
2987
- * offset_green(&mut img, 30_u32);
2988
- * ```
2989
- * @param {PhotonImage} img
2990
- * @param {number} offset_amt
2991
- */
2992
- module.exports.offset_green = function(img, offset_amt) {
2993
- _assertClass(img, PhotonImage);
2994
- wasm.offset_green(img.__wbg_ptr, offset_amt);
2995
- };
2996
- /**
2997
- * Adds an offset to the blue channel by a certain number of pixels.
2998
- *
2999
- * # Arguments
3000
- * * `img` - A PhotonImage that contains a view into the image.
3001
- * * `offset_amt` - The offset you want to move the blue channel by.
3002
- * # Example
3003
- * // For example, to add an offset to the green channel by 40 pixels.
3004
- *
3005
- * ```no_run
3006
- * use photon_rs::effects::offset_blue;
3007
- * use photon_rs::native::open_image;
3008
- *
3009
- * let mut img = open_image("img.jpg").expect("File should open");
3010
- * offset_blue(&mut img, 40_u32);
3011
- * ```
3012
- * @param {PhotonImage} img
3013
- * @param {number} offset_amt
3014
- */
3015
- module.exports.offset_blue = function(img, offset_amt) {
3016
- _assertClass(img, PhotonImage);
3017
- wasm.offset_blue(img.__wbg_ptr, offset_amt);
3018
- };
3019
- /**
3020
- * Adds multiple offsets to the image by a certain number of pixels (on two channels).
3021
- *
3022
- * # Arguments
3023
- * * `img` - A PhotonImage that contains a view into the image.
3024
- * * `offset` - The offset is added to the pixels in the image.
3025
- * # Example
3026
- *
3027
- * ```no_run
3028
- * // For example, to add a 30-pixel offset to both the red and blue channels:
3029
- * use photon_rs::effects::multiple_offsets;
3030
- * use photon_rs::native::open_image;
3031
- *
3032
- * let mut img = open_image("img.jpg").expect("File should open");
3033
- * multiple_offsets(&mut img, 30_u32, 0_usize, 2_usize);
3034
- * ```
3035
- * @param {PhotonImage} photon_image
3036
- * @param {number} offset
3037
- * @param {number} channel_index
3038
- * @param {number} channel_index2
3039
- */
3040
- module.exports.multiple_offsets = function(photon_image, offset, channel_index, channel_index2) {
3041
- _assertClass(photon_image, PhotonImage);
3042
- wasm.multiple_offsets(photon_image.__wbg_ptr, offset, channel_index, channel_index2);
3043
- };
3044
- /**
3045
- * Halftoning effect.
3046
- *
3047
- * # Arguments
3048
- * * `img` - A PhotonImage that contains a view into the image.
3049
- * # Example
3050
- *
3051
- * ```no_run
3052
- * // For example:
3053
- * use photon_rs::effects::halftone;
3054
- * use photon_rs::native::open_image;
3055
- *
3056
- * let mut img = open_image("img.jpg").expect("File should open");
3057
- * halftone(&mut img);
3058
- * ```
3059
- * @param {PhotonImage} photon_image
3060
- */
3061
- module.exports.halftone = function(photon_image) {
3062
- _assertClass(photon_image, PhotonImage);
3063
- wasm.halftone(photon_image.__wbg_ptr);
3064
- };
3065
- /**
3066
- * Reduces an image to the primary colours.
3067
- *
3068
- * # Arguments
3069
- * * `img` - A PhotonImage that contains a view into the image.
3070
- * # Example
3071
- *
3072
- * ```no_run
3073
- * // For example, to add a primary colour effect to an image of type `DynamicImage`:
3074
- * use photon_rs::effects::primary;
3075
- * use photon_rs::native::open_image;
3076
- *
3077
- * let mut img = open_image("img.jpg").expect("File should open");
3078
- * primary(&mut img);
3079
- * ```
3080
- * @param {PhotonImage} img
3081
- */
3082
- module.exports.primary = function(img) {
3083
- _assertClass(img, PhotonImage);
3084
- wasm.primary(img.__wbg_ptr);
3085
- };
3086
- /**
3087
- * Colorizes the green channels of the image.
3088
- *
3089
- * # Arguments
3090
- * * `img` - A PhotonImage that contains a view into the image.
3091
- * # Example
3092
- *
3093
- * ```no_run
3094
- * // For example, to colorize an image of type `PhotonImage`:
3095
- * use photon_rs::effects::colorize;
3096
- * use photon_rs::native::open_image;
3097
- *
3098
- * let mut img = open_image("img.jpg").expect("File should open");
3099
- * colorize(&mut img);
3100
- * ```
3101
- * @param {PhotonImage} photon_image
3102
- */
3103
- module.exports.colorize = function(photon_image) {
3104
- _assertClass(photon_image, PhotonImage);
3105
- wasm.colorize(photon_image.__wbg_ptr);
3106
- };
3107
- /**
3108
- * Applies a solarizing effect to an image.
3109
- *
3110
- * # Arguments
3111
- * * `img` - A PhotonImage that contains a view into the image.
3112
- * # Example
3113
- *
3114
- * ```no_run
3115
- * // For example, to colorize an image of type `PhotonImage`:
3116
- * use photon_rs::effects::solarize;
3117
- * use photon_rs::native::open_image;
3118
- *
3119
- * let mut img = open_image("img.jpg").expect("File should open");
3120
- * solarize(&mut img);
3121
- * ```
3122
- * @param {PhotonImage} photon_image
3123
- */
3124
- module.exports.solarize = function(photon_image) {
3125
- _assertClass(photon_image, PhotonImage);
3126
- wasm.solarize(photon_image.__wbg_ptr);
3127
- };
3128
- /**
3129
- * Applies a solarizing effect to an image and returns the resulting PhotonImage.
3130
- *
3131
- * # Arguments
3132
- * * `img` - A PhotonImage that contains a view into the image.
3133
- * # Example
3134
- *
3135
- * ```no_run
3136
- * // For example, to solarize "retimg" an image of type `PhotonImage`:
3137
- * use photon_rs::effects::solarize_retimg;
3138
- * use photon_rs::native::open_image;
3139
- * use photon_rs::PhotonImage;
3140
- *
3141
- * let img = open_image("img.jpg").expect("File should open");
3142
- * let result: PhotonImage = solarize_retimg(&img);
3143
- * ```
3144
- * @param {PhotonImage} photon_image
3145
- * @returns {PhotonImage}
3146
- */
3147
- module.exports.solarize_retimg = function(photon_image) {
3148
- _assertClass(photon_image, PhotonImage);
3149
- const ret = wasm.solarize_retimg(photon_image.__wbg_ptr);
3150
- return PhotonImage.__wrap(ret);
3151
- };
3152
- /**
3153
- * Adjust the brightness of an image by a factor.
3154
- *
3155
- * # Arguments
3156
- * * `img` - A PhotonImage that contains a view into the image.
3157
- * * `brightness` - A u8 to add or subtract to the brightness. To increase
3158
- * the brightness, pass a positive number (up to 255). To decrease the brightness,
3159
- * pass a negative number instead.
3160
- * # Example
3161
- *
3162
- * ```no_run
3163
- * use photon_rs::effects::adjust_brightness;
3164
- * use photon_rs::native::open_image;
3165
- *
3166
- * let mut img = open_image("img.jpg").expect("File should open");
3167
- * adjust_brightness(&mut img, 10_i16);
3168
- * ```
3169
- * @param {PhotonImage} photon_image
3170
- * @param {number} brightness
3171
- */
3172
- module.exports.adjust_brightness = function(photon_image, brightness) {
3173
- _assertClass(photon_image, PhotonImage);
3174
- wasm.adjust_brightness(photon_image.__wbg_ptr, brightness);
3175
- };
3176
- /**
3177
- * Increase the brightness of an image by a constant.
3178
- *
3179
- * # Arguments
3180
- * * `img` - A PhotonImage that contains a view into the image.
3181
- * * `brightness` - A u8 to add to the brightness.
3182
- * # Example
3183
- *
3184
- * ```no_run
3185
- * use photon_rs::effects::inc_brightness;
3186
- * use photon_rs::native::open_image;
3187
- *
3188
- * let mut img = open_image("img.jpg").expect("File should open");
3189
- * inc_brightness(&mut img, 10_u8);
3190
- * ```
3191
- * @param {PhotonImage} photon_image
3192
- * @param {number} brightness
3193
- */
3194
- module.exports.inc_brightness = function(photon_image, brightness) {
3195
- _assertClass(photon_image, PhotonImage);
3196
- wasm.inc_brightness(photon_image.__wbg_ptr, brightness);
3197
- };
3198
- /**
3199
- * Decrease the brightness of an image by a constant.
3200
- *
3201
- * # Arguments
3202
- * * `img` - A PhotonImage that contains a view into the image.
3203
- * * `brightness` - A u8 to subtract from the brightness. It should be a positive number,
3204
- * and this value will then be subtracted from the brightness.
3205
- * # Example
3206
- *
3207
- * ```no_run
3208
- * use photon_rs::effects::dec_brightness;
3209
- * use photon_rs::native::open_image;
3210
- *
3211
- * let mut img = open_image("img.jpg").expect("File should open");
3212
- * dec_brightness(&mut img, 10_u8);
3213
- * ```
3214
- * @param {PhotonImage} photon_image
3215
- * @param {number} brightness
3216
- */
3217
- module.exports.dec_brightness = function(photon_image, brightness) {
3218
- _assertClass(photon_image, PhotonImage);
3219
- wasm.dec_brightness(photon_image.__wbg_ptr, brightness);
3220
- };
3221
- /**
3222
- * Adjust the contrast of an image by a factor.
3223
- *
3224
- * # Arguments
3225
- * * `photon_image` - A PhotonImage that contains a view into the image.
3226
- * * `contrast` - An f32 factor used to adjust contrast. Between [-255.0, 255.0]. The algorithm will
3227
- * clamp results if passed factor is out of range.
3228
- * # Example
3229
- *
3230
- * ```no_run
3231
- * use photon_rs::effects::adjust_contrast;
3232
- * use photon_rs::native::open_image;
3233
- *
3234
- * let mut img = open_image("img.jpg").expect("File should open");
3235
- * adjust_contrast(&mut img, 30_f32);
3236
- * ```
3237
- * @param {PhotonImage} photon_image
3238
- * @param {number} contrast
3239
- */
3240
- module.exports.adjust_contrast = function(photon_image, contrast) {
3241
- _assertClass(photon_image, PhotonImage);
3242
- wasm.adjust_contrast(photon_image.__wbg_ptr, contrast);
3243
- };
3244
- /**
3245
- * Tint an image by adding an offset to averaged RGB channel values.
3246
- *
3247
- * # Arguments
3248
- * * `img` - A PhotonImage that contains a view into the image.
3249
- * * `r_offset` - The amount the R channel should be incremented by.
3250
- * * `g_offset` - The amount the G channel should be incremented by.
3251
- * * `b_offset` - The amount the B channel should be incremented by.
3252
- * # Example
3253
- *
3254
- * ```no_run
3255
- * // For example, to tint an image of type `PhotonImage`:
3256
- * use photon_rs::effects::tint;
3257
- * use photon_rs::native::open_image;
3258
- *
3259
- * let mut img = open_image("img.jpg").expect("File should open");
3260
- * tint(&mut img, 10_u32, 20_u32, 15_u32);
3261
- * ```
3262
- * @param {PhotonImage} photon_image
3263
- * @param {number} r_offset
3264
- * @param {number} g_offset
3265
- * @param {number} b_offset
3266
- */
3267
- module.exports.tint = function(photon_image, r_offset, g_offset, b_offset) {
3268
- _assertClass(photon_image, PhotonImage);
3269
- wasm.tint(photon_image.__wbg_ptr, r_offset, g_offset, b_offset);
3270
- };
3271
- /**
3272
- * Horizontal strips. Divide an image into a series of equal-height strips, for an artistic effect.
3273
- *
3274
- * # Arguments
3275
- * * `img` - A PhotonImage that contains a view into the image.
3276
- * * `num_strips` - The number of strips
3277
- * # Example
3278
- *
3279
- * ```no_run
3280
- * // For example, to draw horizontal strips on a `PhotonImage`:
3281
- * use photon_rs::effects::horizontal_strips;
3282
- * use photon_rs::native::open_image;
3283
- *
3284
- * let mut img = open_image("img.jpg").expect("File should open");
3285
- * horizontal_strips(&mut img, 8u8);
3286
- * ```
3287
- * @param {PhotonImage} photon_image
3288
- * @param {number} num_strips
3289
- */
3290
- module.exports.horizontal_strips = function(photon_image, num_strips) {
3291
- _assertClass(photon_image, PhotonImage);
3292
- wasm.horizontal_strips(photon_image.__wbg_ptr, num_strips);
3293
- };
3294
- /**
3295
- * Horizontal strips. Divide an image into a series of equal-width strips, for an artistic effect. Sepcify a color as well.
3296
- *
3297
- * # Arguments
3298
- * * `img` - A PhotonImage that contains a view into the image.
3299
- * * `num_strips` - The numbder of strips
3300
- * * `color` - Color of strips.
3301
- * # Example
3302
- *
3303
- * ```no_run
3304
- * // For example, to draw blue horizontal strips on a `PhotonImage`:
3305
- * use photon_rs::effects::color_horizontal_strips;
3306
- * use photon_rs::native::open_image;
3307
- * use photon_rs::Rgb;
3308
- *
3309
- * let color = Rgb::new(255u8, 0u8, 0u8);
3310
- * let mut img = open_image("img.jpg").expect("File should open");
3311
- * color_horizontal_strips(&mut img, 8u8, color);
3312
- * ```
3313
- * @param {PhotonImage} photon_image
3314
- * @param {number} num_strips
3315
- * @param {Rgb} color
3316
- */
3317
- module.exports.color_horizontal_strips = function(photon_image, num_strips, color) {
3318
- _assertClass(photon_image, PhotonImage);
3319
- _assertClass(color, Rgb);
3320
- var ptr0 = color.__destroy_into_raw();
3321
- wasm.color_horizontal_strips(photon_image.__wbg_ptr, num_strips, ptr0);
3322
- };
3323
- /**
3324
- * Vertical strips. Divide an image into a series of equal-width strips, for an artistic effect.
3325
- *
3326
- * # Arguments
3327
- * * `img` - A PhotonImage that contains a view into the image.
3328
- * * `num_strips` - The numbder of strips
3329
- * # Example
3330
- *
3331
- * ```no_run
3332
- * // For example, to draw vertical strips on a `PhotonImage`:
3333
- * use photon_rs::effects::vertical_strips;
3334
- * use photon_rs::native::open_image;
3335
- *
3336
- * let mut img = open_image("img.jpg").expect("File should open");
3337
- * vertical_strips(&mut img, 8u8);
3338
- * ```
3339
- * @param {PhotonImage} photon_image
3340
- * @param {number} num_strips
3341
- */
3342
- module.exports.vertical_strips = function(photon_image, num_strips) {
3343
- _assertClass(photon_image, PhotonImage);
3344
- wasm.vertical_strips(photon_image.__wbg_ptr, num_strips);
3345
- };
3346
- /**
3347
- * Vertical strips. Divide an image into a series of equal-width strips, for an artistic effect. Sepcify a color as well.
3348
- *
3349
- * # Arguments
3350
- * * `img` - A PhotonImage that contains a view into the image.
3351
- * * `num_strips` - The numbder of strips
3352
- * * `color` - Color of strips.
3353
- * # Example
3354
- *
3355
- * ```no_run
3356
- * // For example, to draw red vertical strips on a `PhotonImage`:
3357
- * use photon_rs::effects::color_vertical_strips;
3358
- * use photon_rs::native::open_image;
3359
- * use photon_rs::Rgb;
3360
- *
3361
- * let color = Rgb::new(255u8, 0u8, 0u8);
3362
- * let mut img = open_image("img.jpg").expect("File should open");
3363
- * color_vertical_strips(&mut img, 8u8, color);
3364
- * ```
3365
- * @param {PhotonImage} photon_image
3366
- * @param {number} num_strips
3367
- * @param {Rgb} color
3368
- */
3369
- module.exports.color_vertical_strips = function(photon_image, num_strips, color) {
3370
- _assertClass(photon_image, PhotonImage);
3371
- _assertClass(color, Rgb);
3372
- var ptr0 = color.__destroy_into_raw();
3373
- wasm.color_vertical_strips(photon_image.__wbg_ptr, num_strips, ptr0);
3374
- };
3375
- /**
3376
- * Turn an image into an oil painting
3377
- *
3378
- * # Arguments
3379
- * * `img` - A PhotonImage that contains a view into the image.
3380
- * * `radius` - Radius of each paint particle
3381
- * * `intesnity` - How artsy an Image should be
3382
- * # Example
3383
- *
3384
- * ```no_run
3385
- * // For example, to oil an image of type `PhotonImage`:
3386
- * use photon_rs::effects::oil;
3387
- * use photon_rs::native::open_image;
3388
- *
3389
- * let mut img = open_image("img.jpg").expect("File should open");
3390
- * oil(&mut img, 4i32, 55.0);
3391
- * ```
3392
- * @param {PhotonImage} photon_image
3393
- * @param {number} radius
3394
- * @param {number} intensity
3395
- */
3396
- module.exports.oil = function(photon_image, radius, intensity) {
3397
- _assertClass(photon_image, PhotonImage);
3398
- wasm.oil(photon_image.__wbg_ptr, radius, intensity);
3399
- };
3400
- /**
3401
- * Turn an image into an frosted glass see through
3402
- *
3403
- * # Arguments
3404
- * * `img` - A PhotonImage that contains a view into the image.
3405
- * # Example
3406
- *
3407
- * ```no_run
3408
- * // For example, to turn an image of type `PhotonImage` into frosted glass see through:
3409
- * use photon_rs::effects::frosted_glass;
3410
- * use photon_rs::native::open_image;
3411
- *
3412
- * let mut img = open_image("img.jpg").expect("File should open");
3413
- * frosted_glass(&mut img);
3414
- * ```
3415
- * @param {PhotonImage} photon_image
3416
- */
3417
- module.exports.frosted_glass = function(photon_image) {
3418
- _assertClass(photon_image, PhotonImage);
3419
- wasm.frosted_glass(photon_image.__wbg_ptr);
3420
- };
3421
- /**
3422
- * Pixelize an image.
3423
- *
3424
- * # Arguments
3425
- * * `photon_image` - A PhotonImage that contains a view into the image.
3426
- * * `pixel_size` - Targeted pixel size of generated image.
3427
- * # Example
3428
- *
3429
- * ```no_run
3430
- * // For example, to turn an image of type `PhotonImage` into a pixelized image with 50 pixels blocks:
3431
- * use photon_rs::effects::pixelize;
3432
- * use photon_rs::native::open_image;
3433
- *
3434
- * let mut img = open_image("img.jpg").expect("File should open");
3435
- * pixelize(&mut img, 50);
3436
- * ```
3437
- * @param {PhotonImage} photon_image
3438
- * @param {number} pixel_size
3439
- */
3440
- module.exports.pixelize = function(photon_image, pixel_size) {
3441
- _assertClass(photon_image, PhotonImage);
3442
- wasm.pixelize(photon_image.__wbg_ptr, pixel_size);
3443
- };
3444
- /**
3445
- * Normalizes an image by remapping its range of pixels values. Only RGB
3446
- * channels are processed and each channel is stretched to \[0, 255\] range
3447
- * independently. This process is also known as contrast stretching.
3448
- * # Arguments
3449
- * * `photon_image` - A PhotonImage that contains a view into the image.
3450
- * # Example
3451
- *
3452
- * ```no_run
3453
- * // For example, to turn an image of type `PhotonImage` into a normalized image:
3454
- * use photon_rs::effects::normalize;
3455
- * use photon_rs::native::open_image;
3456
- *
3457
- * let mut img = open_image("img.jpg").expect("File should open");
3458
- * normalize(&mut img);
3459
- * ```
3460
- * @param {PhotonImage} photon_image
3461
- */
3462
- module.exports.normalize = function(photon_image) {
3463
- _assertClass(photon_image, PhotonImage);
3464
- wasm.normalize(photon_image.__wbg_ptr);
3465
- };
3466
- /**
3467
- * Applies Floyd-Steinberg dithering to an image.
3468
- * Only RGB channels are processed, alpha remains unchanged.
3469
- * # Arguments
3470
- * * `photon_image` - A PhotonImage that contains a view into the image.
3471
- * * `depth` - bits per channel. Clamped between 1 and 8.
3472
- * # Example
3473
- *
3474
- * ```no_run
3475
- * // For example, to turn an image of type `PhotonImage` into a dithered image:
3476
- * use photon_rs::effects::dither;
3477
- * use photon_rs::native::open_image;
3478
- *
3479
- * let mut img = open_image("img.jpg").expect("File should open");
3480
- * let depth = 1;
3481
- * dither(&mut img, depth);
3482
- * ```
3483
- * @param {PhotonImage} photon_image
3484
- * @param {number} depth
3485
- */
3486
- module.exports.dither = function(photon_image, depth) {
3487
- _assertClass(photon_image, PhotonImage);
3488
- wasm.dither(photon_image.__wbg_ptr, depth);
3489
- };
3490
- /**
3491
- * @param {PhotonImage} photon_image
3492
- * @param {Rgb} color_a
3493
- * @param {Rgb} color_b
3494
- */
3495
- module.exports.duotone = function(photon_image, color_a, color_b) {
3496
- _assertClass(photon_image, PhotonImage);
3497
- _assertClass(color_a, Rgb);
3498
- var ptr0 = color_a.__destroy_into_raw();
3499
- _assertClass(color_b, Rgb);
3500
- var ptr1 = color_b.__destroy_into_raw();
3501
- wasm.duotone(photon_image.__wbg_ptr, ptr0, ptr1);
3502
- };
3503
- /**
3504
- * Add bordered-text to an image.
3505
- * The only font available as of now is Roboto.
3506
- * Note: A graphic design/text-drawing library is currently being developed, so stay tuned.
3507
- *
3508
- * # Arguments
3509
- * * `photon_image` - A PhotonImage.
3510
- * * `text` - Text string to be drawn to the image.
3511
- * * `x` - x-coordinate of where first letter's 1st pixel should be drawn.
3512
- * * `y` - y-coordinate of where first letter's 1st pixel should be drawn.
3513
- * * `font_size` - Font size in pixels of the text to be drawn.
3514
- *
3515
- * # Example
3516
- *
3517
- * ```no_run
3518
- * // For example to draw the string "Welcome to Photon!" at 10, 10:
3519
- * use photon_rs::native::open_image;
3520
- * use photon_rs::text::draw_text_with_border;
3521
- *
3522
- * // Open the image. A PhotonImage is returned.
3523
- * let mut img = open_image("img.jpg").expect("File should open");
3524
- * draw_text_with_border(&mut img, "Welcome to Photon!", 10_i32, 10_i32, 90_f32);
3525
- * ```
3526
- * @param {PhotonImage} photon_img
3527
- * @param {string} text
3528
- * @param {number} x
3529
- * @param {number} y
3530
- * @param {number} font_size
3531
- */
3532
- module.exports.draw_text_with_border = function(photon_img, text, x, y, font_size) {
3533
- _assertClass(photon_img, PhotonImage);
3534
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3535
- const len0 = WASM_VECTOR_LEN;
3536
- wasm.draw_text_with_border(photon_img.__wbg_ptr, ptr0, len0, x, y, font_size);
3537
- };
3538
- /**
3539
- * Add text to an image.
3540
- * The only font available as of now is Roboto.
3541
- * Note: A graphic design/text-drawing library is currently being developed, so stay tuned.
3542
- *
3543
- * # Arguments
3544
- * * `photon_image` - A PhotonImage.
3545
- * * `text` - Text string to be drawn to the image.
3546
- * * `x` - x-coordinate of where first letter's 1st pixel should be drawn.
3547
- * * `y` - y-coordinate of where first letter's 1st pixel should be drawn.
3548
- * * `font_size` - Font size in pixels of the text to be drawn.
3549
- *
3550
- * # Example
3551
- *
3552
- * ```no_run
3553
- * // For example to draw the string "Welcome to Photon!" at 10, 10:
3554
- * use photon_rs::native::open_image;
3555
- * use photon_rs::text::draw_text;
3556
- *
3557
- * // Open the image. A PhotonImage is returned.
3558
- * let mut img = open_image("img.jpg").expect("File should open");
3559
- * draw_text(&mut img, "Welcome to Photon!", 10_i32, 10_i32, 90_f32);
3560
- * ```
3561
- * @param {PhotonImage} photon_img
3562
- * @param {string} text
3563
- * @param {number} x
3564
- * @param {number} y
3565
- * @param {number} font_size
3566
- */
3567
- module.exports.draw_text = function(photon_img, text, x, y, font_size) {
3568
- _assertClass(photon_img, PhotonImage);
3569
- const ptr0 = passStringToWasm0(text, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3570
- const len0 = WASM_VECTOR_LEN;
3571
- wasm.draw_text(photon_img.__wbg_ptr, ptr0, len0, x, y, font_size);
3572
- };
3573
- function passArray8ToWasm0(arg, malloc) {
3574
- const ptr = malloc(arg.length * 1, 1) >>> 0;
3575
- getUint8ArrayMemory0().set(arg, ptr / 1);
3576
- WASM_VECTOR_LEN = arg.length;
3577
- return ptr;
3578
- }
3579
- function getArrayU8FromWasm0(ptr, len) {
3580
- ptr = ptr >>> 0;
3581
- return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
3582
- }
3583
- function takeFromExternrefTable0(idx) {
3584
- const value = wasm.__wbindgen_export_2.get(idx);
3585
- wasm.__externref_table_dealloc(idx);
3586
- return value;
3587
- }
3588
- /**
3589
- *! [temp] Check if WASM is supported.
3590
- */
3591
- module.exports.run = function() {
3592
- const ret = wasm.run();
3593
- if (ret[1]) throw takeFromExternrefTable0(ret[0]);
3594
- };
3595
- /**
3596
- * Get the ImageData from a 2D canvas context
3597
- * @param {HTMLCanvasElement} canvas
3598
- * @param {CanvasRenderingContext2D} ctx
3599
- * @returns {ImageData}
3600
- */
3601
- module.exports.get_image_data = function(canvas, ctx) {
3602
- return wasm.get_image_data(canvas, ctx);
3603
- };
3604
- /**
3605
- * Place a PhotonImage onto a 2D canvas.
3606
- * @param {HTMLCanvasElement} canvas
3607
- * @param {CanvasRenderingContext2D} ctx
3608
- * @param {PhotonImage} new_image
3609
- */
3610
- module.exports.putImageData = function(canvas, ctx, new_image) {
3611
- _assertClass(new_image, PhotonImage);
3612
- var ptr0 = new_image.__destroy_into_raw();
3613
- wasm.putImageData(canvas, ctx, ptr0);
3614
- };
3615
- /**
3616
- * Convert a HTML5 Canvas Element to a PhotonImage.
3617
- *
3618
- * This converts the ImageData found in the canvas context to a PhotonImage,
3619
- * which can then have effects or filters applied to it.
3620
- * @param {HTMLCanvasElement} canvas
3621
- * @param {CanvasRenderingContext2D} ctx
3622
- * @returns {PhotonImage}
3623
- */
3624
- module.exports.open_image = function(canvas, ctx) {
3625
- const ret = wasm.open_image(canvas, ctx);
3626
- return PhotonImage.__wrap(ret);
3627
- };
3628
- /**
3629
- * Convert ImageData to a raw pixel vec of u8s.
3630
- * @param {ImageData} imgdata
3631
- * @returns {Uint8Array}
3632
- */
3633
- module.exports.to_raw_pixels = function(imgdata) {
3634
- const ret = wasm.to_raw_pixels(imgdata);
3635
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
3636
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
3637
- return v1;
3638
- };
3639
- /**
3640
- * Convert a base64 string to a PhotonImage.
3641
- * @param {string} base64
3642
- * @returns {PhotonImage}
3643
- */
3644
- module.exports.base64_to_image = function(base64) {
3645
- const ptr0 = passStringToWasm0(base64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3646
- const len0 = WASM_VECTOR_LEN;
3647
- const ret = wasm.base64_to_image(ptr0, len0);
3648
- return PhotonImage.__wrap(ret);
3649
- };
3650
- /**
3651
- * Convert a base64 string to a Vec of u8s.
3652
- * @param {string} base64
3653
- * @returns {Uint8Array}
3654
- */
3655
- module.exports.base64_to_vec = function(base64) {
3656
- const ptr0 = passStringToWasm0(base64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3657
- const len0 = WASM_VECTOR_LEN;
3658
- const ret = wasm.base64_to_vec(ptr0, len0);
3659
- var v2 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
3660
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
3661
- return v2;
3662
- };
3663
- /**
3664
- * Convert a PhotonImage to JS-compatible ImageData.
3665
- * @param {PhotonImage} photon_image
3666
- * @returns {ImageData}
3667
- */
3668
- module.exports.to_image_data = function(photon_image) {
3669
- _assertClass(photon_image, PhotonImage);
3670
- var ptr0 = photon_image.__destroy_into_raw();
3671
- return wasm.to_image_data(ptr0);
3672
- };
3673
- function isLikeNone(x) {
3674
- return x === void 0 || x === null;
3675
- }
3676
- function addToExternrefTable0(obj) {
3677
- const idx = wasm.__externref_table_alloc();
3678
- wasm.__wbindgen_export_2.set(idx, obj);
3679
- return idx;
3680
- }
3681
- function handleError(f, args) {
3682
- try {
3683
- return f.apply(this, args);
3684
- } catch (e) {
3685
- const idx = addToExternrefTable0(e);
3686
- wasm.__wbindgen_exn_store(idx);
3687
- }
3688
- }
3689
- let cachedUint8ClampedArrayMemory0 = null;
3690
- function getUint8ClampedArrayMemory0() {
3691
- if (cachedUint8ClampedArrayMemory0 === null || cachedUint8ClampedArrayMemory0.byteLength === 0) cachedUint8ClampedArrayMemory0 = new Uint8ClampedArray(wasm.memory.buffer);
3692
- return cachedUint8ClampedArrayMemory0;
3693
- }
3694
- function getClampedArrayU8FromWasm0(ptr, len) {
3695
- ptr = ptr >>> 0;
3696
- return getUint8ClampedArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
3697
- }
3698
- module.exports.SamplingFilter = Object.freeze({
3699
- Nearest: 1,
3700
- "1": "Nearest",
3701
- Triangle: 2,
3702
- "2": "Triangle",
3703
- CatmullRom: 3,
3704
- "3": "CatmullRom",
3705
- Gaussian: 4,
3706
- "4": "Gaussian",
3707
- Lanczos3: 5,
3708
- "5": "Lanczos3"
3709
- });
3710
- const PhotonImageFinalization = typeof FinalizationRegistry === "undefined" ? {
3711
- register: () => {},
3712
- unregister: () => {}
3713
- } : new FinalizationRegistry((ptr) => wasm.__wbg_photonimage_free(ptr >>> 0, 1));
3714
- /**
3715
- * Provides the image's height, width, and contains the image's raw pixels.
3716
- * For use when communicating between JS and WASM, and also natively.
3717
- */
3718
- var PhotonImage = class PhotonImage {
3719
- static __wrap(ptr) {
3720
- ptr = ptr >>> 0;
3721
- const obj = Object.create(PhotonImage.prototype);
3722
- obj.__wbg_ptr = ptr;
3723
- PhotonImageFinalization.register(obj, obj.__wbg_ptr, obj);
3724
- return obj;
3725
- }
3726
- __destroy_into_raw() {
3727
- const ptr = this.__wbg_ptr;
3728
- this.__wbg_ptr = 0;
3729
- PhotonImageFinalization.unregister(this);
3730
- return ptr;
3731
- }
3732
- free() {
3733
- const ptr = this.__destroy_into_raw();
3734
- wasm.__wbg_photonimage_free(ptr, 0);
3735
- }
3736
- /**
3737
- * Create a new PhotonImage from a Vec of u8s, which represent raw pixels.
3738
- * @param {Uint8Array} raw_pixels
3739
- * @param {number} width
3740
- * @param {number} height
3741
- */
3742
- constructor(raw_pixels, width, height) {
3743
- const ptr0 = passArray8ToWasm0(raw_pixels, wasm.__wbindgen_malloc);
3744
- const len0 = WASM_VECTOR_LEN;
3745
- const ret = wasm.photonimage_new(ptr0, len0, width, height);
3746
- this.__wbg_ptr = ret >>> 0;
3747
- PhotonImageFinalization.register(this, this.__wbg_ptr, this);
3748
- return this;
3749
- }
3750
- /**
3751
- * Create a new PhotonImage from a base64 string.
3752
- * @param {string} base64
3753
- * @returns {PhotonImage}
3754
- */
3755
- static new_from_base64(base64) {
3756
- const ptr0 = passStringToWasm0(base64, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
3757
- const len0 = WASM_VECTOR_LEN;
3758
- const ret = wasm.base64_to_image(ptr0, len0);
3759
- return PhotonImage.__wrap(ret);
3760
- }
3761
- /**
3762
- * Create a new PhotonImage from a byteslice.
3763
- * @param {Uint8Array} vec
3764
- * @returns {PhotonImage}
3765
- */
3766
- static new_from_byteslice(vec) {
3767
- const ptr0 = passArray8ToWasm0(vec, wasm.__wbindgen_malloc);
3768
- const len0 = WASM_VECTOR_LEN;
3769
- const ret = wasm.photonimage_new_from_byteslice(ptr0, len0);
3770
- return PhotonImage.__wrap(ret);
3771
- }
3772
- /**
3773
- * Create a new PhotonImage from a Blob/File.
3774
- * @param {Blob} blob
3775
- * @returns {PhotonImage}
3776
- */
3777
- static new_from_blob(blob) {
3778
- const ret = wasm.photonimage_new_from_blob(blob);
3779
- return PhotonImage.__wrap(ret);
3780
- }
3781
- /**
3782
- * Create a new PhotonImage from a HTMLImageElement
3783
- * @param {HTMLImageElement} image
3784
- * @returns {PhotonImage}
3785
- */
3786
- static new_from_image(image) {
3787
- const ret = wasm.photonimage_new_from_image(image);
3788
- return PhotonImage.__wrap(ret);
3789
- }
3790
- /**
3791
- * Get the width of the PhotonImage.
3792
- * @returns {number}
3793
- */
3794
- get_width() {
3795
- return wasm.photonimage_get_width(this.__wbg_ptr) >>> 0;
3796
- }
3797
- /**
3798
- * Get the PhotonImage's pixels as a Vec of u8s.
3799
- * @returns {Uint8Array}
3800
- */
3801
- get_raw_pixels() {
3802
- const ret = wasm.photonimage_get_raw_pixels(this.__wbg_ptr);
3803
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
3804
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
3805
- return v1;
3806
- }
3807
- /**
3808
- * Get the height of the PhotonImage.
3809
- * @returns {number}
3810
- */
3811
- get_height() {
3812
- return wasm.photonimage_get_height(this.__wbg_ptr) >>> 0;
3813
- }
3814
- /**
3815
- * Convert the PhotonImage to base64.
3816
- * @returns {string}
3817
- */
3818
- get_base64() {
3819
- let deferred1_0;
3820
- let deferred1_1;
3821
- try {
3822
- const ret = wasm.photonimage_get_base64(this.__wbg_ptr);
3823
- deferred1_0 = ret[0];
3824
- deferred1_1 = ret[1];
3825
- return getStringFromWasm0(ret[0], ret[1]);
3826
- } finally {
3827
- wasm.__wbindgen_free(deferred1_0, deferred1_1, 1);
3828
- }
3829
- }
3830
- /**
3831
- * Convert the PhotonImage to raw bytes. Returns PNG.
3832
- * @returns {Uint8Array}
3833
- */
3834
- get_bytes() {
3835
- const ret = wasm.photonimage_get_bytes(this.__wbg_ptr);
3836
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
3837
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
3838
- return v1;
3839
- }
3840
- /**
3841
- * Convert the PhotonImage to raw bytes. Returns a JPEG.
3842
- * @param {number} quality
3843
- * @returns {Uint8Array}
3844
- */
3845
- get_bytes_jpeg(quality) {
3846
- const ret = wasm.photonimage_get_bytes_jpeg(this.__wbg_ptr, quality);
3847
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
3848
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
3849
- return v1;
3850
- }
3851
- /**
3852
- * Convert the PhotonImage to raw bytes. Returns a WEBP.
3853
- * @returns {Uint8Array}
3854
- */
3855
- get_bytes_webp() {
3856
- const ret = wasm.photonimage_get_bytes_webp(this.__wbg_ptr);
3857
- var v1 = getArrayU8FromWasm0(ret[0], ret[1]).slice();
3858
- wasm.__wbindgen_free(ret[0], ret[1] * 1, 1);
3859
- return v1;
3860
- }
3861
- /**
3862
- * Convert the PhotonImage's raw pixels to JS-compatible ImageData.
3863
- * @returns {ImageData}
3864
- */
3865
- get_image_data() {
3866
- return wasm.photonimage_get_image_data(this.__wbg_ptr);
3867
- }
3868
- /**
3869
- * Convert ImageData to raw pixels, and update the PhotonImage's raw pixels to this.
3870
- * @param {ImageData} img_data
3871
- */
3872
- set_imgdata(img_data) {
3873
- wasm.photonimage_set_imgdata(this.__wbg_ptr, img_data);
3874
- }
3875
- /**
3876
- * Calculates estimated filesize and returns number of bytes
3877
- * @returns {bigint}
3878
- */
3879
- get_estimated_filesize() {
3880
- const ret = wasm.photonimage_get_estimated_filesize(this.__wbg_ptr);
3881
- return BigInt.asUintN(64, ret);
3882
- }
3883
- };
3884
- module.exports.PhotonImage = PhotonImage;
3885
- const RgbFinalization = typeof FinalizationRegistry === "undefined" ? {
3886
- register: () => {},
3887
- unregister: () => {}
3888
- } : new FinalizationRegistry((ptr) => wasm.__wbg_rgb_free(ptr >>> 0, 1));
3889
- /**
3890
- * RGB color type.
3891
- */
3892
- var Rgb = class {
3893
- __destroy_into_raw() {
3894
- const ptr = this.__wbg_ptr;
3895
- this.__wbg_ptr = 0;
3896
- RgbFinalization.unregister(this);
3897
- return ptr;
3898
- }
3899
- free() {
3900
- const ptr = this.__destroy_into_raw();
3901
- wasm.__wbg_rgb_free(ptr, 0);
3902
- }
3903
- /**
3904
- * Create a new RGB struct.
3905
- * @param {number} r
3906
- * @param {number} g
3907
- * @param {number} b
3908
- */
3909
- constructor(r, g, b) {
3910
- const ret = wasm.rgb_new(r, g, b);
3911
- this.__wbg_ptr = ret >>> 0;
3912
- RgbFinalization.register(this, this.__wbg_ptr, this);
3913
- return this;
3914
- }
3915
- /**
3916
- * Set the Red value.
3917
- * @param {number} r
3918
- */
3919
- set_red(r) {
3920
- wasm.rgb_set_red(this.__wbg_ptr, r);
3921
- }
3922
- /**
3923
- * Get the Green value.
3924
- * @param {number} g
3925
- */
3926
- set_green(g) {
3927
- wasm.rgb_set_green(this.__wbg_ptr, g);
3928
- }
3929
- /**
3930
- * Set the Blue value.
3931
- * @param {number} b
3932
- */
3933
- set_blue(b) {
3934
- wasm.rgb_set_blue(this.__wbg_ptr, b);
3935
- }
3936
- /**
3937
- * Get the Red value.
3938
- * @returns {number}
3939
- */
3940
- get_red() {
3941
- return wasm.rgb_get_red(this.__wbg_ptr);
3942
- }
3943
- /**
3944
- * Get the Green value.
3945
- * @returns {number}
3946
- */
3947
- get_green() {
3948
- return wasm.rgb_get_green(this.__wbg_ptr);
3949
- }
3950
- /**
3951
- * Get the Blue value.
3952
- * @returns {number}
3953
- */
3954
- get_blue() {
3955
- return wasm.rgb_get_blue(this.__wbg_ptr);
3956
- }
3957
- };
3958
- module.exports.Rgb = Rgb;
3959
- const RgbaFinalization = typeof FinalizationRegistry === "undefined" ? {
3960
- register: () => {},
3961
- unregister: () => {}
3962
- } : new FinalizationRegistry((ptr) => wasm.__wbg_rgba_free(ptr >>> 0, 1));
3963
- /**
3964
- * RGBA color type.
3965
- */
3966
- var Rgba = class {
3967
- __destroy_into_raw() {
3968
- const ptr = this.__wbg_ptr;
3969
- this.__wbg_ptr = 0;
3970
- RgbaFinalization.unregister(this);
3971
- return ptr;
3972
- }
3973
- free() {
3974
- const ptr = this.__destroy_into_raw();
3975
- wasm.__wbg_rgba_free(ptr, 0);
3976
- }
3977
- /**
3978
- * Create a new RGBA struct.
3979
- * @param {number} r
3980
- * @param {number} g
3981
- * @param {number} b
3982
- * @param {number} a
3983
- */
3984
- constructor(r, g, b, a) {
3985
- const ret = wasm.rgba_new(r, g, b, a);
3986
- this.__wbg_ptr = ret >>> 0;
3987
- RgbaFinalization.register(this, this.__wbg_ptr, this);
3988
- return this;
3989
- }
3990
- /**
3991
- * Set the Red value.
3992
- * @param {number} r
3993
- */
3994
- set_red(r) {
3995
- wasm.rgb_set_red(this.__wbg_ptr, r);
3996
- }
3997
- /**
3998
- * Get the Green value.
3999
- * @param {number} g
4000
- */
4001
- set_green(g) {
4002
- wasm.rgb_set_green(this.__wbg_ptr, g);
4003
- }
4004
- /**
4005
- * Set the Blue value.
4006
- * @param {number} b
4007
- */
4008
- set_blue(b) {
4009
- wasm.rgb_set_blue(this.__wbg_ptr, b);
4010
- }
4011
- /**
4012
- * Set the alpha value.
4013
- * @param {number} a
4014
- */
4015
- set_alpha(a) {
4016
- wasm.rgba_set_alpha(this.__wbg_ptr, a);
4017
- }
4018
- /**
4019
- * Get the Red value.
4020
- * @returns {number}
4021
- */
4022
- get_red() {
4023
- return wasm.rgb_get_red(this.__wbg_ptr);
4024
- }
4025
- /**
4026
- * Get the Green value.
4027
- * @returns {number}
4028
- */
4029
- get_green() {
4030
- return wasm.rgb_get_green(this.__wbg_ptr);
4031
- }
4032
- /**
4033
- * Get the Blue value.
4034
- * @returns {number}
4035
- */
4036
- get_blue() {
4037
- return wasm.rgb_get_blue(this.__wbg_ptr);
4038
- }
4039
- /**
4040
- * Get the alpha value for this color.
4041
- * @returns {number}
4042
- */
4043
- get_alpha() {
4044
- return wasm.rgba_get_alpha(this.__wbg_ptr);
4045
- }
4046
- };
4047
- module.exports.Rgba = Rgba;
4048
- module.exports.__wbg_new_abda76e883ba8a5f = function() {
4049
- return /* @__PURE__ */ new Error();
4050
- };
4051
- module.exports.__wbg_stack_658279fe44541cf6 = function(arg0, arg1) {
4052
- const ret = arg1.stack;
4053
- const ptr1 = passStringToWasm0(ret, wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4054
- const len1 = WASM_VECTOR_LEN;
4055
- getDataViewMemory0().setInt32(arg0 + 4, len1, true);
4056
- getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
4057
- };
4058
- module.exports.__wbg_error_f851667af71bcfc6 = function(arg0, arg1) {
4059
- let deferred0_0;
4060
- let deferred0_1;
4061
- try {
4062
- deferred0_0 = arg0;
4063
- deferred0_1 = arg1;
4064
- console.error(getStringFromWasm0(arg0, arg1));
4065
- } finally {
4066
- wasm.__wbindgen_free(deferred0_0, deferred0_1, 1);
4067
- }
4068
- };
4069
- module.exports.__wbg_instanceof_Window_c4b70662a0d2c5ec = function(arg0) {
4070
- let result;
4071
- try {
4072
- result = arg0 instanceof Window;
4073
- } catch (_) {
4074
- result = false;
4075
- }
4076
- return result;
4077
- };
4078
- module.exports.__wbg_document_e5c1786dea6542e4 = function(arg0) {
4079
- const ret = arg0.document;
4080
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
4081
- };
4082
- module.exports.__wbg_body_e70ae6abd01ae584 = function(arg0) {
4083
- const ret = arg0.body;
4084
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
4085
- };
4086
- module.exports.__wbg_createElement_5d4c76f218b78145 = function() {
4087
- return handleError(function(arg0, arg1, arg2) {
4088
- return arg0.createElement(getStringFromWasm0(arg1, arg2));
4089
- }, arguments);
4090
- };
4091
- module.exports.__wbg_width_4c6f0048d64cf86b = function(arg0) {
4092
- return arg0.width;
4093
- };
4094
- module.exports.__wbg_height_21f0d3fd8f753394 = function(arg0) {
4095
- return arg0.height;
4096
- };
4097
- module.exports.__wbg_width_79e0847ed5883b03 = function(arg0) {
4098
- return arg0.width;
4099
- };
4100
- module.exports.__wbg_height_e4e4e4779f8feac0 = function(arg0) {
4101
- return arg0.height;
4102
- };
4103
- module.exports.__wbg_data_fda507064d127f5b = function(arg0, arg1) {
4104
- const ret = arg1.data;
4105
- const ptr1 = passArray8ToWasm0(ret, wasm.__wbindgen_malloc);
4106
- const len1 = WASM_VECTOR_LEN;
4107
- getDataViewMemory0().setInt32(arg0 + 4, len1, true);
4108
- getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
4109
- };
4110
- module.exports.__wbg_newwithu8clampedarrayandsh_1fddccb3a94a5e05 = function() {
4111
- return handleError(function(arg0, arg1, arg2, arg3) {
4112
- return new ImageData(getClampedArrayU8FromWasm0(arg0, arg1), arg2 >>> 0, arg3 >>> 0);
4113
- }, arguments);
4114
- };
4115
- module.exports.__wbg_instanceof_CanvasRenderingContext2d_3abbe7ec7af32cae = function(arg0) {
4116
- let result;
4117
- try {
4118
- result = arg0 instanceof CanvasRenderingContext2D;
4119
- } catch (_) {
4120
- result = false;
4121
- }
4122
- return result;
4123
- };
4124
- module.exports.__wbg_drawImage_fede06db74e39a60 = function() {
4125
- return handleError(function(arg0, arg1, arg2, arg3) {
4126
- arg0.drawImage(arg1, arg2, arg3);
4127
- }, arguments);
4128
- };
4129
- module.exports.__wbg_drawImage_f395c8e43c79a909 = function() {
4130
- return handleError(function(arg0, arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9) {
4131
- arg0.drawImage(arg1, arg2, arg3, arg4, arg5, arg6, arg7, arg8, arg9);
4132
- }, arguments);
4133
- };
4134
- module.exports.__wbg_getImageData_5e1c242046e6b59e = function() {
4135
- return handleError(function(arg0, arg1, arg2, arg3, arg4) {
4136
- return arg0.getImageData(arg1, arg2, arg3, arg4);
4137
- }, arguments);
4138
- };
4139
- module.exports.__wbg_putImageData_a8b3e177ee06d521 = function() {
4140
- return handleError(function(arg0, arg1, arg2, arg3) {
4141
- arg0.putImageData(arg1, arg2, arg3);
4142
- }, arguments);
4143
- };
4144
- module.exports.__wbg_instanceof_HtmlCanvasElement_25d964a0dde6717e = function(arg0) {
4145
- let result;
4146
- try {
4147
- result = arg0 instanceof HTMLCanvasElement;
4148
- } catch (_) {
4149
- result = false;
4150
- }
4151
- return result;
4152
- };
4153
- module.exports.__wbg_width_dc225e55343b745e = function(arg0) {
4154
- return arg0.width;
4155
- };
4156
- module.exports.__wbg_setwidth_488780db69b08846 = function(arg0, arg1) {
4157
- arg0.width = arg1 >>> 0;
4158
- };
4159
- module.exports.__wbg_height_3a8bec2f3fe71b26 = function(arg0) {
4160
- return arg0.height;
4161
- };
4162
- module.exports.__wbg_setheight_1761808c18403921 = function(arg0, arg1) {
4163
- arg0.height = arg1 >>> 0;
4164
- };
4165
- module.exports.__wbg_getContext_fc99dbd3a9a7e318 = function() {
4166
- return handleError(function(arg0, arg1, arg2) {
4167
- const ret = arg0.getContext(getStringFromWasm0(arg1, arg2));
4168
- return isLikeNone(ret) ? 0 : addToExternrefTable0(ret);
4169
- }, arguments);
4170
- };
4171
- module.exports.__wbg_settextContent_f82a86a8df347e1c = function(arg0, arg1, arg2) {
4172
- arg0.textContent = arg1 === 0 ? void 0 : getStringFromWasm0(arg1, arg2);
4173
- };
4174
- module.exports.__wbg_appendChild_fa3b00dade9fc4cf = function() {
4175
- return handleError(function(arg0, arg1) {
4176
- return arg0.appendChild(arg1);
4177
- }, arguments);
4178
- };
4179
- module.exports.__wbg_newnoargs_e643855c6572a4a8 = function(arg0, arg1) {
4180
- return new Function(getStringFromWasm0(arg0, arg1));
4181
- };
4182
- module.exports.__wbg_call_f96b398515635514 = function() {
4183
- return handleError(function(arg0, arg1) {
4184
- return arg0.call(arg1);
4185
- }, arguments);
4186
- };
4187
- module.exports.__wbg_self_b9aad7f1c618bfaf = function() {
4188
- return handleError(function() {
4189
- return self.self;
4190
- }, arguments);
4191
- };
4192
- module.exports.__wbg_window_55e469842c98b086 = function() {
4193
- return handleError(function() {
4194
- return window.window;
4195
- }, arguments);
4196
- };
4197
- module.exports.__wbg_globalThis_d0957e302752547e = function() {
4198
- return handleError(function() {
4199
- return globalThis.globalThis;
4200
- }, arguments);
4201
- };
4202
- module.exports.__wbg_global_ae2f87312b8987fb = function() {
4203
- return handleError(function() {
4204
- return global.global;
4205
- }, arguments);
4206
- };
4207
- module.exports.__wbindgen_is_undefined = function(arg0) {
4208
- return arg0 === void 0;
4209
- };
4210
- module.exports.__wbg_buffer_fcbfb6d88b2732e9 = function(arg0) {
4211
- return arg0.buffer;
4212
- };
4213
- module.exports.__wbg_new_bc5d9aad3f9ac80e = function(arg0) {
4214
- return new Uint8Array(arg0);
4215
- };
4216
- module.exports.__wbg_set_4b3aa8445ac1e91c = function(arg0, arg1, arg2) {
4217
- arg0.set(arg1, arg2 >>> 0);
4218
- };
4219
- module.exports.__wbg_length_d9c4ded7e708c6a1 = function(arg0) {
4220
- return arg0.length;
4221
- };
4222
- module.exports.__wbindgen_debug_string = function(arg0, arg1) {
4223
- const ptr1 = passStringToWasm0(debugString(arg1), wasm.__wbindgen_malloc, wasm.__wbindgen_realloc);
4224
- const len1 = WASM_VECTOR_LEN;
4225
- getDataViewMemory0().setInt32(arg0 + 4, len1, true);
4226
- getDataViewMemory0().setInt32(arg0 + 0, ptr1, true);
4227
- };
4228
- module.exports.__wbindgen_throw = function(arg0, arg1) {
4229
- throw new Error(getStringFromWasm0(arg0, arg1));
4230
- };
4231
- module.exports.__wbindgen_memory = function() {
4232
- return wasm.memory;
4233
- };
4234
- module.exports.__wbindgen_init_externref_table = function() {
4235
- const table = wasm.__wbindgen_export_2;
4236
- const offset = table.grow(4);
4237
- table.set(0, void 0);
4238
- table.set(offset + 0, void 0);
4239
- table.set(offset + 1, null);
4240
- table.set(offset + 2, true);
4241
- table.set(offset + 3, false);
4242
- };
4243
- const path = __require("path").join(__dirname, "photon_rs_bg.wasm");
4244
- const bytes = __require("fs").readFileSync(path);
4245
- const wasmModule = new WebAssembly.Module(bytes);
4246
- wasm = new WebAssembly.Instance(wasmModule, imports).exports;
4247
- module.exports.__wasm = wasm;
4248
- wasm.__wbindgen_start();
4249
- }));
4250
- //#endregion
4251
- export default require_photon_rs();
4252
- export {};