Article # 693, added by Geoworks, historical record
| first | previous | index | next | last |

cvtpcx gives "unmappable pixel value" error.



Q. I'm trying to use cvtpcx and I get this error:

   C:\Nokia\icon>cvtpcx -2 -t -N -G -w25 -h18 -oclock.goh -m3 clock.pcx
   Input parameters for clock.pcx:
        1 bits per pixel, 4 planes, 4 bytes per plane
        (0, 0) to (24, 17): width = 24, height = 17
        xRes = 150, yRes = 150
   **** Error: Unmappable pixel value: 1 ****

A. Looking at the source for cvtpcx:

------------------------------------------------------------
static const byte responderMap[] = {
    RC_BLACK,     	/* C_BLACK */
    0xff,     	/* C_BLUE */
    RC_DARK_GRAY,     	/* C_GREEN */
    0xff,     	/* C_CYAN */
    0xff,     	/* C_RED */
    RC_DARK_GRAY,     	/* C_VIOLET */
    0xff,     	/* C_BROWN */
    RC_LIGHT_GRAY,     	/* C_LIGHT_GRAY */
    0xff,     	/* C_DARK_GRAY */
    0xff,     	/* C_LIGHT_BLUE */
    0xff,     	/* C_LIGHT_GREEN  */
    0xff,     	/* C_LIGHT_CYAN - should be masked out */
    0xff,     	/* C_LIGHT_RED  */
    RC_LIGHT_GRAY,     	/* C_LIGHT_VIOLET  */
    RC_LIGHT_GRAY,     	/* C_YELLOW  */
    RC_WHITE     	/* C_WHITE  */
};

byte MapPixelToResponder( byte rawPixel ) {
    assert(rawPixel<16);
    if (rawPixel == maskout) {
	return(rawPixel);
    }
    if (responderMap[rawPixel] == 0xff) {
	fprintf(stderr, 
		"**** Error: Unmappable pixel value: %d ****\n", 
		(int) rawPixel);
	exit(1);
    }
    return(responderMap[rawPixel]);
}
------------------------------------------------------------

   It appears that any color that maps to 0xff above is illegal. This
   would imply that your pcx file has "invalid" pixel values for the
   N9000. Check your pcx file to make sure it doesn't have any blues
   in it, since that is the unmappable pixel value you're getting
   (1 = C_BLUE).

   The other solution is to not pass the -N flag. This produced an
   image that worked for me on the emulator.