Hussein Jafferjee
85aff9e5e4
improve comment on why the offset is there
9 years ago
Hussein Jafferjee
f8368996b8
Change to 1.4 to match chrome
9 years ago
Hussein Jafferjee
4f722ffa53
forgot to destroy context and surface
9 years ago
Hussein Jafferjee
4e9269cc34
implement blur on images (drawImage)
9 years ago
Zach Bjornson
9ad6c41f2b
jpegStream: bugfix, tests, simplification with LinusU. Fix #629
Remove the undocumented 3rd argument of the emitters (bytes left in buffer).
Add a column to the browser tests that displays JPEGs.
Revise how buffers are allocated.
9 years ago
Zach Bjornson
d4d3b9c724
Update to NAN 2 and node 3+ APIs
10 years ago
Linus Unnebäck
858d79bb4c
test: fix up some small issues
10 years ago
Zach Bjornson
7d9286638f
Support node <0.12 using kExternalPixelArray.
10 years ago
Zach Bjornson
43c94e43bf
Pixels with a=0 should have 0 for RGB; pixels with a=255 should have rgb for RGB.
10 years ago
Zach Bjornson
11f0709ec6
Fix tests "putImageData() 8" and "putImageData() 9".
Negative arguments were causing source image data to be painted wrapped-around the other side of the canvas.
10 years ago
Zach Bjornson
76580a8199
Optimize Context2d::PutImageData. Benchmarked 53% faster.
Benchmark:
var canvas = new Canvas(300, 600);
var ctx = canvas.getContext("2d");
// any manipulation of canvas/ctx here.
var data = ctx.getImageData(0,0,300,600);
// time 1000x:
ctx.putImageData(data, 0, 0);
10 years ago
Zach Bjornson
b4a05d7892
Replace CanvasPixelArray with Uint8ClampedArray to meet spec.
Added some argument testing/manipulation to match WebKit/Moz behaviors.
Additionally benchmarked:
* branching on `if (a == 0 || a == 255)`, as it is
* not branching (always doing the alpha calculation)
* Mozilla's implementation found here: https://dxr.mozilla.org/mozilla-central/source/dom/canvas/CanvasRenderingContext2D.cpp#5083
Mozilla's is insignificantly faster (p=0.17) :) so left it as-is.
10 years ago
Linus Unnebäck
86d6ec59b7
src: fix include paths for cairo
10 years ago
Nathan Rajlich
3d9f2ac16f
Revert "Remove unused variables"
This reverts commit 004758c725
.
10 years ago
Nathan Rajlich
73d202af40
Revert "Remove unused variables"
This reverts commit 2381e916a9
.
10 years ago
Кузнецов Дмитрий
004758c725
Remove unused variables
FT_Face _ftFace; never used an causes extra warnings during "npm install"
10 years ago
Кузнецов Дмитрий
2381e916a9
Remove unused variables
int _width, _height; never used an caused extra warnings during "npm install"
10 years ago
kibao
6edec3b6e4
Fix segmentation fault in Image::loadFromBuffer when buffer is empty
10 years ago
Alexander Parshin
dc8db1695d
Add comment about optimization
10 years ago
Alexander Parshin
6de09834cf
Optimize getImageData()
Mostly for fully transparent pixels
10 years ago
Stephen Remde
a2f9386d90
fixed bug in StreamPNGSync
10 years ago
Josip Janžić
2ed7587379
define correct isnan, isinf functions
10 years ago
Joe Freeman
66a7a895d8
Fix 'drawImage' scaling (the dimensions of the region that gets clipped also needs to be scaled).
10 years ago
Andy Wood
dfc661f28f
Just use cairo_image_surface_create rather than cairo_surface_create_similar_image which was introduced in cairo 1.12.
Unfortunately the cairo distributed with GTK+, used in the Windows build, is only 1.10.
Using the similar_image version offers backends the chance to be more efficient, but the alternative used here is used as a fallback in the cairo code anyway.
10 years ago
zahranisa
66fa59c4a8
io.js compatibility
10 years ago
Andy Wood
8c6984a099
Fix issue with line width not being correct in stroked shadows.
10 years ago
Andy Wood
822d822066
Refactor setSourceRGBA to allow the context to be supplied.
10 years ago
Andy Wood
39766d1fd6
Simple image shadow (no blurring or handling current transforms) based on image's alpha channel.
10 years ago
Andy Wood
2b366c684e
The +1 on the offset seems to match the browser's output better, but I can't work out why it would be needed (unless it's pixel alignment related).
10 years ago
Andy Wood
617aabc6ae
Make the shadow radius more accurately match the browser's, making use of sigma scale as used in SKIA: https://github.com/google/skia/blob/master/src/effects/SkBlurMask.cpp#L26 .
10 years ago
Andy Wood
0dcc70b2b3
Create a new image surface to render blurred shadows to, this means that vector formats like PDF will now render blurs.
10 years ago
Andy Wood
5d9582b81e
Add recommended calls to flush and dirty buffer, as per http://www.cairographics.org/manual/cairo-Image-Surfaces.html#cairo-image-surface-get-data .
10 years ago
Andy Wood
95e342d259
Fix to ensure shadowOffset is unaffected by the current transform.
10 years ago
motiz88
113abfbd90
Code style + attribution.
Also removed parseClipped() and commented out wrapInt (now wrap_int).
10 years ago
motiz88
3951221166
Fixed <number> handling in hsl/hsla color parser.
parseNumber() was erroring out on numbers with long fractional parts.
10 years ago
motiz88
3cc596f34c
hsl/hsla color parsing + rebeccapurple
hsl() and hsla() color values are now supported, with corresponding unit tests.
Also added rebeccapurple (from CSS Color Level 4) to the named color list.
10 years ago
Jake Gordon
36bd6498b5
float rather than int for drawImage arguments
10 years ago
Jake Gordon
7522aca2ea
with_pango to true and use fontconfig to load fonts
10 years ago
Matthieu Dehaussy
372fb699f0
Update Image.cc
fix fopen mode for non-POSIX platform
10 years ago
Thaddee Tyl
79f1d42fb5
Offer SVG output.
11 years ago
svandecappelle
5212a52da7
Glib version test into giflib exists test
Include test of glib version into the have gif lib test
11 years ago
svandecappelle
c383d11412
Giflib 5.1
11 years ago
svandecappelle
86e77b5bcc
Update Image.h
11 years ago
svandecappelle
9fa62ba875
Update Image.cc
11 years ago
svandecappelle
0eefc23ee5
Giflib 5.1
update to compile with giflib >= 5.1
11 years ago
Milan Gardian
13049aced3
Remove unneeded #include <nan.h>
- Already included by "Canvas.h"
11 years ago
Milan Gardian
ba4038b496
Use float constants to prevent double->float conversion warning
11 years ago
King Koopa
9ffde8ebb3
Add algorithm include to CanvasRenderingContext2d.cc for std::min
11 years ago
King Koopa
c18d777f57
Updated NAN to 1.2.0
11 years ago
Vincent Weevers
f42a018a8d
Add shims so Windows Visual C++ can use C99's isnan() and isinf().
11 years ago