1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120
|
/*-----------------------------------------------------------------
LOG
GEM - Graphics Environment for Multimedia
Snap a pix of the render buffer
Copyright (c) 2005 tigital. tigital@mac.com
Copyright (c) 1997-1999 Mark Danks. mark@danks.org
Copyright (c) Günther Geiger. geiger@epy.co.at
Copyright (c) 2001-2011 IOhannes m zmölnig. forum::für::umläute. IEM. zmoelnig@iem.at
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
-----------------------------------------------------------------*/
#ifndef _INCLUDE__GEM_PIXES_PIX_VPAINT_H_
#define _INCLUDE__GEM_PIXES_PIX_VPAINT_H_
#include "Base/GemPixObj.h"
#include "Gem/Image.h"
#include "Gem/PBuffer.h"
/*-----------------------------------------------------------------
-------------------------------------------------------------------
CLASS
pix_vpaint
Creates voronoi regions based on pixel color
KEYWORDS
pix
DESCRIPTION
Inlet for a list - "vert_size"
-----------------------------------------------------------------*/
class GEM_EXTERN pix_vpaint : public GemPixObj
{
CPPEXTERN_HEADER(pix_vpaint, GemPixObj);
public:
//////////
// Constructor
pix_vpaint();
protected:
//////////
// Destructor
virtual ~pix_vpaint();
// extension check
bool isRunnable(void);
//////////
// Do the processing
virtual void processImage(imageStruct &image);
//////////
// When a size message is received
virtual void sizeMess(int width, int height);
//////////
//
void makepoints();
void makecone();
void init();
int m_initialized;
int maxPoints, numPoints, viewImage, useStrokes, drawEdges, moving, canDrawEdges;
int mouseX, mouseY, lastX, lastY, sampleMenu, strokeMenu;
/*
* Point structure
*/
typedef struct {
int x, y;
unsigned char r, g, b;
} cPoint;
cPoint *points;
//////////
// The imageStruct with the current image
imageStruct m_imageStruct;
//////////
// PBuffer
PBuffer *m_pbuffer;
//////////
// The x position
int m_x;
//////////
// The y position
int m_y;
//////////
// The width
int m_w;
//////////
// The height
int m_h;
//////////
// recalc the random points
bool m_banged;
private:
t_inlet *m_sizinlet;
//////////
// static member functions
static void bangMessCallback(void *data);
static void sizeMessCallback(void *data, t_floatarg width, t_floatarg height );
};
#endif // for header file
|