Author: IOhannes m zmölnig
Description: avoid 'bogus pointer' warnings in [pix_rtx]
Applied-Upstream: 0.93.4
--- gem.orig/src/Pixes/pix_rtx.cpp
+++ gem/src/Pixes/pix_rtx.cpp
@@ -20,7 +20,7 @@
// pix_rtx
//
// this the RealTimeX - transformator, that does a kind of swapping the time and the x axis
-// of a video (or any series of pictures) ON THE FLY
+// of a video (or any series of pictures) ON THE FLY
//
// for more information, on how this works, look at
// http://umlaeute.mur.at/rtx
@@ -49,7 +49,7 @@
//
/////////////////////////////////////////////////////////
pix_rtx :: pix_rtx()
-{
+{
imageStruct image;
image.xsize = image.ysize = 64;
@@ -78,7 +78,7 @@
// CreateBuffer
//
/////////////////////////////////////////////////////////
-void pix_rtx :: create_buffer(imageStruct image)
+void pix_rtx :: create_buffer(const imageStruct&image)
{
size_t dataSize = image.xsize * image.xsize * image.ysize * image.csize * sizeof(unsigned char); // only 1 channel !!, to keep data-size handy
@@ -127,7 +127,7 @@
size_t pixsize = image.ysize * image.xsize;
int cols=image.xsize, c=0, c1=0;
int rows=image.ysize, r=0;
-
+
unsigned char *pixels = image.data;
unsigned char *wp; // write pointer
unsigned char *rp; // read pointer
@@ -136,7 +136,7 @@
if (!set_buffer) {
wp = buffer.data + pixsize * buffer.csize * bufcount;
memcpy(wp, pixels, pixsize * buffer.csize * sizeof(unsigned char));
- } else {
+ } else {
// fill the buffer with the current frame
// this might be useful to prevent the black screen in the beginning.
// "set" message
@@ -158,7 +158,7 @@
while (r < rows) {
rp = buffer.data + buffer.csize * (buffer.xsize * buffer.ysize * c + buffer.xsize * r + (bufcount - c + cols) % cols );
pixels = image.data + image.csize * (image.xsize * r + cols - c1);
-
+
*pixels = *rp;
r++;
}
@@ -172,7 +172,7 @@
while (r < rows) {
rp = buffer.data + buffer.csize * (buffer.xsize * buffer.ysize * c + buffer.xsize * r + (bufcount - c + cols) % cols );
pixels = image.data + image.csize * (image.xsize * r + cols - c1);
-
+
pixels[0] = rp[0];
pixels[1] = rp[1];
r++;
@@ -187,12 +187,12 @@
while (r < rows) {
rp = buffer.data + buffer.csize * (buffer.xsize * buffer.ysize * c + buffer.xsize * r + (bufcount - c + cols) % cols );
pixels = image.data + image.csize * (image.xsize * r + cols - c1);
-
+
pixels[chRed] = rp[chRed];
pixels[chBlue] = rp[chBlue];
pixels[chGreen] = rp[chGreen];
pixels[chAlpha] = rp[chAlpha];
-
+
r++;
}
r=0;
--- gem.orig/src/Pixes/pix_rtx.h
+++ gem/src/Pixes/pix_rtx.h
@@ -3,7 +3,7 @@
GEM - Graphics Environment for Multimedia
Change rtx-transform a series of images (eg: a video or a film)
-
+
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
@@ -14,15 +14,15 @@
rtx-transform a series of pictures (especially movies, videos,...)
you have to use pix_film instead of pix_movie to make this work with prerecorded videos
-
+
2803:forum::für::umläute:2000
0409:forum::für::umläute:2000
1801:forum::für::umläute:2001 added the second mode
IOhannes m zmoelnig
mailto:zmoelnig@iem.kug.ac.at
-
+
this code is published under the Gnu GeneralPublicLicense that should be distributed with gem & pd
-
+
-----------------------------------------------------------------*/
#ifndef _INCLUDE__GEM_PIXES_PIX_RTX_H_
@@ -37,47 +37,47 @@
KEYWORDS
pix
-
+
DESCRIPTION
-
+
-----------------------------------------------------------------*/
class GEM_EXTERN pix_rtx : public GemPixObj
{
CPPEXTERN_HEADER(pix_rtx, GemPixObj);
-
+
public:
-
+
//////////
// Constructor
pix_rtx();
-
+
protected:
-
+
//////////
// Destructor
virtual ~pix_rtx();
-
+
//////////
// create a buffer that fits to the current imageSize
- virtual void create_buffer(imageStruct image);
-
+ virtual void create_buffer(const imageStruct&image);
+
//////////
// delete the buffer
virtual void delete_buffer();
-
+
//////////
// clear the buffer
virtual void clear_buffer();
-
+
//////////
// Do the processing
virtual void processImage(imageStruct &image);
-
+
//////////
// the huge double buffer and other tx-formation
imageStruct buffer;
int bufcount; // where to read/write
-
+
//////////
// the rtx-mode
bool mode;
@@ -85,13 +85,13 @@
//////////
// fill buffer with current pixbuff ?
bool set_buffer;
-
+
//////////
// the methods
static void modeMessCallback(void *data, t_floatarg newmode);
static void clearMessCallback(void *data);
static void setMessCallback(void *data);
-
+
};
#endif // for header file