Hi,
I'm going over some C code to see if I can rewrite some of it in Mops
(an exercise to learn how the language works). Things were going well
until I came across this:
>for(w = 0; w < myRect.right; w++, myPixelPtr++){
> UInt8 r, g, b, a;
> long myPixel= *myPixelPtr;
> if ((myPixel & 0x0ffffff) == 0x00ffffff) //pure white
> continue;
> a = (myPixel >> 24) & 0x0ff;
> r = (myPixel >> 16) & 0x0ff;
> g = (myPixel >> 8) & 0x0ff;
> b = (myPixel >> 0) & 0x0ff;
> if ((r > kThreshold) && (g > kThreshold) && (b > kThreshold) {
> r = g = b = kThreshold;
> *myPixelPtr = (a << 24) | (kThreshold << 16) | (kThreshold << 8)
> | (kThreshold << 0);
> }
>}
It's a for loop that is part of a function which runs through an image
and changes values depending on how close they are to white. The "&"
and "|" are of course bitwise operators, which have their equivalents
as "and" and "or" in Mops.
The question I have is this: what is the Mops equivalent to "<<" and
">>"? I haven't found anything on the web in general regarding Forth
and bitwise ****ft operators, and I'm not sure where to look in the
manual. If someone could point me in the right direction, I'd
appreciate it.
Thanks,
Erik


|