Passing varibles into a function from a differen class...sorta

N

nagle.p

Ok,

Im writting a plug-in for a application and the class the I have to
derive from has a warp() funtion that gets called that is part of the
base class. I need to pass a varible into this funtion that has a
sequence of numbers starting at (0,0) and going up to (nWidth, nHeight)
which would be all the pixels on there screen at each coordinate.

So I have tried all different types of things (pointers, functions
inside the function call to retrive the values from the getPIxels
loop....ive tried pointers, arrays, template classes, functions calling
from inside the warp function) but nothing works when I call my varible
that should store the pixel values from 0,0 to nWidth,nHeight it will
return the LAST pixel value....not a sequence of numbers....im using a
global varible which gets set in 2 places 1 for the loop and its used
int he function that is the one two times.....

im lost.
 
N

nagle.p

Hey, that was my first approch to this problem and it does not work, it
will work in any function that i create and call but it only retrives
the last value from the loop of image values (0,0)
to (nWidth, nHeight) ive tried simple references like
//in the eval loop for the image's pixels, xChannel is a global
xChannel = imageValue;
//then in the warp() call
float &nR = xChannel;

then i tried
//in the eval again for the images
void SetXChannel(float xChannel) {xIChannel = xChannel ;}
//int he warp function
float GetXChannel() {return xIChannel;}
neither works but when i do a printf() and these are together in the
same part of the program then it will work but not in the warp
function....

argh

Pat
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,754
Messages
2,569,516
Members
44,975
Latest member
MDACVIngedients

Latest Threads

Top