Image.js 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114
  1. function Image() {
  2. }
  3. Image.prototype.loadImage = function(fileName) {
  4. Polycode.Image_loadImage(this.__ptr, fileName)
  5. }
  6. Image.prototype.saveImage = function(fileName) {
  7. Polycode.Image_saveImage(this.__ptr, fileName)
  8. }
  9. Image.prototype.pasteImage = function(image,x,y,blendingMode,blendAmount,blendColor) {
  10. Polycode.Image_pasteImage(this.__ptr, image,x,y,blendingMode,blendAmount,blendColor)
  11. }
  12. Image.prototype.createEmpty = function(width,height,fillColor) {
  13. Polycode.Image_createEmpty(this.__ptr, width,height,fillColor)
  14. }
  15. Image.prototype.fill = function(color) {
  16. Polycode.Image_fill(this.__ptr, color)
  17. }
  18. Image.prototype.setPixel = function(x,y,r,g,b,a) {
  19. Polycode.Image_setPixel(this.__ptr, x,y,r,g,b,a)
  20. }
  21. Image.prototype.getPixel = function(x,y) {
  22. Polycode.Image_getPixel(this.__ptr, x,y)
  23. }
  24. Image.prototype.swap = function(v1,v2) {
  25. Polycode.Image_swap(this.__ptr, v1,v2)
  26. }
  27. Image.prototype.drawLine = function(x0,y0,x1,y1,col) {
  28. Polycode.Image_drawLine(this.__ptr, x0,y0,x1,y1,col)
  29. }
  30. Image.prototype.moveBrushTo = function(x,y) {
  31. Polycode.Image_moveBrushTo(this.__ptr, x,y)
  32. }
  33. Image.prototype.moveBrush = function(x,y) {
  34. Polycode.Image_moveBrush(this.__ptr, x,y)
  35. }
  36. Image.prototype.drawLineTo = function(x,y,col) {
  37. Polycode.Image_drawLineTo(this.__ptr, x,y,col)
  38. }
  39. Image.prototype.fillRect = function(x,y,w,h,col) {
  40. Polycode.Image_fillRect(this.__ptr, x,y,w,h,col)
  41. }
  42. Image.prototype.perlinNoise = function(seed,alpha) {
  43. Polycode.Image_perlinNoise(this.__ptr, seed,alpha)
  44. }
  45. Image.prototype.fastBlur = function(blurSize) {
  46. Polycode.Image_fastBlur(this.__ptr, blurSize)
  47. }
  48. Image.prototype.fastBlurVert = function(blurSize) {
  49. Polycode.Image_fastBlurVert(this.__ptr, blurSize)
  50. }
  51. Image.prototype.fastBlurHor = function(blurSize) {
  52. Polycode.Image_fastBlurHor(this.__ptr, blurSize)
  53. }
  54. Image.prototype.getPixelsInRect = function(x,y,width,height) {
  55. Polycode.Image_getPixelsInRect(this.__ptr, x,y,width,height)
  56. }
  57. Image.prototype.getImagePart = function(subRect) {
  58. Polycode.Image_getImagePart(this.__ptr, subRect)
  59. }
  60. Image.prototype.getBrushX = function() {
  61. Polycode.Image_getBrushX(this.__ptr)
  62. }
  63. Image.prototype.getBrushY = function() {
  64. Polycode.Image_getBrushY(this.__ptr)
  65. }
  66. Image.prototype.isLoaded = function() {
  67. Polycode.Image_isLoaded(this.__ptr)
  68. }
  69. Image.prototype.getType = function() {
  70. Polycode.Image_getType(this.__ptr)
  71. }
  72. Image.prototype.getWidth = function() {
  73. Polycode.Image_getWidth(this.__ptr)
  74. }
  75. Image.prototype.getHeight = function() {
  76. Polycode.Image_getHeight(this.__ptr)
  77. }
  78. Image.prototype.getPixels = function() {
  79. Polycode.Image_getPixels(this.__ptr)
  80. }
  81. Image.prototype.premultiplyAlpha = function() {
  82. Polycode.Image_premultiplyAlpha(this.__ptr)
  83. }
  84. Image.prototype.savePNG = function(fileName) {
  85. Polycode.Image_savePNG(this.__ptr, fileName)
  86. }