my real question

Hi Greg,
Thank you for your suggestion at first!

For this moment, I think I should tell you my real situation. From the requirement
of our project, I could not use the Radiance in the form of command line and I
must change some codes to form our own APIs (making use of static library). Also,
I couldn't use system calls. We can get the required image using API altered from
"rpict", and then our real problem is to specify a region (or even a single pixel)
on the image plane to get the radiance value and the picture of that region. In my
opinion, "rpict" can specify the exact position on an image plane. So, I use the
changed "rtrace" to render the region to obtain their radiance values (r, g, b)
and then I want to transform them into a suitable file form to obtain the picture.
I know I can get the answer through looking into the source codes, but I do not
have so much time for that. I have tried the method Dr. Peter told me. However,
that method sometimes works well and sometimes not. Now, I want to take advantage
the Radiance picture directly. Could you please tell me the suggestion? From your
opinion, what is the better solution for my problem?

Thank you in advance!

Qing

Greg Ward wrote:

···

Hello Qing,

There are many options for getting the output of rtrace and converting
it to an image. I would first echo Peter's question, which is why you
are not using rpict? If it is because you cannot generate the image
you want, be sure you have explored all of the view types (-vt?) and
options rpict has to offer from the man page. If you do not have the
man pages installed on your system, you can always get them from the
online versions (slightly out of date) at LBNL:

        http://radsite.lbl.gov/radiance/refer/index.html#cat2

If you want to create a Radiance picture from rtrace, the simplest
method is to specify the horizontal and vertical resolutions on the
rtrace command line, and use the -fac output option, like so:

        % rtrace -ov -fac -x $xsiz -y $ysiz $octree < $input_rays > $output_pic

where the variables xsiz, ysiz, octree, input_rays, and output_pic are
set appropriately. The second option is to output the standard
floating point values, and convert the result with the pvalue program,
like so

        % rtrace -ov $octree < $input_rays | pvalue -r -y $yres +x $xres -d >
$output_pic

There is no real advantage to using this method, however. And as I
said, there is no real advantage to using rtrace over rpict, either,
unless you absolutely cannot generate the view you want with rpict.

-Greg

Hi Qing,

I don't really have anything to add to what Dr. Peter and I have written, already. You may use the -fac option of rtrace to get a Radiance RGBE image on the output, which you may then pass to any of the Radiance picture filters and converters provided (e.g., pfilt, pcomb, ra_ppm, etc.). You have not given me enough specifics about your project for me to determine whether or not rpict could generate the views directly, but in most cases, it can. Rpict has options for fore and aft clipping planes, parallel and fisheye views, and view camera features. Anyway, if you need to use rtrace, we have given you at least three methods for doing so.

One other thing you might investigate is the code in ray/src/common/process.c, which provides routines for communicating with a separate rtrace process from a controlling program. For an example of how you might do this, you can look at the code in ray/src/px/pinterp.c.

-Greg

···

Hi Greg,
Thank you for your suggestion at first!

For this moment, I think I should tell you my real situation. From the requirement
of our project, I could not use the Radiance in the form of command line and I
must change some codes to form our own APIs (making use of static library). Also,
I couldn't use system calls. We can get the required image using API altered from
"rpict", and then our real problem is to specify a region (or even a single pixel)
on the image plane to get the radiance value and the picture of that region. In my
opinion, "rpict" can specify the exact position on an image plane. So, I use the
changed "rtrace" to render the region to obtain their radiance values (r, g, b)
and then I want to transform them into a suitable file form to obtain the picture.
I know I can get the answer through looking into the source codes, but I do not
have so much time for that. I have tried the method Dr. Peter told me. However,
that method sometimes works well and sometimes not. Now, I want to take advantage
the Radiance picture directly. Could you please tell me the suggestion? From your
opinion, what is the better solution for my problem?

Thank you in advance!

Qing

Hi Qing,

For this moment, I think I should tell you my real situation. From the requirement
of our project, I could not use the Radiance in the form of command line and I
must change some codes to form our own APIs (making use of static library).

So, I guess you're developing an interactive, graphical program that
displays an image that uses values calculated by some routines of
Radiance. Which would be most easily done using one of
fork&exec/system/popen on Posix (e.g. Linux/UNIX) systems, Windows may
have similar means of communicating with external programs. But you
said, you can't do 'system' calls. Does that mean you can't read from an
externally started program ?

I couldn't use system calls. We can get the required image using API altered from
"rpict",

What do you mean by "API altered from rpict" ? Using the rendering
routines from rtrace/rpict would be feasible, but it doesn't explain why
you have trouble with rtrace output.

and then our real problem is to specify a region (or even a single
pixel)

on the image plane to get the radiance value and the picture of that region. In my
opinion, "rpict" can specify the exact position on an image plane.

??

So, I use the changed "rtrace" to render the region to obtain their radiance values (r, g, b)
and then I want to transform them into a suitable file form to obtain the picture.
I know I can get the answer through looking into the source codes, but I do not
have so much time for that. I have tried the method Dr. Peter told me. However,
that method sometimes works well and sometimes not.

?? It fails if and how ?

Now, I want to take advantage the Radiance picture directly.

??

opinion, what is the better solution for my problem?

I'm still not quite sure I understand what you problem is-

-Peter

···

--
pab-opto, Freiburg, Germany, www.pab-opto.de