0a1177a35a3a3563427039abb194f341f51cc2a8 braney Tue Jun 15 18:17:24 2010 -0700 removed Smear8 in favor of making Smears always take Colors. There are still some problems with 32 bit smears not getting the same colors as it's 8bit analog. I'm thinking this is something to do with the 0 and 1 being white and black in eight bit diff --git src/hg/hgTracks/simpleTracks.c src/hg/hgTracks/simpleTracks.c index 17556b1..af182d4 100644 --- src/hg/hgTracks/simpleTracks.c +++ src/hg/hgTracks/simpleTracks.c @@ -3176,25 +3176,25 @@ } } -void grayThreshold(UBYTE *pt, int count) +void grayThreshold(UBYTE *pt, int count, Color *colors ) /* Convert from 0-4 representation to gray scale rep. */ { -UBYTE b; +Color b; int i; for (i=0; i= 4) - pt[i] = shadesOfGray[9]; + colors[i] = shadesOfGray[9]; } } @@ -3295,14 +3295,16 @@ AllocArray(gapUseCounts, width); countTrackBaseUse(tg, width, baseWidth, useCounts, gapUseCounts, hvg->rc); -grayThreshold(useCounts, width); -hvGfxVerticalSmear8(hvg,xOff,yOff,width,lineHeight,useCounts,TRUE); +Color *colors = needMem(sizeof(Color) * width); +grayThreshold(useCounts, width, colors); +hvGfxVerticalSmear(hvg,xOff,yOff,width,lineHeight,colors,TRUE); freeMem(useCounts); if (gapUseCounts != NULL) { int midY = yOff + (tg->heightPer>>1); - grayThreshold(gapUseCounts, width); - hvGfxVerticalSmear8(hvg,xOff,midY,width,1,gapUseCounts,TRUE); + grayThreshold(gapUseCounts, width, colors); + + hvGfxVerticalSmear(hvg,xOff,midY,width,1,colors,TRUE); freeMem(gapUseCounts); } } @@ -6331,6 +6333,7 @@ hvGfxSetClip(hvg, xOff, yOff, width*2 , 52); /* map colors from PGM to browser colors */ +Color *colors = needMem(sizeof(Color) * width); for(ii=0; ii < 52; ii++) { int jj; @@ -6338,13 +6341,13 @@ for(jj=0; jj < width + 2; jj++) { - if (buf[jj] == 255) buf[jj] = 0; - else if (buf[jj] == 0x44)buf[jj] = brickColor; - else if (buf[jj] == 0x69)buf[jj] = greenColor; - else if (buf[jj] == 0x5e)buf[jj] = blueColor; + if (buf[jj] == 255) colors[jj] = MG_WHITE; + else if (buf[jj] == 0x44) colors[jj] = MG_RED; + else if (buf[jj] == 0x69) colors[jj] = greenColor; + else if (buf[jj] == 0x5e) colors[jj] = blueColor; } - hvGfxVerticalSmear8(hvg,xOff,yOff+ii,width ,1,buf,TRUE); + hvGfxVerticalSmear(hvg,xOff,yOff+ii,width ,1, colors,TRUE); } hvGfxUnclip(hvg);