Browse Source

Added Canvas::blur()

v1.x
Tj Holowaychuk 15 years ago
parent
commit
aca81c8f2d
  1. 5
      src/blur.cc
  2. 1
      src/canvas.h

5
src/blur.cc

@ -25,13 +25,12 @@
#include <math.h> #include <math.h>
#include <stdint.h> #include <stdint.h>
#include <cairo.h> #include <cairo.h>
#include "canvas.h"
#define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0]) #define ARRAY_LENGTH(a) (sizeof (a) / sizeof (a)[0])
/* Performs a simple 2D Gaussian blur of radius @radius on surface @surface. */
void void
blur_image_surface (cairo_surface_t *surface, int radius) Canvas::blur(cairo_surface_t *surface, int radius) {
{
cairo_surface_t *tmp; cairo_surface_t *tmp;
int width, height; int width, height;
int src_stride, dst_stride; int src_stride, dst_stride;

1
src/canvas.h

@ -40,6 +40,7 @@ class Canvas: public node::ObjectWrap {
static Handle<Value> SavePNG(const Arguments &args); static Handle<Value> SavePNG(const Arguments &args);
static Handle<Value> StreamPNG(const Arguments &args); static Handle<Value> StreamPNG(const Arguments &args);
inline cairo_surface_t *getSurface(){ return _surface; } inline cairo_surface_t *getSurface(){ return _surface; }
static void blur(cairo_surface_t *surface, int radius);
Canvas(int width, int height); Canvas(int width, int height);
private: private:

Loading…
Cancel
Save