- 
          
 - 
                Notifications
    
You must be signed in to change notification settings  - Fork 99
 
Gif timeserie #102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
          
     Open
      
      
            jlarouche
  wants to merge
  8
  commits into
  MapServer:main
  
    
      
        
          
  
    
      Choose a base branch
      
     
    
      
        
      
      
        
          
          
        
        
          
            
              
              
              
  
           
        
        
          
            
              
              
           
        
       
     
  
        
          
            
          
            
          
        
       
    
      
from
jlarouche:gif-timeserie
  
      
      
   
  
    
  
  
  
 
  
      
    base: main
Could not load branches
            
              
  
    Branch not found: {{ refName }}
  
            
                
      Loading
              
            Could not load tags
            
            
              Nothing to show
            
              
  
            
                
      Loading
              
            Are you sure you want to change the base?
            Some commits from the old base branch may be removed from the timeline,
            and old review comments may become outdated.
          
          
  
     Open
                    Gif timeserie #102
Changes from all commits
      Commits
    
    
            Show all changes
          
          
            8 commits
          
        
        Select commit
          Hold shift + click to select a range
      
      3dcf36a
              
                Initial revision of gif animation
              
              
                juliensam bc3498f
              
                Refactored GIF support.
              
              
                jlarouche 5632368
              
                Removed animate getmap strategy
              
              
                jlarouche 9ade352
              
                remove check for Animate Strategy
              
              
                jlarouche 550c338
              
                Cleaned comments
              
              
                jlarouche b30ae03
              
                Modified assemble_map function to work with animate and non-animated …
              
              
                jlarouche 7a634b1
              
                Quick fix for non-time request
              
              
                jlarouche 60ac094
              
                Removed all pam/quantize function from imageio_png and moved them in …
              
              
                jlarouche File filter
Filter by extension
Conversations
          Failed to load comments.   
        
        
          
      Loading
        
  Jump to
        
          Jump to file
        
      
      
          Failed to load files.   
        
        
          
      Loading
        
  Diff view
Diff view
There are no files selected for viewing
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              | Original file line number | Diff line number | Diff line change | 
|---|---|---|
| @@ -0,0 +1,165 @@ | ||
| /****************************************************************************** | ||
| * $Id$ | ||
| * | ||
| * Project: MapServer | ||
| * Purpose: MapCache tile caching support file: PNG format | ||
| * Author: Thomas Bonfort and the MapServer team. | ||
| * | ||
| ****************************************************************************** | ||
| * Copyright (c) 1996-2011 Regents of the University of Minnesota. | ||
| * | ||
| * Permission is hereby granted, free of charge, to any person obtaining a | ||
| * copy of this software and associated documentation files (the "Software"), | ||
| * to deal in the Software without restriction, including without limitation | ||
| * the rights to use, copy, modify, merge, publish, distribute, sublicense, | ||
| * and/or sell copies of the Software, and to permit persons to whom the | ||
| * Software is furnished to do so, subject to the following conditions: | ||
| * | ||
| * The above copyright notice and this permission notice shall be included in | ||
| * all copies of this Software or works derived from this Software. | ||
| * | ||
| * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS | ||
| * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, | ||
| * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL | ||
| * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER | ||
| * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING | ||
| * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER | ||
| * DEALINGS IN THE SOFTWARE. | ||
| *****************************************************************************/ | ||
| 
     | 
||
| #include "mapcache.h" | ||
| 
     | 
||
| int _mapcache_imageio_quantize_image(mapcache_image *rb, | ||
| unsigned int *reqcolors, rgbaPixel *palette, | ||
| unsigned int *maxval, | ||
| rgbaPixel *forced_palette, int num_forced_palette_entries); | ||
| int _mapcache_imageio_classify(mapcache_image *rb, unsigned char *pixels, | ||
| rgbaPixel *palette, int numPaletteEntries); | ||
| 
     | 
||
| /** \cond DONOTDOCUMENT */ | ||
| 
     | 
||
| /* | ||
| * derivations from pngquant and ppmquant | ||
| * | ||
| ** pngquant.c - quantize the colors in an alphamap down to a specified number | ||
| ** | ||
| ** Copyright (C) 1989, 1991 by Jef Poskanzer. | ||
| ** Copyright (C) 1997, 2000, 2002 by Greg Roelofs; based on an idea by | ||
| ** Stefan Schneider. | ||
| ** | ||
| ** Permission to use, copy, modify, and distribute this software and its | ||
| ** documentation for any purpose and without fee is hereby granted, provided | ||
| ** that the above copyright notice appear in all copies and that both that | ||
| ** copyright notice and this permission notice appear in supporting | ||
| ** documentation. This software is provided "as is" without express or | ||
| ** implied warranty. | ||
| */ | ||
| /* | ||
| typedef struct { | ||
| unsigned char b,g,r,a; | ||
| } rgbaPixel; | ||
| 
     | 
||
| typedef struct { | ||
| unsigned char r,g,b; | ||
| } rgbPixel; | ||
| */ | ||
| 
     | 
||
| 
     | 
