473,395 Members | 1,872 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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.

Apr 16 '06 #1
2 1783
Why not try reference, it may be a better method.

Apr 16 '06 #2
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

Apr 16 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Andy Read | last post by:
Dear all, I thought I understood passing parameters ByVal and ByRef but I clearly don't! If I define a simple class of: Public Class Person Public Name as String Public Age as Integer End...
58
by: jr | last post by:
Sorry for this very dumb question, but I've clearly got a long way to go! Can someone please help me pass an array into a function. Here's a starting point. void TheMainFunc() { // Body of...
21
by: Jon Slaughter | last post by:
I have a class that is basicaly duplicated throughout several files with only members names changing according to the class name yet with virtually the exact same coding going on. e.g. class...
12
by: Andrew Bullock | last post by:
Hi, I have two classes, A and B, B takes an A as an argument in its constructor: A a1 = new A(); B b = new B(a1);
2
by: Peter | last post by:
Hello I have the following tag <select name="cat" id="cat" onchange="popUpWin('cmPhaseReload.php?category='+document.getElementById('cat').options.value ,600,600,'yes')" class="tbl_result"...
7
by: TS | last post by:
I was under the assumption that if you pass an object as a param to a method and inside that method this object is changed, the object will stay changed when returned from the method because the...
8
by: Peter | last post by:
I will excute the code below to get MethodName array. These codes are edited under VS2003. Now I want to upgrade it to VS2005,but VS2005 gives me a varning message: The varible "sSourceMethodName"...
18
by: tbringley | last post by:
I am a c++ newbie, so please excuse the ignorance of this question. I am interested in a way of having a class call a general member function of another class. Specifically, I am trying to...
2
by: =?Utf-8?B?T2xkQnV0U3RpbGxMZWFybmluZw==?= | last post by:
How do you pass varibles between screens? I created properties in form 2 for the variables that I wanted to pass from Form 1. So when I create a new instance of Form2 from Form 1, intellisense...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.