1 line
1.6 KiB
Plaintext
1 line
1.6 KiB
Plaintext
{"version":3,"sources":["../src/index.js"],"names":["isNodePattern","invert","cb","scanQuiet","bitmap","width","height","x","y","idx","data","call"],"mappings":"AAAA,SAASA,aAAT,QAA8B,aAA9B;AAEA;;;;;;AAKA,gBAAe;AAAA,SAAO;AACpBC,IAAAA,MADoB,kBACbC,EADa,EACT;AACT,WAAKC,SAAL,CAAe,CAAf,EAAkB,CAAlB,EAAqB,KAAKC,MAAL,CAAYC,KAAjC,EAAwC,KAAKD,MAAL,CAAYE,MAApD,EAA4D,UAC1DC,CAD0D,EAE1DC,CAF0D,EAG1DC,GAH0D,EAI1D;AACA,aAAKL,MAAL,CAAYM,IAAZ,CAAiBD,GAAjB,IAAwB,MAAM,KAAKL,MAAL,CAAYM,IAAZ,CAAiBD,GAAjB,CAA9B;AACA,aAAKL,MAAL,CAAYM,IAAZ,CAAiBD,GAAG,GAAG,CAAvB,IAA4B,MAAM,KAAKL,MAAL,CAAYM,IAAZ,CAAiBD,GAAG,GAAG,CAAvB,CAAlC;AACA,aAAKL,MAAL,CAAYM,IAAZ,CAAiBD,GAAG,GAAG,CAAvB,IAA4B,MAAM,KAAKL,MAAL,CAAYM,IAAZ,CAAiBD,GAAG,GAAG,CAAvB,CAAlC;AACD,OARD;;AAUA,UAAIT,aAAa,CAACE,EAAD,CAAjB,EAAuB;AACrBA,QAAAA,EAAE,CAACS,IAAH,CAAQ,IAAR,EAAc,IAAd,EAAoB,IAApB;AACD;;AAED,aAAO,IAAP;AACD;AAjBmB,GAAP;AAAA,CAAf","sourcesContent":["import { isNodePattern } from '@jimp/utils';\n\n/**\n * Inverts the image\n * @param {function(Error, Jimp)} cb (optional) a callback for when complete\n * @returns {Jimp} this for chaining of methods\n */\nexport default () => ({\n invert(cb) {\n this.scanQuiet(0, 0, this.bitmap.width, this.bitmap.height, function(\n x,\n y,\n idx\n ) {\n this.bitmap.data[idx] = 255 - this.bitmap.data[idx];\n this.bitmap.data[idx + 1] = 255 - this.bitmap.data[idx + 1];\n this.bitmap.data[idx + 2] = 255 - this.bitmap.data[idx + 2];\n });\n\n if (isNodePattern(cb)) {\n cb.call(this, null, this);\n }\n\n return this;\n }\n});\n"],"file":"index.js"} |