Click here to Skip to main content
13,258,269 members (41,950 online)
Rate this:
 
Please Sign up or sign in to 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 18-Apr-10 23:50pm
Updated 20-Jul-10 23:08pm
v5
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 1

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
  Permalink  
v2
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 2

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;
 
}
  Permalink  
Rate this: bad
 
good
Please Sign up or sign in to vote.

Solution 3

May I know which converter you are using to to convert a TCL code to C++?
  Permalink  

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

  Print Answers RSS
Top Experts
Last 24hrsThis month


Advertise | Privacy |
Web02 | 2.8.171114.1 | Last Updated 27 Sep 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100