pix_convolve.h 2.64 KB
Newer Older
1
2
3
4
5
6
7
8
9
/*-----------------------------------------------------------------
LOG
    GEM - Graphics Environment for Multimedia

    Apply a convolution kernel

    Copyright (c) 1997-1998 Mark Danks. mark@danks.org
    Copyright (c) Gnther Geiger. geiger@epy.co.at
    Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::fr::umlute. IEM. zmoelnig@iem.kug.ac.at
10
    Copyright (c) 2002 James Tittle & Chris Clepper
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
    For information on usage and redistribution, and for a DISCLAIMER OF ALL
    WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.

-----------------------------------------------------------------*/

#ifndef INCLUDE_PIX_CONVOLVE_H_
#define INCLUDE_PIX_CONVOLVE_H_

#include "Base/GemPixObj.h"

/*-----------------------------------------------------------------
-------------------------------------------------------------------
CLASS
    pix_convolve
    
    Apply a convolution kernel

KEYWORDS
    pix
    
DESCRIPTION

    Inlet for a list - "matrix"
    Inlet for a float - "ft1"
    
    "matrix" - The matrix for the convolution kernal
    "ft1" - The range of the matrix
   
-----------------------------------------------------------------*/
class GEM_EXTERN pix_convolve : public GemPixObj
{
    CPPEXTERN_HEADER(pix_convolve, GemPixObj)

    public:

	    //////////
	    // Constructor
    	pix_convolve(t_floatarg row, t_floatarg col);
    	
    protected:
    	
    	//////////
    	// Destructor
    	virtual ~pix_convolve();

cclepper's avatar
cclepper committed
56
        void calculate3x3YUV(imageStruct &image,imageStruct &tempImg);
57
        void calculate3x3YUVAltivec(imageStruct &image,imageStruct &tempImg);
58
	void calculateRGBA3x3(imageStruct &image,imageStruct &tempImg);
59

cclepper's avatar
cclepper committed
60

61
62
63
    	//////////
    	// Do the processing
    	virtual void 	processImage(imageStruct &image);
64
65
66
        
	//////////
	virtual void 	processYUVImage(imageStruct &image);
67
68
69
70
71
72
73
74
75
76
77
    	
    	//////////
    	// Set the matrix range
    	void	    	rangeMess(float range);
    	
    	//////////
    	// Set the matrix
    	void	    	matrixMess(int argc, t_atom *argv);
    	
    	//////////
    	// The matrix
78
    	short int  	*m_imatrix;
79
80
81
    
    	//////////
    	// The range
82
83
84
    	int             m_irange;
	

85
86
87
88
89
90
91
    	//////////
    	// The number of rows
    	int 	    	m_rows;
    	
    	//////////
    	// The number of columns
    	int 	    	m_cols;
cclepper's avatar
cclepper committed
92
93
        
        int 		m_chroma;
94
95
    	
    private:
96
	imageStruct tempImg;
97
98
99
100
101
    
    	//////////
    	// Static member functions
    	static void 	rangeMessCallback(void *data, t_floatarg range);
    	static void 	matrixMessCallback(void *data, t_symbol *, int argc, t_atom *argv);
cclepper's avatar
cclepper committed
102
        static void 	chromaMessCallback(void *data, t_floatarg value);
103
104
105
};

#endif	// for header file