~kamalmostafa/ubuntu/lucid/pdp/fix-504941-ftbfs

« back to all changes in this revision

Viewing changes to puredata/pdp_imagebase.c

  • Committer: Bazaar Package Importer
  • Author(s): Guenter Geiger (Debian/GNU)
  • Date: 2005-03-15 22:21:05 UTC
  • mfrom: (1.1.1 upstream)
  • Revision ID: james.westby@ubuntu.com-20050315222105-1q287rsihmd9j1tb
Tags: 1:0.12.4-2
* fixed the hardcoded depends
* added 3dp library

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/*
2
 
 *   Pure Data Packet image processor base class implementation.
3
 
 *   Copyright (c) by Tom Schouten <pdp@zzz.kotnet.org>
4
 
 *
5
 
 *   This program is free software; you can redistribute it and/or modify
6
 
 *   it under the terms of the GNU General Public License as published by
7
 
 *   the Free Software Foundation; either version 2 of the License, or
8
 
 *   (at your option) any later version.
9
 
 *
10
 
 *   This program is distributed in the hope that it will be useful,
11
 
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of
12
 
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
13
 
 *   GNU General Public License for more details.
14
 
 *
15
 
 *   You should have received a copy of the GNU General Public License
16
 
 *   along with this program; if not, write to the Free Software
17
 
 *   Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
18
 
 *
19
 
 */
20
 
 
21
 
 
22
 
/*
23
 
 
24
 
  This file contains the pdp image base class object.
25
 
*/
26
 
 
27
 
#include "pdp_imagebase.h"
28
 
#include <stdarg.h>
29
 
 
30
 
 
31
 
static void pdp_imagebase_chanmask(t_pdp_base *b, t_floatarg f)
32
 
{
33
 
    int i = (int)f;
34
 
    if (i < 0) i = -1;
35
 
    b->b_channel_mask = i;
36
 
}
37
 
 
38
 
void pdp_imagebase_setup(t_class *c)
39
 
{
40
 
    /* parent class setup */
41
 
    pdp_base_setup(c);
42
 
 
43
 
     /* add pdp base class methods */
44
 
    class_addmethod(c, (t_method)pdp_imagebase_chanmask, gensym("chanmask"), A_FLOAT, A_NULL);
45
 
 
46
 
}
47
 
 
48
 
/* pdp base instance constructor */
49
 
void pdp_imagebase_init(void *x)
50
 
{
51
 
    int i;
52
 
    t_pdp_imagebase *b = (t_pdp_imagebase *)x;
53
 
 
54
 
    /* init super */
55
 
    pdp_base_init(x);
56
 
 
57
 
    /* convert all active incoming packet types to image */
58
 
    pdp_base_set_type_template(x, 0, pdp_gensym("image/*/*"));
59
 
 
60
 
    /* default chanmask == all */
61
 
    b->b_channel_mask = -1;
62
 
 
63
 
}
64
 
 
65
 
/* base instance destructor */
66
 
void pdp_imagebase_free(void *x)
67
 
{
68
 
    /* free super */
69
 
    pdp_base_free(x);
70
 
 
71
 
}
72
 
 
73
 
/* chanmask getter */
74
 
u32 pdp_imagebase_get_chanmask(void *x)
75
 
{
76
 
    t_pdp_base *b = (t_pdp_base *)x;
77
 
    return b->b_channel_mask;
78
 
}
79