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

Discussion in 'C++' started by nagle.p@gmail.com, Apr 16, 2006.

  1. Guest

    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, 2006
    #1
    1. Advertising

  2. Why not try reference, it may be a better method.
     
    =?utf-8?B?5rW36aOO?=, Apr 16, 2006
    #2
    1. Advertising

  3. Guest

    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, 2006
    #3
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. DeeAnn
    Replies:
    4
    Views:
    7,661
  2. =?Utf-8?B?Q2hyaXM=?=

    Session varibles limit?

    =?Utf-8?B?Q2hyaXM=?=, Jan 9, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    2,722
    =?Utf-8?B?Q2hyaXM=?=
    Jan 10, 2005
  3. asit

    varibles of class type

    asit, Jun 29, 2008, in forum: Java
    Replies:
    1
    Views:
    309
    John B. Matthews
    Jun 29, 2008
  4. Zhan feng Wang
    Replies:
    5
    Views:
    134
    Lloyd Linklater
    Aug 6, 2007
  5. ad
    Replies:
    5
    Views:
    335
    Uri Guttman
    May 30, 2004
Loading...

Share This Page