swarm-support
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Heatbug related inquiries...


From: Ken Cline
Subject: Re: Heatbug related inquiries...
Date: Tue, 5 Aug 1997 11:41:47 -0400 (EDT)

On Tue, 5 Aug 1997 address@hidden wrote:

> I think I know what's going on here.  The various values of heat are
> being converted to the 64 levels of red used in the heat map.  So
> heatvalues 0-512 = red level 0, heatvalues 513-1026 = red level 1, and
> so on.  But what does the parameters in setDisplayMappingM:C: mean? 
> What does the M and C mean? 

M := modfactor and C := constant

So color = Heat(x,y) / M + C

Here's the code:

   % grep setDisplayMapping src/*/*.m | more
   src/space/Value2dDisplay.m:-setDisplayMappingM: (int) m C: (int) c {
   % cd src/space
   % more Value2dDisplay.m
       ...
   // linear transform between values and colours. Good enough?
   -setDisplayMappingM: (int) m C: (int) c {
     modFactor = m;
     colorConstant = c;
     return self;
   }
       ...
   -display {
             ...
      long color;
      color = (long) *(discrete2dSiteAt(lattice, offsets, x, y));
      color = color/modFactor + colorConstant;
      if (color < 0 || color > 255) {
        [WarningMessage raiseEvent: "Value2dDisplay: found "
                 "colour %d not in [0,255].\n", color];
             ...
   }
       ...


> And speaking of "M" why didn't they call that macro M something more
> descriptive instead of M?

Okay, first "M" in this method call is *not* the same as the
"M()" macro.  It would probably be more descriptive to have

      setDisplayMappingMod: Constant:

or something.  You could add a more descriptive method like
this to HeatSpace and then have this method call
`setDisplayMappingM:C:', if you want.

In the macro, "M" stands for message (I think) and there
would probably be no point in having a macro called
"Message()" to replace "@selector()"; it wouldn't save you
much work.

Ken.


_________________________________________________________
Ken Cline                             address@hidden
SAIC                                 VOICE (410) 571-0413
Annapolis, MD                          FAX (301) 261-8427


                  ==================================
   Swarm-Support is for discussion of the technical details of the day
   to day usage of Swarm.  For list administration needs (esp.
   [un]subscribing), please send a message to <address@hidden>
   with "help" in the body of the message.
                  ==================================


reply via email to

[Prev in Thread] Current Thread [Next in Thread]