By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
434,871 Members | 2,304 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 434,871 IT Pros & Developers. It's quick & easy.

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

P: n/a

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 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.

Apr 16 '06 #1
Share this Question
Share on Google+
2 Replies

P: n/a
Why not try reference, it may be a better method.

Apr 16 '06 #2

P: n/a
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



Apr 16 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.