Click here to Skip to main content
15,883,705 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
for {set i 128} {$i<256} {incr i 1} {
    eval lut SetTableValue $i [expr ($i-128.0)/128.0] [expr ($i-128.0)/128.0] [expr ($i-128.0)/128.0] 1


That's what I got in C++

for (int i; 128<256;i++)>
    eval->lut(SetTableValue(i), expr->(i-128.0)/128.0()expr->(i-128.0)/128.0()expr->(i-128.0)/128.0()1);


I don't know how to change eval->lut and expr functions. Do you know?

I tried to convert a TCL code to C++, but converter that I used didn't translate a very importnat lines of code. Can anyone make it work?
Posted
Updated 20-Jul-10 22:08pm
v5

nmatulionis wrote:
for (int i; 128<i<256;i++)


This should be:
for(int i=129 ; i<256 ; ++i)

What does eval, lut and expr means in TCL?

-Saurabh
 
Share this answer
 
v2
for (int i = 128; i < 256; ++i) {

   setTableValue(i, ((double)i - 128.0) / 128), ((double)i - 128.0) / 128), ((double)i - 128.0) / 128), 1);

}


where setTablueValue would look something like:

void setTableValue(int index, double r, double g, double b, double a) {

   data[index].r = r;
   data[index].g = g;
   data[index].b = b;
   data[index].a = a;

}
 
Share this answer
 
May I know which converter you are using to to convert a TCL code to C++?
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900