IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33650


Ignore:
Timestamp:
Apr 1, 2012, 2:30:36 PM (14 years ago)
Author:
eugene
Message:

working on trimming pngs to avoid excess whitespace

Location:
trunk/Ohana/src
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/Ohana/src/kapa2/include/prototypes.h

    r32695 r33650  
    9999int           ListSection         PROTO((int sock));
    100100void          SetSectionSizes     PROTO((Section *section));
     101int           SectionMinBoundary  PROTO((Graphic *graphic));
    101102
    102103KapaGraphWidget *InitGraph        PROTO((void));
  • trunk/Ohana/src/kapa2/src/PNGit.c

    r31665 r33650  
    2222
    2323  graphic = GetGraphic();
     24
     25  // limit the png window to the min needed to contain the active graphic regions
     26  SectionMinBoundary (graphic);
    2427
    2528  f = fopen (filename, "w");
     
    8184  /* see docs for write-row-callback to provide progress info */
    8285  if (haveImage) {
    83     png_set_IHDR (png_ptr, info_ptr, graphic->dx, graphic->dy, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
     86    png_set_IHDR (png_ptr, info_ptr, graphic->dxwin, graphic->dywin, 8, PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
    8487    png_set_sRGB (png_ptr, info_ptr, PNG_sRGB_INTENT_ABSOLUTE);
    8588  } else {
    86     png_set_IHDR (png_ptr, info_ptr, graphic->dx, graphic->dy, 8, PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
     89    png_set_IHDR (png_ptr, info_ptr, graphic->dxwin, graphic->dywin, 8, PNG_COLOR_TYPE_PALETTE, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_DEFAULT, PNG_FILTER_TYPE_DEFAULT);
    8790    png_set_PLTE (png_ptr, info_ptr, palette, Npalette);
    8891  }
  • trunk/Ohana/src/kapa2/src/Sections.c

    r32695 r33650  
    245245    int Xe = 0;
    246246    int Ye = 0;
     247
     248# if (1)
     249    graphic->xwin  = 0;
     250    graphic->ywin  = 0;
     251    graphic->dxwin = graphic->dx;
     252    graphic->dywin = graphic->dy;
     253    return TRUE;
     254# endif
    247255
    248256    // the boundary for a single section should probably be adjusted depending on the
  • trunk/Ohana/src/kapa2/src/bDrawIt.c

    r32695 r33650  
    1212
    1313  black = KapaColorByName ("black");
    14 
    15   // SectionMinBoundary (graphic);
    1614
    1715  // if we want to trim, we'll need to carry about the start in graphic coords and
  • trunk/Ohana/src/libkapa/src/bDrawFuncs.c

    r31663 r33650  
    11# include <kapa_internal.h>
    2 # define myAssert(LOGIC,MSG) { if (!(LOGIC)) { fprintf (stderr, "%s\n", MSG); abort (); } }
    32
    43// move these to the bDrawBuffer type
Note: See TracChangeset for help on using the changeset viewer.