@jimp/plugin-rotate
Advanced tools
Comparing version 0.6.4 to 0.6.5-canary.784.118.0
@@ -12,19 +12,2 @@ "use strict"; | ||
function rotate90degrees(bitmap, dstBuffer, clockwise) { | ||
var dstOffsetStep = clockwise ? -4 : 4; | ||
var dstOffset = clockwise ? dstBuffer.length - 4 : 0; | ||
var tmp; | ||
var x; | ||
var y; | ||
var srcOffset; | ||
for (x = 0; x < bitmap.width; x++) { | ||
for (y = bitmap.height - 1; y >= 0; y--) { | ||
srcOffset = bitmap.width * y + x << 2; | ||
tmp = bitmap.data.readUInt32BE(srcOffset, true); | ||
dstBuffer.writeUInt32BE(tmp, dstOffset, true); | ||
dstOffset += dstOffsetStep; | ||
} | ||
} | ||
} | ||
/** | ||
@@ -35,4 +18,2 @@ * Rotates an image clockwise by an arbitrary number of degrees. NB: 'this' must be a Jimp object. | ||
*/ | ||
function advancedRotate(deg, mode) { | ||
@@ -39,0 +20,0 @@ deg %= 360; |
import { throwError, isNodePattern } from '@jimp/utils'; | ||
function rotate90degrees(bitmap, dstBuffer, clockwise) { | ||
var dstOffsetStep = clockwise ? -4 : 4; | ||
var dstOffset = clockwise ? dstBuffer.length - 4 : 0; | ||
var tmp; | ||
var x; | ||
var y; | ||
var srcOffset; | ||
for (x = 0; x < bitmap.width; x++) { | ||
for (y = bitmap.height - 1; y >= 0; y--) { | ||
srcOffset = bitmap.width * y + x << 2; | ||
tmp = bitmap.data.readUInt32BE(srcOffset, true); | ||
dstBuffer.writeUInt32BE(tmp, dstOffset, true); | ||
dstOffset += dstOffsetStep; | ||
} | ||
} | ||
} | ||
/** | ||
@@ -26,3 +8,2 @@ * Rotates an image clockwise by an arbitrary number of degrees. NB: 'this' must be a Jimp object. | ||
function advancedRotate(deg, mode) { | ||
@@ -29,0 +10,0 @@ deg %= 360; |
{ | ||
"name": "@jimp/plugin-rotate", | ||
"version": "0.6.4", | ||
"version": "0.6.5-canary.784.118.0", | ||
"description": "Rotate an image.", | ||
@@ -22,3 +22,3 @@ "main": "dist/index.js", | ||
"dependencies": { | ||
"@jimp/utils": "^0.6.4", | ||
"@jimp/utils": "0.6.5-canary.784.118.0", | ||
"core-js": "^2.5.7" | ||
@@ -33,7 +33,7 @@ }, | ||
"devDependencies": { | ||
"@jimp/custom": "^0.6.4", | ||
"@jimp/plugin-blit": "^0.6.4", | ||
"@jimp/plugin-crop": "^0.6.4", | ||
"@jimp/plugin-resize": "^0.6.4", | ||
"@jimp/test-utils": "^0.6.4" | ||
"@jimp/custom": "0.6.5-canary.784.118.0", | ||
"@jimp/plugin-blit": "0.6.5-canary.784.118.0", | ||
"@jimp/plugin-crop": "0.6.5-canary.784.118.0", | ||
"@jimp/plugin-resize": "0.6.5-canary.784.118.0", | ||
"@jimp/test-utils": "0.6.5-canary.784.118.0" | ||
}, | ||
@@ -43,3 +43,3 @@ "publishConfig": { | ||
}, | ||
"gitHead": "7c9d3c817cade88d4a20422be10670d3c1528429" | ||
"gitHead": "20a24e11c6ef9b5ff9ed731f9a2d356fb8142518" | ||
} |
import { throwError, isNodePattern } from '@jimp/utils'; | ||
function rotate90degrees(bitmap, dstBuffer, clockwise) { | ||
const dstOffsetStep = clockwise ? -4 : 4; | ||
let dstOffset = clockwise ? dstBuffer.length - 4 : 0; | ||
let tmp; | ||
let x; | ||
let y; | ||
let srcOffset; | ||
for (x = 0; x < bitmap.width; x++) { | ||
for (y = bitmap.height - 1; y >= 0; y--) { | ||
srcOffset = (bitmap.width * y + x) << 2; | ||
tmp = bitmap.data.readUInt32BE(srcOffset, true); | ||
dstBuffer.writeUInt32BE(tmp, dstOffset, true); | ||
dstOffset += dstOffsetStep; | ||
} | ||
} | ||
} | ||
/** | ||
@@ -23,0 +4,0 @@ * Rotates an image clockwise by an arbitrary number of degrees. NB: 'this' must be a Jimp object. |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52206
952
+ Added@jimp/utils@0.6.5-canary.784.118.0(transitive)
- Removed@jimp/utils@0.6.8(transitive)