[comp.windows.open-look] server images

courtney@chassel.cps.msu.edu (Jonathan Courtney) (04/04/91)

  Recently I posted a request for help with XView colormap segments.  As it
turned out, the problem was not one with my colormap segment, but with the
server image that I was using to test it.  Which led me to an entirely
different dilemma:

  I am creating an xview server image that should be a simple gray ramp with
values from 0-255.  Yet when I display the image, only colors from 0-127 are
displayed.  It turns out that the xv_create call actually zeroes out the data
with values >= 128.  It sounds to me like a sign problem, but the same data
works with XCreateImage calls just fine.  Any thoughts?

==========
#include <xview/svrimage.h>

Server_image image;
char* buffer;
int i, j;

  ...

  buffer = (char*)malloc(256*256);

  /* Make the gray ramp */
  for (i=0; i<256; i++)
    for (j=0; j<256; j++)
      buffer[i*256+j] = j;


  /* Create the image in "X" format */
  image = xv_create(NULL, SERVER_IMAGE,
			XV_WIDTH, 256,
			XV_HEIGHT, 256,
			SERVER_IMAGE_DEPTH, 8,
			SERVER_IMAGE_X_BITS, buffer,
			SERVER_IMAGE_COLORMAP, "my_colormap",
			NULL);

==============

  And then I use the image in a PANEL_LIST object.

  Again, any help is greatly appreciated.

							Jon


  

kcwong@ssd.kodak.com (K.C. Wong (253-7926)) (04/04/91)

In article <1991Apr3.173428.27898@msuinfo.cl.msu.edu> courtney@chassel.cps.msu.edu (Jonathan Courtney) writes:
>
>  Recently I posted a request for help with XView colormap segments.  As it
>turned out, the problem was not one with my colormap segment, but with the
>server image that I was using to test it.  Which led me to an entirely
>different dilemma:
>
>  I am creating an xview server image that should be a simple gray ramp with
>values from 0-255.  Yet when I display the image, only colors from 0-127 are
>displayed.  It turns out that the xv_create call actually zeroes out the data
>with values >= 128.  It sounds to me like a sign problem, but the same data
>works with XCreateImage calls just fine.  Any thoughts?
>

I encountered the same thing a few months ago... 

A Sun guy I've talked to seems to think it's a server image problem and 
has alerted the Xview engineers. It sure looks like a signed problem!
This problem probably will be fixed in OW 3.0.

I've actually wrote an xview program (xvcolors) to browse thru'
the rgb.txt file or any user specified rgb file. It suffers from
not being able to display more than 128 colors at a time, 
because of the problem mentioned above.... but then it has a
"next page" feature so you can "page" thru the whole rgb file.
Within a page (of 128 colors) you can scroll the color list. I believe
there's a search capability also. I'll post if there's enough response.


Regards,
kcwong@ssd.kodak.com

-- 
		kcwong@eknest.kodak.com	( K.C. Wong )