||
| #define PAM_GETR(p) ((p).r) | ||
| #define PAM_GETG(p) ((p).g) | ||
| #define PAM_GETB(p) ((p).b) | ||
| #define PAM_GETA(p) ((p).a) | ||
| #define PAM_ASSIGN(p,red,grn,blu,alf) \ | ||
| do { (p).r = (red); (p).g = (grn); (p).b = (blu); (p).a = (alf); } while (0) | ||
| #define PAM_EQUAL(p,q) \ | ||
| ((p).r == (q).r && (p).g == (q).g && (p).b == (q).b && (p).a == (q).a) | ||
| #define PAM_DEPTH(newp,p,oldmaxval,newmaxval) \ | ||
| PAM_ASSIGN( (newp), \ | ||
| ( (int) PAM_GETR(p) * (newmaxval) + (oldmaxval) / 2 ) / (oldmaxval), \ | ||
| ( (int) PAM_GETG(p) * (newmaxval) + (oldmaxval) / 2 ) / (oldmaxval), \ | ||
| ( (int) PAM_GETB(p) * (newmaxval) + (oldmaxval) / 2 ) / (oldmaxval), \ | ||
| ( (int) PAM_GETA(p) * (newmaxval) + (oldmaxval) / 2 ) / (oldmaxval) ) | ||
| 
     | 
||
| 
     | 
||
| /* from pamcmap.h */ | ||
| 
     | 
||
| typedef struct acolorhist_item *acolorhist_vector; | ||
| struct acolorhist_item { | ||
| rgbaPixel acolor; | ||
| int value; | ||
| }; | ||
| 
     | 
||
| typedef struct acolorhist_list_item *acolorhist_list; | ||
| struct acolorhist_list_item { | ||
| struct acolorhist_item ch; | ||
| acolorhist_list next; | ||
| }; | ||
| 
     | 
||
| typedef acolorhist_list *acolorhash_table; | ||
| 
     | 
||
| #define MAXCOLORS 32767 | ||
| 
     | 
||
| #define LARGE_NORM | ||
| #define REP_AVERAGE_PIXELS | ||
| 
     | 
||
| typedef struct box *box_vector; | ||
| struct box { | ||
| int ind; | ||
| int colors; | ||
| int sum; | ||
| }; | ||
| 
     | 
||
| acolorhist_vector mediancut(acolorhist_vector achv, int colors, int sum, unsigned char maxval, int newcolors); | ||
| int redcompare (const void *ch1, const void *ch2); | ||
| int greencompare (const void *ch1, const void *ch2); | ||
| int bluecompare (const void *ch1, const void *ch2); | ||
| int alphacompare (const void *ch1, const void *ch2); | ||
| int sumcompare (const void *b1, const void *b2); | ||
| 
     | 
||
| acolorhist_vector pam_acolorhashtoacolorhist | ||
| (acolorhash_table acht, int maxacolors); | ||
| acolorhist_vector pam_computeacolorhist | ||
| (rgbaPixel **apixels, int cols, int rows, int maxacolors, int* acolorsP); | ||
| acolorhash_table pam_computeacolorhash | ||
| (rgbaPixel** apixels, int cols, int rows, int maxacolors, int* acolorsP); | ||
| acolorhash_table pam_allocacolorhash (void); | ||
| int pam_addtoacolorhash | ||
| (acolorhash_table acht, rgbaPixel *acolorP, int value); | ||
| int pam_lookupacolor (acolorhash_table acht, rgbaPixel* acolorP); | ||
| void pam_freeacolorhist (acolorhist_vector achv); | ||
| void pam_freeacolorhash (acolorhash_table acht); | ||
| 
     | 
||
| 
     | 
||
| 
     | 
||
| /*===========================================================================*/ | ||
| 
     | 
||
| 
     | 
||
| /* libpam3.c - pam (portable alpha map) utility library part 3 | ||
| ** | ||
| ** Colormap routines. | ||
| ** | ||
| ** Copyright (C) 1989, 1991 by Jef Poskanzer. | ||
| ** Copyright (C) 1997 by Greg Roelofs. | ||
| ** | ||
| ** Permission to use, copy, modify, and distribute this software and its | ||
| ** documentation for any purpose and without fee is hereby granted, provided | ||
| ** that the above copyright notice appear in all copies and that both that | ||
| ** copyright notice and this permission notice appear in supporting | ||
| ** documentation. This software is provided "as is" without express or | ||
| ** implied warranty. | ||
| */ | ||
| 
     | 
||
| /* | ||
| #include "pam.h" | ||
| #include "pamcmap.h" | ||
| */ | ||
| 
     | 
||
| #define HASH_SIZE 20023 | ||
| 
     | 
||
| #define pam_hashapixel(p) ( ( ( (long) PAM_GETR(p) * 33023 + \ | ||
| (long) PAM_GETG(p) * 30013 + \ | ||
| (long) PAM_GETB(p) * 27011 + \ | ||
| (long) PAM_GETA(p) * 24007 ) \ | ||
| & 0x7fffffff ) % HASH_SIZE ) | ||
| 
     | 
||
| /** \endcond DONOTDOCUMENT */ | 
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
              
      
      Oops, something went wrong.
        
    
  
  Add this suggestion to a batch that can be applied as a single commit.
  This suggestion is invalid because no changes were made to the code.
  Suggestions cannot be applied while the pull request is closed.
  Suggestions cannot be applied while viewing a subset of changes.
  Only one suggestion per line can be applied in a batch.
  Add this suggestion to a batch that can be applied as a single commit.
  Applying suggestions on deleted lines is not supported.
  You must change the existing code in this line in order to create a valid suggestion.
  Outdated suggestions cannot be applied.
  This suggestion has been applied or marked resolved.
  Suggestions cannot be applied from pending reviews.
  Suggestions cannot be applied on multi-line comments.
  Suggestions cannot be applied while the pull request is queued to merge.
  Suggestion cannot be applied right now. Please check back later.
  
    
  
    
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why do these private functions need to be exposed in the main header? I'd rather you created a specific file if you need to use quantization from multiple places