IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 29858


Ignore:
Timestamp:
Nov 26, 2010, 11:47:42 AM (15 years ago)
Author:
eugene
Message:

bDrawBuffer now requires a palette

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20101103/psLib/src/jpeg/psImageJpeg.c

    r29542 r29858  
    167167  int dy = image->numRows;
    168168 
    169   bDrawBuffer *bdbuf = bDrawBufferCreate(dx, dy);
     169  int Npalette;
     170  png_color *palette = KapaPNGPalette (&Npalette);
     171
     172  bDrawBuffer *bdbuf = bDrawBufferCreate(dx, dy, 1, palette, Npalette);
    170173
    171174  return bdbuf;
     
    180183  int dy = bdbuf->Ny;
    181184
    182   int Npalette;
    183   png_color *palette = KapaPNGPalette (&Npalette);
     185  int Npalette = bdbuf->Npalette;
     186  png_color *palette = bdbuf->palette;
    184187  bDrawColor white = KapaColorByName ("white");
    185188  for (int j = 0; j < dy; j++) {
     
    336339
    337340    // set the scalebar labels
     341    int Npalette;
     342    png_color *palette = KapaPNGPalette (&Npalette);
     343
    338344    char string[64];
    339     bDrawBuffer *labels = bDrawBufferCreate(dx, PS_JPEG_LABELPAD);
     345    bDrawBuffer *labels = bDrawBufferCreate(dx, PS_JPEG_LABELPAD, 1, palette, Npalette);
    340346    SetRotFont ("helvetica", 8);
    341     bDrawSetBuffer(labels);
    342347    sprint_double (string, options->min);
    343     bDrawRotText(2, 2, string, 2, 0.0);
     348    bDrawRotText(labels, 2, 2, string, 2, 0.0);
    344349    sprint_double (string, options->max);
    345     bDrawRotText(dx - 2, 2, string, 0, 0.0);
     350    bDrawRotText(labels, dx - 2, 2, string, 0, 0.0);
    346351    sprint_double (string, 0.5*(options->min + options->max));
    347     bDrawRotText(0.5*dx, 2, string, 1, 0.0);
     352    bDrawRotText(labels, 0.5*dx, 2, string, 1, 0.0);
    348353    psImageJpegOverlayDraw(jpegImage, labels, 0, offset);
     354    bdDrawBufferFree(labels);
    349355  }
    350356   
Note: See TracChangeset for help on using the changeset viewer.