Register
Login
Resources
Docs Blog Datasets Glossary Case Studies Tutorials & Webinars
Product
Data Engine LLMs Platform Enterprise
Pricing Explore
Connect to our Discord channel

gmt_make_pattern_include.sh 1.9 KB

You have to be logged in to leave a comment. Sign In
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
  1. #!/usr/bin/env bash
  2. #
  3. # Copyright (c) 2012-2021 by the GMT Team (https://www.generic-mapping-tools.org/team.html)
  4. # See LICENSE.TXT file for copying and redistribution conditions.
  5. #
  6. # This script just makes the include file PSL_patterns.h
  7. # used by postscriptlight.c. We only ran this once but save for
  8. # posterity in case we need to do something similar. To avoid
  9. # it being run I have added the next two lines
  10. echo "gmt_make_pattern_include.sh.sh - Generate PSL_patterns.h"
  11. echo "Not use, exiting here"
  12. exit
  13. #
  14. COPY_YEAR=$(date +%Y)
  15. cat << EOF > PSL_patterns.h
  16. /*--------------------------------------------------------------------
  17. *
  18. * Copyright (c) 2009-$COPY_YEAR by the GMT Team (https://www.generic-mapping-tools.org/team.html)
  19. *
  20. * This program is free software; you can redistribute it and/or modify
  21. * it under the terms of the GNU Lesser General Public License as published by
  22. * the Free Software Foundation; version 3 or any later version.
  23. *
  24. * This program is distributed in the hope that it will be useful,
  25. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  26. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  27. * GNU Lesser General Public License for more details.
  28. *
  29. *--------------------------------------------------------------------*/
  30. /* The 90 former Sun rasterfile patterns are now stored here as static char arrays.
  31. * They are all 64x64 1-bit patterns, so need 64*64/8 = 512 bytes each.
  32. */
  33. static unsigned char PSL_pattern[90][512] = {
  34. EOF
  35. let k=1
  36. while [ $k -le 90 ]; do
  37. name=$(echo $k | awk '{printf "PSL_pattern_%2.2d.ras\n", $1}')
  38. printf "\t{\t/* $name */\n" >> PSL_patterns.h
  39. od -j32 -t uC -v -An $name | sed '/^$/d' | awk '{printf "\t\t%3d", $1}; {for (i=2; i<=NF;i++) printf ", %3d", $i}; {printf ",\n"}' >> PSL_patterns.h
  40. printf "\t},\n" >> PSL_patterns.h
  41. let k=k+1
  42. done
  43. printf "};\n" >> PSL_patterns.h
Tip!

Press p or to see the previous file or, n or to see the next file

Comments

Loading...