Commit 25eb6468 authored by tigital's avatar tigital
Browse files

added MACOSX support; initial YUV support


git-svn-id: https://pd-gem.svn.sourceforge.net/svnroot/pd-gem/trunk/Gem@49 49b2a0ca-c541-4d49-a7ef-d785e4371512
parent 6a96e985
......@@ -9,6 +9,7 @@
// Copyright (c) 1997-2000 Mark Danks.
// Copyright (c) Gnther Geiger.
// Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::fr::umlute. IEM
// Copyright (c) 2002 James Tittle & Chris Clepper
// For information on usage and redistribution, and for a DISCLAIMER OF ALL
// WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
//
......@@ -53,6 +54,15 @@ void pix_2grey :: processImage(imageStruct &image)
}
}
/////////////////////////////////////////////////////////
// processYUVImage
//
/////////////////////////////////////////////////////////
void pix_2grey :: processYUVImage(imageStruct &image)
{
post("pix_2grey: YUV not yet implemented :-(");
}
/////////////////////////////////////////////////////////
// static member function
//
......
......@@ -7,6 +7,7 @@ LOG
Copyright (c) 1997-1999 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
Copyright (c) 2002 James Tittle & Chris Clepper
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
......@@ -49,6 +50,10 @@ class GEM_EXTERN pix_2grey : public GemPixObj
//////////
// Do the processing
virtual void processImage(imageStruct &image);
//////////
// Do the processing
virtual void processYUVImage(imageStruct &image);
//////////
// Do the processing - this is a no-op
......
......@@ -9,6 +9,7 @@
// Copyright (c) 1997-2000 Mark Danks.
// Copyright (c) Gnther Geiger.
// Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::fr::umlute. IEM
// Copyright (c) 2002 James Tittle & Chris Clepper
// For information on usage and redistribution, and for a DISCLAIMER OF ALL
// WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
//
......@@ -106,6 +107,15 @@ void pix_a_2grey :: processImage(imageStruct &image)
}
}
/////////////////////////////////////////////////////////
// processYUVImage
//
/////////////////////////////////////////////////////////
void pix_a_2grey :: processYUVImage(imageStruct &image)
{
post("pix_a_2grey: YUV not yet implemented :-(");
}
/////////////////////////////////////////////////////////
// static member function
//
......
......@@ -7,6 +7,7 @@ LOG
Copyright (c) 1997-2000 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
Copyright (c) 2002 James Tittle & Chris Clepper
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
......@@ -60,6 +61,10 @@ class GEM_EXTERN pix_a_2grey : public GemPixObj
//////////
// Do the processing
virtual void processImage(imageStruct &image);
//////////
// Do the processing
virtual void processYUVImage(imageStruct &image);
//////////
// Do the processing - this is a no-op
......
......@@ -9,6 +9,7 @@
// Copyright (c) 1997-1998 Mark Danks.
// Copyright (c) Gnther Geiger.
// Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::fr::umlute. IEM
// Copyright (c) 2002 James Tittle & Chris Clepper
// For information on usage and redistribution, and for a DISCLAIMER OF ALL
// WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
//
......@@ -42,6 +43,23 @@ pix_add :: ~pix_add()
/////////////////////////////////////////////////////////
void pix_add :: processDualImage(imageStruct &image, imageStruct &right)
{
#ifndef MMX
int datasize = image.xsize * image.ysize;
unsigned char *leftPix = image.data;
unsigned char *rightPix = right.data;
while(datasize--)
{
leftPix[chRed] =
CLAMP_HIGH((int)leftPix[chRed] + (int)rightPix[chRed]);
leftPix[chGreen] =
CLAMP_HIGH((int)leftPix[chGreen] + (int)rightPix[chGreen]);
leftPix[chBlue] =
CLAMP_HIGH((int)leftPix[chBlue] + (int)rightPix[chBlue]);
leftPix += 4;
rightPix += 4;
}
#else
register int datasize = (image.xsize * image.ysize)>>3;
register unsigned char *leftPix = image.data;
register unsigned char *rightPix = right.data;
......@@ -60,6 +78,7 @@ void pix_add :: processDualImage(imageStruct &image, imageStruct &right)
leftPix+=8;rightPix+=8;
}
MMXDONE;
#endif
}
/////////////////////////////////////////////////////////
......@@ -68,6 +87,19 @@ void pix_add :: processDualImage(imageStruct &image, imageStruct &right)
/////////////////////////////////////////////////////////
void pix_add :: processDualGray(imageStruct &image, imageStruct &right)
{
#ifndef MMX
int datasize = image.xsize * image.ysize;
unsigned char *leftPix = image.data;
unsigned char *rightPix = right.data;
while(datasize--)
{
leftPix[chGray] =
CLAMP_HIGH((int)leftPix[chGray] + (int)rightPix[chGray]);
leftPix++;
rightPix++;
}
#else
int datasize = (image.xsize * image.ysize)>>2;
MMXSTART;
......@@ -78,6 +110,7 @@ void pix_add :: processDualGray(imageStruct &image, imageStruct &right)
leftPix+=8;rightPix+=8;
}
MMXDONE;
#endif
}
/////////////////////////////////////////////////////////
......@@ -104,6 +137,23 @@ void pix_add :: processRightGray(imageStruct &image, imageStruct &right)
}
}
/////////////////////////////////////////////////////////
// processDualYUV
//
/////////////////////////////////////////////////////////
void pix_add :: processDualYUV(imageStruct &image, imageStruct &right)
{
post("pix_add: YUV not yet implemented");
}
/////////////////////////////////////////////////////////
// processRightYUV
//
/////////////////////////////////////////////////////////
void pix_add :: processRightYUV(imageStruct &image, imageStruct &right)
{
post("pix_add: YUV not yet implemented");
}
/////////////////////////////////////////////////////////
// static member function
//
......
......@@ -7,6 +7,7 @@ LOG
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
Copyright (c) 2002 James Tittle & Chris Clepper
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
......@@ -57,6 +58,14 @@ class GEM_EXTERN pix_add : public GemPixDualObj
//////////
// Do the processing
virtual void processRightGray(imageStruct &image, imageStruct &right);
//////////
// Do the processing
virtual void processDualYUV(imageStruct &image, imageStruct &right);
//////////
// Do the processing
virtual void processRightYUV(imageStruct &image, imageStruct &right);
};
#endif // for header file
......@@ -8,6 +8,7 @@
//
// Copyright (c) 1997-2000 Mark Danks.
// Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::fr::umlute. IEM
// Copyright (c) 2002 James Tittle & Chris Clepper
// For information on usage and redistribution, and for a DISCLAIMER OF ALL
// WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
//
......@@ -69,7 +70,7 @@ void pix_aging :: processFX(imageStruct &image)
unsigned char *pixes = image.data;
unsigned char *p;
int count = image.ysize * image.xsize * image.csize;
unsigned char a, b;
unsigned char a;
int width = image.xsize * image.csize;
int height= image.ysize;
......@@ -207,7 +208,14 @@ void pix_aging :: processFX(imageStruct &image)
;
}
/////////////////////////////////////////////////////////
// processImage
//
/////////////////////////////////////////////////////////
void pix_aging :: processYUVfx(imageStruct &image)
{
post("pix_aging: YUV not yet implemented :-(");
}
void pix_aging :: scratchMess(int scratchlines)
{
......
......@@ -6,6 +6,7 @@ LOG
Copyright (c) 1997-1999 Mark Danks. mark@danks.org
Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::fr::umlute. IEM. zmoelnig@iem.kug.ac.at
Copyright (c) 2002 James Tittle & Chris Clepper
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
......@@ -25,7 +26,7 @@ LOG
CLASS
pix_aging
Change pix to greyscale
Make pix look old
KEYWORDS
pix
......@@ -60,7 +61,10 @@ class GEM_EXTERN pix_aging : public pix_fx
//////////
// Do the processing
virtual void processFX(imageStruct &image);
//////////
// Do the processing
virtual void processYUVfx(imageStruct &image);
#if 1
//////////
// Do the processing - this is a no-op
......
......@@ -9,6 +9,7 @@
// Copyright (c) 1997-1998 Mark Danks.
// Copyright (c) Gnther Geiger.
// Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::fr::umlute. IEM
// Copyright (c) 2002 James Tittle & Chris Clepper
// For information on usage and redistribution, and for a DISCLAIMER OF ALL
// WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
//
......@@ -75,7 +76,14 @@ void pix_alpha :: processImage(imageStruct &image)
pixels += 4;
}
}
/////////////////////////////////////////////////////////
// render
//
/////////////////////////////////////////////////////////
void pix_alpha :: processYUVImage(imageStruct &image)
{
post("pix_alpha: YUV processing not yet implemented :-(");
}
/////////////////////////////////////////////////////////
// processGrayImage
......
......@@ -7,6 +7,7 @@ LOG
Copyright (c) 1997-1999 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
Copyright (c) 2002 James Tittle & Chris Clepper
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
......@@ -59,7 +60,8 @@ class GEM_EXTERN pix_alpha : public GemPixObj
//////////
// Do the processing
virtual void processImage(imageStruct &image);
virtual void processGrayImage(imageStruct & image);
virtual void processYUVImage(imageStruct &image);
virtual void processGrayImage(imageStruct & image);
//////////
......
......@@ -9,6 +9,7 @@
// Copyright (c) 1997-1998 Mark Danks.
// Copyright (c) Gnther Geiger.
// Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::fr::umlute. IEM
// Copyright (c) 2002 James Tittle & Chris Clepper
// For information on usage and redistribution, and for a DISCLAIMER OF ALL
// WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
//
......@@ -60,6 +61,15 @@ void pix_bitmask :: processImage(imageStruct &image)
}
}
/////////////////////////////////////////////////////////
// processYUVImage
//
/////////////////////////////////////////////////////////
void pix_bitmask :: processYUVImage(imageStruct &image)
{
post("pix_bitmask: YUV not yet implemented :-(");
}
/////////////////////////////////////////////////////////
// processGrayImage
//
......
......@@ -7,6 +7,7 @@ LOG
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
Copyright (c) 2002 James Tittle & Chris Clepper
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
......@@ -55,10 +56,14 @@ class GEM_EXTERN pix_bitmask : public GemPixObj
//////////
// Do the processing
virtual void processImage(imageStruct &image);
//////////
// Do the processing
virtual void processYUVImage(imageStruct &image);
//////////
// Do the processing
void processGrayImage(imageStruct &image);
virtual void processGrayImage(imageStruct &image);
//////////
// Set the new gain
......
......@@ -8,6 +8,7 @@
//
// Copyright (c) 1997-1998 Mark Danks.
// Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::fr::umlute. IEM
// Copyright (c) 2002 James Tittle & Chris Clepper
// For information on usage and redistribution, and for a DISCLAIMER OF ALL
// WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
//
......@@ -71,14 +72,14 @@ void pix_blob :: processImage(imageStruct &image)
unsigned char *pixels = image.data;
int rows = image.ysize;
t_float x_inv = 1./image.xsize;
t_float y_inv = 1./image.ysize;
//t_float x_inv = 1./image.xsize;
//t_float y_inv = 1./image.ysize;
char channel = -1;
float gain_r = 0.3, gain_g = 0.3, gain_b = 0.3, gain_a = 0.1;
float sum = 0.0, sum_x = 0.0, sum_y = 0.0;
float blob_x = 0., blob_y = 0., blob_z = 0.;
float /*blob_x = 0., blob_y = 0.,*/ blob_z = 0.;
switch (m_method) {
case 1:
......@@ -176,6 +177,15 @@ void pix_blob :: GainMess(int argc, t_atom *argv)
m_method = -1;
}
/////////////////////////////////////////////////////////
// processYUVImage
//
/////////////////////////////////////////////////////////
void pix_blob :: processYUVImage(imageStruct &image)
{
post("pix_blob: YUV not yet implemented :-(");
}
/////////////////////////////////////////////////////////
// static member function
//
......
......@@ -7,6 +7,7 @@ Calculate the center of gravity of a pixBlock.
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
Copyright (c) 2002 James Tittle & Chris Clepper
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
......@@ -63,7 +64,10 @@ protected:
//////////
virtual void processGrayImage(imageStruct &image) {}
//////////
virtual void processYUVImage(imageStruct &image);
//////////
void ChannelMess(int channel);
void GainMess(int argc, t_atom *argv);
......
......@@ -16,7 +16,6 @@ LOG
#define INCLUDE_PIX_CLEARBLOCK_H_
#include "Base/GemBase.h"
#include "Base/GemPixUtil.h"
#include "Base/GemState.h"
......
......@@ -9,6 +9,7 @@
// Copyright (c) 1997-1998 Mark Danks.
// Copyright (c) Gnther Geiger.
// Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::fr::umlute. IEM
// Copyright (c) 2002 James Tittle & Chris Clepper
// For information on usage and redistribution, and for a DISCLAIMER OF ALL
// WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
//
......@@ -57,6 +58,10 @@ void pix_color :: processImage(imageStruct &image)
}
}
void pix_color :: processYUVImage(imageStruct &image)
{
post("pix_color: YUV not yet implemented :-(");
}
/////////////////////////////////////////////////////////
// vecGainMess
//
......
......@@ -7,6 +7,7 @@ LOG
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
Copyright (c) 2002 James Tittle & Chris Clepper
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
......@@ -53,6 +54,9 @@ class pix_color : public GemPixObj
//////////
// Do the processing
virtual void processImage(imageStruct &image);
//////////
virtual void processYUVImage(imageStruct &image);
//////////
// Set the new color
......
......@@ -9,6 +9,7 @@
// Copyright (c) 1997-1998 Mark Danks.
// Copyright (c) Gnther Geiger.
// Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::fr::umlute. IEM
// Copyright (c) 2002 James Tittle & Chris Clepper
// For information on usage and redistribution, and for a DISCLAIMER OF ALL
// WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
//
......@@ -55,6 +56,10 @@ void pix_coloralpha :: processImage(imageStruct &image)
}
}
void pix_coloralpha :: processYUVImage(imageStruct &image)
{
post("pix_coloralpha: YUV not yet implemented :-(");
}
/////////////////////////////////////////////////////////
// static member function
//
......
......@@ -7,6 +7,7 @@ LOG
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
Copyright (c) 2002 James Tittle & Chris Clepper
For information on usage and redistribution, and for a DISCLAIMER OF ALL
WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
......@@ -49,6 +50,9 @@ class GEM_EXTERN pix_coloralpha : public GemPixObj
//////////
// Do the processing
virtual void processImage(imageStruct &image);
//////////
virtual void processYUVImage(imageStruct &image);
};
#endif // for header file
......@@ -9,6 +9,7 @@
// Copyright (c) 1997-1998 Mark Danks.
// Copyright (c) Gnther Geiger.
// Copyright (c) 2001-2002 IOhannes m zmoelnig. forum::fr::umlute. IEM
// Copyright (c) 2002 James Tittle & Chris Clepper
// For information on usage and redistribution, and for a DISCLAIMER OF ALL
// WARRANTIES, see the file, "GEM.LICENSE.TERMS" in this distribution.
//
......@@ -74,6 +75,11 @@ void pix_colormatrix :: processImage(imageStruct &image)
}
}
void pix_colormatrix :: processYUVImage(imageStruct &image)
{
post("pix_colormatrix: YUV not yet implemented :-(");
}
/////////////////////////////////////////////////////////
// matrixMess
//
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment