XForms: pixel value from XImage & flimage...

From: Yann Guichoux (guichoux@shom.fr)
Date: Thu Mar 09 2000 - 10:26:19 EST

  • Next message: Steve Lamont: "Re: XForms: pixel value from XImage & flimage..."

    # To subscribers of the xforms list from Yann Guichoux <guichoux@shom.fr> :


    I'm trying to convert an XImage to an flimage (still trying !!!)
    I 've almost succeded ! my last problem is coming from pixel values .
    the flimage type i'm using is FL_IMAGE_CI.

    i'm creating an ximage with XGetImage(pixmap)

    then, i use XGetPixel() to get pixel values from the XImage and
    i fill the flimage->ci array with these pixel values :


    but the pixelvalues i get by this way are not corresponding to the good
    index into the lookup table defined in flimage structure.
    ( red_lut green_lut blue_lut arrays )

    How should i process to convert pixel values from the ximage to color
    index in the lookup table ??

    here is a piece of code i wrote :

            /*** first getting the ximage ***/


            /*** then initialising the flimage ***/


            /*** filling the look up table ***/

            for (i=0;i<fl_image->map_len;i++)
                    fl_getmcolor(IDCOL1+i,&red,&green,&blue); <--- i think my problem is
    coming from here
                    fl_image->red_lut[i]=(short)red; With XGetPixel() i'm not getting the
    good index in my colormap

            /*** filling the color Index array ***/

            for (i=0; i<ximage->width; i++)
                    for (j=0; j<ximage->height ; j++)

             /*** saving the image file ***/


    how should i do to make it works ???

    thanks for any help...

    To unsubscribe, send the message "unsubscribe" to
    xforms-request@bob.usuhs.mil or see
    XForms Home Page: http://world.std.com/~xforms
    List Archive: http://bob.usuhs.mil/mailserv/list-archives/

    This archive was generated by hypermail 2b29 : Thu Mar 09 2000 - 10:34:11 EST