13,258,269 members (41,950 online)
Rate this:
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:

## 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
v2
Rate this:

## 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;

}```
Rate this:

## Solution 3

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

Top Experts
Last 24hrsThis month
 OriginalGriff 240 Jochen Arndt 130 Richard MacCutchan 120 CPallini 115 F-ES Sitecore 75
 OriginalGriff 4,294 Karthik Bangalore 2,276 ppolymorphe 1,774 Dave Kreskowiak 1,606 CPallini 1,450