void JXImage::Receive ( JBroadcaster* sender, const Message& message ) { if (sender == itsColormap && message.Is(JXColormap::kNewColormap) && itsDepth > 1 && (itsPixmap != None || itsImage != NULL)) { const JXColormap::NewColormap* info = dynamic_cast(const JXColormap::NewColormap*, &message); assert( info != NULL ); ConvertToImage(); const JCoordinate width = GetWidth(); const JCoordinate height = GetHeight(); for (JCoordinate y=0; y<height; y++) { for (JCoordinate x=0; x<width; x++) { const unsigned long xPixel = XGetPixel(itsImage, x,y); XPutPixel(itsImage, x,y, info->ConvertPixel(xPixel)); } } ConvertToDefaultState(); } else {
void JXImage::ImageDataFinished() { ConvertToDefaultState(); if (itsMask != NULL) { itsMask->ConvertToDefaultState(); } }