├── AUTHORS ├── COPYING ├── ChangeLog ├── INSTALL ├── Makefile.am ├── NEWS ├── README ├── README.md ├── autogen.sh ├── blitzwave-config.in ├── blitzwave.pc.in ├── configure.ac ├── doc ├── Doxyfile.in ├── Makefile.am ├── examples │ ├── array-slowdown.cxx │ ├── simpleDecompose.cxx │ └── simpleDecompose.h ├── index.xhtml └── packagedoc.css ├── m4 ├── cxx-project-deps.m4 └── cxx-project-init.m4 └── src ├── Makefile.am ├── Wavelet-test.cxx ├── Wavelet.cxx ├── Wavelet.h ├── WaveletDecomp-test.cxx ├── WaveletDecomp.cxx ├── WaveletDecomp.h ├── arrayTools-test.cxx ├── arrayTools.cxx ├── arrayTools.h └── testimage.pnm /AUTHORS: -------------------------------------------------------------------------------- 1 | Oliver Schulz 2 | -------------------------------------------------------------------------------- /COPYING: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc. 5 | 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Library General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | 294 | Copyright (C) 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License 307 | along with this program; if not, write to the Free Software 308 | Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 309 | 310 | 311 | Also add information on how to contact you by electronic and paper mail. 312 | 313 | If the program is interactive, make it output a short notice like this 314 | when it starts in an interactive mode: 315 | 316 | Gnomovision version 69, Copyright (C) year name of author 317 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 318 | This is free software, and you are welcome to redistribute it 319 | under certain conditions; type `show c' for details. 320 | 321 | The hypothetical commands `show w' and `show c' should show the appropriate 322 | parts of the General Public License. Of course, the commands you use may 323 | be called something other than `show w' and `show c'; they could even be 324 | mouse-clicks or menu items--whatever suits your program. 325 | 326 | You should also get your employer (if you work as a programmer) or your 327 | school, if any, to sign a "copyright disclaimer" for the program, if 328 | necessary. Here is a sample; alter the names: 329 | 330 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 331 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 332 | 333 | , 1 April 1989 334 | Ty Coon, President of Vice 335 | 336 | This General Public License does not permit incorporating your program into 337 | proprietary programs. If your program is a subroutine library, you may 338 | consider it more useful to permit linking proprietary applications with the 339 | library. If this is what you want to do, use the GNU Library General 340 | Public License instead of this License. 341 | -------------------------------------------------------------------------------- /ChangeLog: -------------------------------------------------------------------------------- 1 | See docs/index.html. 2 | -------------------------------------------------------------------------------- /INSTALL: -------------------------------------------------------------------------------- 1 | Installation Instructions 2 | ************************* 3 | 4 | Copyright (C) 1994, 1995, 1996, 1999, 2000, 2001, 2002, 2004, 2005, 5 | 2006 Free Software Foundation, Inc. 6 | 7 | This file is free documentation; the Free Software Foundation gives 8 | unlimited permission to copy, distribute and modify it. 9 | 10 | Basic Installation 11 | ================== 12 | 13 | Briefly, the shell commands `./configure; make; make install' should 14 | configure, build, and install this package. The following 15 | more-detailed instructions are generic; see the `README' file for 16 | instructions specific to this package. 17 | 18 | The `configure' shell script attempts to guess correct values for 19 | various system-dependent variables used during compilation. It uses 20 | those values to create a `Makefile' in each directory of the package. 21 | It may also create one or more `.h' files containing system-dependent 22 | definitions. Finally, it creates a shell script `config.status' that 23 | you can run in the future to recreate the current configuration, and a 24 | file `config.log' containing compiler output (useful mainly for 25 | debugging `configure'). 26 | 27 | It can also use an optional file (typically called `config.cache' 28 | and enabled with `--cache-file=config.cache' or simply `-C') that saves 29 | the results of its tests to speed up reconfiguring. Caching is 30 | disabled by default to prevent problems with accidental use of stale 31 | cache files. 32 | 33 | If you need to do unusual things to compile the package, please try 34 | to figure out how `configure' could check whether to do them, and mail 35 | diffs or instructions to the address given in the `README' so they can 36 | be considered for the next release. If you are using the cache, and at 37 | some point `config.cache' contains results you don't want to keep, you 38 | may remove or edit it. 39 | 40 | The file `configure.ac' (or `configure.in') is used to create 41 | `configure' by a program called `autoconf'. You need `configure.ac' if 42 | you want to change it or regenerate `configure' using a newer version 43 | of `autoconf'. 44 | 45 | The simplest way to compile this package is: 46 | 47 | 1. `cd' to the directory containing the package's source code and type 48 | `./configure' to configure the package for your system. 49 | 50 | Running `configure' might take a while. While running, it prints 51 | some messages telling which features it is checking for. 52 | 53 | 2. Type `make' to compile the package. 54 | 55 | 3. Optionally, type `make check' to run any self-tests that come with 56 | the package. 57 | 58 | 4. Type `make install' to install the programs and any data files and 59 | documentation. 60 | 61 | 5. You can remove the program binaries and object files from the 62 | source code directory by typing `make clean'. To also remove the 63 | files that `configure' created (so you can compile the package for 64 | a different kind of computer), type `make distclean'. There is 65 | also a `make maintainer-clean' target, but that is intended mainly 66 | for the package's developers. If you use it, you may have to get 67 | all sorts of other programs in order to regenerate files that came 68 | with the distribution. 69 | 70 | Compilers and Options 71 | ===================== 72 | 73 | Some systems require unusual options for compilation or linking that the 74 | `configure' script does not know about. Run `./configure --help' for 75 | details on some of the pertinent environment variables. 76 | 77 | You can give `configure' initial values for configuration parameters 78 | by setting variables in the command line or in the environment. Here 79 | is an example: 80 | 81 | ./configure CC=c99 CFLAGS=-g LIBS=-lposix 82 | 83 | *Note Defining Variables::, for more details. 84 | 85 | Compiling For Multiple Architectures 86 | ==================================== 87 | 88 | You can compile the package for more than one kind of computer at the 89 | same time, by placing the object files for each architecture in their 90 | own directory. To do this, you can use GNU `make'. `cd' to the 91 | directory where you want the object files and executables to go and run 92 | the `configure' script. `configure' automatically checks for the 93 | source code in the directory that `configure' is in and in `..'. 94 | 95 | With a non-GNU `make', it is safer to compile the package for one 96 | architecture at a time in the source code directory. After you have 97 | installed the package for one architecture, use `make distclean' before 98 | reconfiguring for another architecture. 99 | 100 | Installation Names 101 | ================== 102 | 103 | By default, `make install' installs the package's commands under 104 | `/usr/local/bin', include files under `/usr/local/include', etc. You 105 | can specify an installation prefix other than `/usr/local' by giving 106 | `configure' the option `--prefix=PREFIX'. 107 | 108 | You can specify separate installation prefixes for 109 | architecture-specific files and architecture-independent files. If you 110 | pass the option `--exec-prefix=PREFIX' to `configure', the package uses 111 | PREFIX as the prefix for installing programs and libraries. 112 | Documentation and other data files still use the regular prefix. 113 | 114 | In addition, if you use an unusual directory layout you can give 115 | options like `--bindir=DIR' to specify different values for particular 116 | kinds of files. Run `configure --help' for a list of the directories 117 | you can set and what kinds of files go in them. 118 | 119 | If the package supports it, you can cause programs to be installed 120 | with an extra prefix or suffix on their names by giving `configure' the 121 | option `--program-prefix=PREFIX' or `--program-suffix=SUFFIX'. 122 | 123 | Optional Features 124 | ================= 125 | 126 | Some packages pay attention to `--enable-FEATURE' options to 127 | `configure', where FEATURE indicates an optional part of the package. 128 | They may also pay attention to `--with-PACKAGE' options, where PACKAGE 129 | is something like `gnu-as' or `x' (for the X Window System). The 130 | `README' should mention any `--enable-' and `--with-' options that the 131 | package recognizes. 132 | 133 | For packages that use the X Window System, `configure' can usually 134 | find the X include and library files automatically, but if it doesn't, 135 | you can use the `configure' options `--x-includes=DIR' and 136 | `--x-libraries=DIR' to specify their locations. 137 | 138 | Specifying the System Type 139 | ========================== 140 | 141 | There may be some features `configure' cannot figure out automatically, 142 | but needs to determine by the type of machine the package will run on. 143 | Usually, assuming the package is built to be run on the _same_ 144 | architectures, `configure' can figure that out, but if it prints a 145 | message saying it cannot guess the machine type, give it the 146 | `--build=TYPE' option. TYPE can either be a short name for the system 147 | type, such as `sun4', or a canonical name which has the form: 148 | 149 | CPU-COMPANY-SYSTEM 150 | 151 | where SYSTEM can have one of these forms: 152 | 153 | OS KERNEL-OS 154 | 155 | See the file `config.sub' for the possible values of each field. If 156 | `config.sub' isn't included in this package, then this package doesn't 157 | need to know the machine type. 158 | 159 | If you are _building_ compiler tools for cross-compiling, you should 160 | use the option `--target=TYPE' to select the type of system they will 161 | produce code for. 162 | 163 | If you want to _use_ a cross compiler, that generates code for a 164 | platform different from the build platform, you should specify the 165 | "host" platform (i.e., that on which the generated programs will 166 | eventually be run) with `--host=TYPE'. 167 | 168 | Sharing Defaults 169 | ================ 170 | 171 | If you want to set default values for `configure' scripts to share, you 172 | can create a site shell script called `config.site' that gives default 173 | values for variables like `CC', `cache_file', and `prefix'. 174 | `configure' looks for `PREFIX/share/config.site' if it exists, then 175 | `PREFIX/etc/config.site' if it exists. Or, you can set the 176 | `CONFIG_SITE' environment variable to the location of the site script. 177 | A warning: not all `configure' scripts look for a site script. 178 | 179 | Defining Variables 180 | ================== 181 | 182 | Variables not defined in a site shell script can be set in the 183 | environment passed to `configure'. However, some packages may run 184 | configure again during the build, and the customized values of these 185 | variables may be lost. In order to avoid this problem, you should set 186 | them in the `configure' command line, using `VAR=value'. For example: 187 | 188 | ./configure CC=/usr/local2/bin/gcc 189 | 190 | causes the specified `gcc' to be used as the C compiler (unless it is 191 | overridden in the site shell script). 192 | 193 | Unfortunately, this technique does not work for `CONFIG_SHELL' due to 194 | an Autoconf bug. Until the bug is fixed you can use this workaround: 195 | 196 | CONFIG_SHELL=/bin/bash /bin/bash ./configure CONFIG_SHELL=/bin/bash 197 | 198 | `configure' Invocation 199 | ====================== 200 | 201 | `configure' recognizes the following options to control how it operates. 202 | 203 | `--help' 204 | `-h' 205 | Print a summary of the options to `configure', and exit. 206 | 207 | `--version' 208 | `-V' 209 | Print the version of Autoconf used to generate the `configure' 210 | script, and exit. 211 | 212 | `--cache-file=FILE' 213 | Enable the cache: use and save the results of the tests in FILE, 214 | traditionally `config.cache'. FILE defaults to `/dev/null' to 215 | disable caching. 216 | 217 | `--config-cache' 218 | `-C' 219 | Alias for `--cache-file=config.cache'. 220 | 221 | `--quiet' 222 | `--silent' 223 | `-q' 224 | Do not print messages saying which checks are being made. To 225 | suppress all normal output, redirect it to `/dev/null' (any error 226 | messages will still be shown). 227 | 228 | `--srcdir=DIR' 229 | Look for the package's source code in directory DIR. Usually 230 | `configure' can determine that directory automatically. 231 | 232 | `configure' also accepts some other, not widely useful, options. Run 233 | `configure --help' for more details. 234 | 235 | -------------------------------------------------------------------------------- /Makefile.am: -------------------------------------------------------------------------------- 1 | AUTOMAKE_OPTIONS = foreign 2 | ACLOCAL_AMFLAGS = -I m4 3 | 4 | MAINTAINERCLEANFILES = Makefile.in \ 5 | aclocal.m4 ar-lib config.guess config.h.in config.h.in~ config.sub \ 6 | configure depcomp install-sh ltmain.sh missing \ 7 | m4/libtool.m4 m4/lt~obsolete.m4 m4/ltoptions.m4 m4/ltsugar.m4 \ 8 | m4/ltversion.m4 9 | 10 | EXTRA_DIST = autogen.sh 11 | 12 | SUBDIRS = src doc 13 | 14 | dist_doc_DATA = README.md COPYING AUTHORS ChangeLog INSTALL NEWS 15 | dist_bin_SCRIPTS = blitzwave-config 16 | 17 | if COND_PKGCONFIG 18 | pkgconfigdir = $(libdir)/pkgconfig 19 | pkgconfig_DATA = blitzwave.pc 20 | endif 21 | -------------------------------------------------------------------------------- /NEWS: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/oschulz/blitzwave/b5e0752f75d1661c13621e2288bb99cc72f99c4c/NEWS -------------------------------------------------------------------------------- /README: -------------------------------------------------------------------------------- 1 | Please see README.md 2 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | blitzwave C++ Wavelet Library 2 | ============================= 3 | 4 | Please see the [project homepage](http://oschulz.github.com/blitzwave/) for 5 | documentation. The documentation is also included in the blitzwave package 6 | sources. 7 | 8 | ## Overview 9 | 10 | blitzwave is a c++ wavelet mini-library building on the 11 | [blitz++](http://blitz.sourceforge.net/) array template library. 12 | blitzwave is heavily templated and supports wavelet decompositions of 13 | n-dimensional arrays of various numerical data types. 14 | You can define and use your own wavelets, a number of pre-defined, 15 | ready-to-use wavelets are available. 16 | 17 | Performance is quite good, similar to the 18 | [WAILI](http://nalag.cs.kuleuven.be/research/software/wavelets/) library 19 | (using datatype int for blitzwave). 20 | 21 | 22 | ## Status 23 | 24 | blitzwave is stable and produces mathematically correct results. It 25 | has been used in production for several different scientific projects 26 | (that I know of). The API may still be subject to minor changes. 27 | -------------------------------------------------------------------------------- /autogen.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | autoreconf --install 4 | -------------------------------------------------------------------------------- /blitzwave-config.in: -------------------------------------------------------------------------------- 1 | #! /bin/sh 2 | 3 | 4 | # --------------------------------------------------------------------- 5 | # This file contains some code from clhep-config and xft-config, 6 | # copyright under GPL, resp. quasi-BSD, license by the authors of the 7 | # clhep and xft projects. 8 | # --------------------------------------------------------------------- 9 | 10 | 11 | package="@PACKAGE_TARNAME@" 12 | version="@PACKAGE_VERSION@" 13 | 14 | 15 | # --------------------------------------------------------------------- 16 | # From clhep-config: 17 | 18 | # use the full name of this script to get the current path 19 | configpath=`dirname ${0}` 20 | # check for a leading slash to determine if this is a relative path 21 | firstc=`expr "${configpath}" : "^\/"` 22 | calldir=`pwd` 23 | if [ ${firstc} -eq 0 ] 24 | then 25 | cd ${calldir}/${configpath}; newpath=`pwd` 26 | binpath=${newpath} 27 | else 28 | binpath=${configpath} 29 | fi 30 | 31 | # --------------------------------------------------------------------- 32 | 33 | prefix="@prefix@" 34 | exec_prefix="@exec_prefix@" 35 | bindir="@bindir@" 36 | 37 | if [ "${bindir}" != "${binpath}" ] ; then 38 | # package has been relocated from original install path 39 | prefix=`dirname ${binpath}` 40 | exec_prefix="${prefix}" 41 | bindir="${binpath}" 42 | fi 43 | 44 | libdir="@libdir@" 45 | includedir="@includedir@" 46 | 47 | # --------------------------------------------------------------------- 48 | 49 | 50 | usage() 51 | { 52 | cat <&2 65 | fi 66 | 67 | 68 | while test $# -gt 0 ; do 69 | case "$1" in 70 | -*=*) optarg=`echo "$1" | sed 's/[-_a-zA-Z0-9]*=//'` ;; 71 | *) optarg= ;; 72 | esac 73 | 74 | case $1 in 75 | --help) 76 | usage 0 77 | ;; 78 | --prefix) 79 | echo_prefix=yes 80 | ;; 81 | --version) 82 | echo $version 83 | exit 0 84 | ;; 85 | --cflags) 86 | echo_cflags=yes 87 | ;; 88 | --libs) 89 | echo_libs=yes 90 | ;; 91 | *) 92 | usage 1 1>&2 93 | ;; 94 | esac 95 | shift 96 | done 97 | 98 | 99 | libs="-l@PACKAGE_TARNAME@" 100 | 101 | 102 | # --------------------------------------------------------------------- 103 | # From xft-config: 104 | 105 | if test "$echo_prefix" = "yes" ; then 106 | echo $prefix 107 | fi 108 | 109 | if test "$echo_cflags" = "yes" ; then 110 | cflags="-I${includedir}" 111 | echo $cflags 112 | fi 113 | 114 | if test "$echo_libs" = "yes" ; then 115 | if test "${libdir}" != "/usr/lib" ; then 116 | echo -L${libdir} $libs 117 | else 118 | echo $libs 119 | fi 120 | fi 121 | 122 | # --------------------------------------------------------------------- 123 | 124 | 125 | # EOF 126 | -------------------------------------------------------------------------------- /blitzwave.pc.in: -------------------------------------------------------------------------------- 1 | prefix=@prefix@ 2 | exec_prefix=@exec_prefix@ 3 | libdir=@libdir@ 4 | includedir=@includedir@ 5 | 6 | Name: @PACKAGE_TARNAME@ 7 | Version: @VERSION@ 8 | Description: The blitzwave wavelet library. 9 | Requires: @PKGCONFIG_DEPS@ 10 | Libs: -L${libdir} -l@PACKAGE_TARNAME@ @DEP_LIBS@ 11 | Cflags: -I${includedir} @DEP_CFLAGS@ 12 | -------------------------------------------------------------------------------- /configure.ac: -------------------------------------------------------------------------------- 1 | # Initialize: 2 | 3 | AC_INIT([blitzwave], [0.8.0]) 4 | 5 | AC_CONFIG_MACRO_DIR([m4]) 6 | 7 | AM_INIT_AUTOMAKE([-Wall -Werror]) 8 | 9 | 10 | # Libtool init and language selection 11 | 12 | # Workaround for newer vs. older versions of Automake: 13 | m4_ifdef([AM_PROG_AR], [AM_PROG_AR]) 14 | 15 | AC_LIBTOOL_DLOPEN 16 | AC_PROG_LIBTOOL 17 | AC_PROG_CXX 18 | 19 | CXX_PROJECT_INIT 20 | 21 | 22 | # Checks for dependencies 23 | 24 | CXX_PROJECT_DEPS([blitz]) 25 | 26 | 27 | 28 | # Output 29 | 30 | AC_CONFIG_HEADERS([config.h]) 31 | 32 | AC_CONFIG_FILES([ 33 | Makefile 34 | blitzwave.pc 35 | blitzwave-config 36 | src/Makefile 37 | doc/Makefile doc/Doxyfile 38 | ]) 39 | 40 | AC_OUTPUT 41 | -------------------------------------------------------------------------------- /doc/Doxyfile.in: -------------------------------------------------------------------------------- 1 | # Doxyfile 1.5.3 2 | 3 | # This file describes the settings to be used by the documentation system 4 | # doxygen (www.doxygen.org) for a project 5 | # 6 | # All text after a hash (#) is considered a comment and will be ignored 7 | # The format is: 8 | # TAG = value [value, ...] 9 | # For lists items can also be appended using: 10 | # TAG += value [value, ...] 11 | # Values that contain spaces should be placed between quotes (" ") 12 | 13 | #--------------------------------------------------------------------------- 14 | # Project related configuration options 15 | #--------------------------------------------------------------------------- 16 | 17 | # This tag specifies the encoding used for all characters in the config file that 18 | # follow. The default is UTF-8 which is also the encoding used for all text before 19 | # the first occurrence of this tag. Doxygen uses libiconv (or the iconv built into 20 | # libc) for the transcoding. See http://www.gnu.org/software/libiconv for the list of 21 | # possible encodings. 22 | 23 | DOXYFILE_ENCODING = UTF-8 24 | 25 | # The PROJECT_NAME tag is a single word (or a sequence of words surrounded 26 | # by quotes) that should identify the project. 27 | 28 | PROJECT_NAME = 29 | 30 | # The PROJECT_NUMBER tag can be used to enter a project or revision number. 31 | # This could be handy for archiving the generated documentation or 32 | # if some version control system is used. 33 | 34 | PROJECT_NUMBER = 35 | 36 | # The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute) 37 | # base path where the generated documentation will be put. 38 | # If a relative path is entered, it will be relative to the location 39 | # where doxygen was started. If left blank the current directory will be used. 40 | 41 | OUTPUT_DIRECTORY = 42 | 43 | # If the CREATE_SUBDIRS tag is set to YES, then doxygen will create 44 | # 4096 sub-directories (in 2 levels) under the output directory of each output 45 | # format and will distribute the generated files over these directories. 46 | # Enabling this option can be useful when feeding doxygen a huge amount of 47 | # source files, where putting all generated files in the same directory would 48 | # otherwise cause performance problems for the file system. 49 | 50 | CREATE_SUBDIRS = NO 51 | 52 | # The OUTPUT_LANGUAGE tag is used to specify the language in which all 53 | # documentation generated by doxygen is written. Doxygen will use this 54 | # information to generate all constant output in the proper language. 55 | # The default language is English, other supported languages are: 56 | # Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional, 57 | # Croatian, Czech, Danish, Dutch, Finnish, French, German, Greek, Hungarian, 58 | # Italian, Japanese, Japanese-en (Japanese with English messages), Korean, 59 | # Korean-en, Lithuanian, Norwegian, Polish, Portuguese, Romanian, Russian, 60 | # Serbian, Slovak, Slovene, Spanish, Swedish, and Ukrainian. 61 | 62 | OUTPUT_LANGUAGE = English 63 | 64 | # If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will 65 | # include brief member descriptions after the members that are listed in 66 | # the file and class documentation (similar to JavaDoc). 67 | # Set to NO to disable this. 68 | 69 | BRIEF_MEMBER_DESC = YES 70 | 71 | # If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend 72 | # the brief description of a member or function before the detailed description. 73 | # Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the 74 | # brief descriptions will be completely suppressed. 75 | 76 | REPEAT_BRIEF = YES 77 | 78 | # This tag implements a quasi-intelligent brief description abbreviator 79 | # that is used to form the text in various listings. Each string 80 | # in this list, if found as the leading text of the brief description, will be 81 | # stripped from the text and the result after processing the whole list, is 82 | # used as the annotated text. Otherwise, the brief description is used as-is. 83 | # If left blank, the following values are used ("$name" is automatically 84 | # replaced with the name of the entity): "The $name class" "The $name widget" 85 | # "The $name file" "is" "provides" "specifies" "contains" 86 | # "represents" "a" "an" "the" 87 | 88 | ABBREVIATE_BRIEF = 89 | 90 | # If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then 91 | # Doxygen will generate a detailed section even if there is only a brief 92 | # description. 93 | 94 | ALWAYS_DETAILED_SEC = NO 95 | 96 | # If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all 97 | # inherited members of a class in the documentation of that class as if those 98 | # members were ordinary class members. Constructors, destructors and assignment 99 | # operators of the base classes will not be shown. 100 | 101 | INLINE_INHERITED_MEMB = NO 102 | 103 | # If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full 104 | # path before files name in the file list and in the header files. If set 105 | # to NO the shortest path that makes the file name unique will be used. 106 | 107 | FULL_PATH_NAMES = YES 108 | 109 | # If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag 110 | # can be used to strip a user-defined part of the path. Stripping is 111 | # only done if one of the specified strings matches the left-hand part of 112 | # the path. The tag can be used to show relative paths in the file list. 113 | # If left blank the directory from which doxygen is run is used as the 114 | # path to strip. 115 | 116 | STRIP_FROM_PATH = 117 | 118 | # The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of 119 | # the path mentioned in the documentation of a class, which tells 120 | # the reader which header file to include in order to use a class. 121 | # If left blank only the name of the header file containing the class 122 | # definition is used. Otherwise one should specify the include paths that 123 | # are normally passed to the compiler using the -I flag. 124 | 125 | STRIP_FROM_INC_PATH = 126 | 127 | # If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter 128 | # (but less readable) file names. This can be useful is your file systems 129 | # doesn't support long names like on DOS, Mac, or CD-ROM. 130 | 131 | SHORT_NAMES = NO 132 | 133 | # If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen 134 | # will interpret the first line (until the first dot) of a JavaDoc-style 135 | # comment as the brief description. If set to NO, the JavaDoc 136 | # comments will behave just like regular Qt-style comments 137 | # (thus requiring an explicit @brief command for a brief description.) 138 | 139 | JAVADOC_AUTOBRIEF = NO 140 | 141 | # If the QT_AUTOBRIEF tag is set to YES then Doxygen will 142 | # interpret the first line (until the first dot) of a Qt-style 143 | # comment as the brief description. If set to NO, the comments 144 | # will behave just like regular Qt-style comments (thus requiring 145 | # an explicit \brief command for a brief description.) 146 | 147 | QT_AUTOBRIEF = NO 148 | 149 | # The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen 150 | # treat a multi-line C++ special comment block (i.e. a block of //! or /// 151 | # comments) as a brief description. This used to be the default behaviour. 152 | # The new default is to treat a multi-line C++ comment block as a detailed 153 | # description. Set this tag to YES if you prefer the old behaviour instead. 154 | 155 | MULTILINE_CPP_IS_BRIEF = NO 156 | 157 | # If the DETAILS_AT_TOP tag is set to YES then Doxygen 158 | # will output the detailed description near the top, like JavaDoc. 159 | # If set to NO, the detailed description appears after the member 160 | # documentation. 161 | 162 | DETAILS_AT_TOP = NO 163 | 164 | # If the INHERIT_DOCS tag is set to YES (the default) then an undocumented 165 | # member inherits the documentation from any documented member that it 166 | # re-implements. 167 | 168 | INHERIT_DOCS = YES 169 | 170 | # If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce 171 | # a new page for each member. If set to NO, the documentation of a member will 172 | # be part of the file/class/namespace that contains it. 173 | 174 | SEPARATE_MEMBER_PAGES = NO 175 | 176 | # The TAB_SIZE tag can be used to set the number of spaces in a tab. 177 | # Doxygen uses this value to replace tabs by spaces in code fragments. 178 | 179 | TAB_SIZE = 8 180 | 181 | # This tag can be used to specify a number of aliases that acts 182 | # as commands in the documentation. An alias has the form "name=value". 183 | # For example adding "sideeffect=\par Side Effects:\n" will allow you to 184 | # put the command \sideeffect (or @sideeffect) in the documentation, which 185 | # will result in a user-defined paragraph with heading "Side Effects:". 186 | # You can put \n's in the value part of an alias to insert newlines. 187 | 188 | ALIASES = 189 | 190 | # Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C 191 | # sources only. Doxygen will then generate output that is more tailored for C. 192 | # For instance, some of the names that are used will be different. The list 193 | # of all members will be omitted, etc. 194 | 195 | OPTIMIZE_OUTPUT_FOR_C = NO 196 | 197 | # Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java 198 | # sources only. Doxygen will then generate output that is more tailored for Java. 199 | # For instance, namespaces will be presented as packages, qualified scopes 200 | # will look different, etc. 201 | 202 | OPTIMIZE_OUTPUT_JAVA = NO 203 | 204 | # If you use STL classes (i.e. std::string, std::vector, etc.) but do not want to 205 | # include (a tag file for) the STL sources as input, then you should 206 | # set this tag to YES in order to let doxygen match functions declarations and 207 | # definitions whose arguments contain STL classes (e.g. func(std::string); v.s. 208 | # func(std::string) {}). This also make the inheritance and collaboration 209 | # diagrams that involve STL classes more complete and accurate. 210 | 211 | BUILTIN_STL_SUPPORT = NO 212 | 213 | # If you use Microsoft's C++/CLI language, you should set this option to YES to 214 | # enable parsing support. 215 | 216 | CPP_CLI_SUPPORT = NO 217 | 218 | # If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC 219 | # tag is set to YES, then doxygen will reuse the documentation of the first 220 | # member in the group (if any) for the other members of the group. By default 221 | # all members of a group must be documented explicitly. 222 | 223 | DISTRIBUTE_GROUP_DOC = NO 224 | 225 | # Set the SUBGROUPING tag to YES (the default) to allow class member groups of 226 | # the same type (for instance a group of public functions) to be put as a 227 | # subgroup of that type (e.g. under the Public Functions section). Set it to 228 | # NO to prevent subgrouping. Alternatively, this can be done per class using 229 | # the \nosubgrouping command. 230 | 231 | SUBGROUPING = YES 232 | 233 | #--------------------------------------------------------------------------- 234 | # Build related configuration options 235 | #--------------------------------------------------------------------------- 236 | 237 | # If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in 238 | # documentation are documented, even if no documentation was available. 239 | # Private class members and static file members will be hidden unless 240 | # the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES 241 | 242 | EXTRACT_ALL = NO 243 | 244 | # If the EXTRACT_PRIVATE tag is set to YES all private members of a class 245 | # will be included in the documentation. 246 | 247 | EXTRACT_PRIVATE = NO 248 | 249 | # If the EXTRACT_STATIC tag is set to YES all static members of a file 250 | # will be included in the documentation. 251 | 252 | EXTRACT_STATIC = NO 253 | 254 | # If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs) 255 | # defined locally in source files will be included in the documentation. 256 | # If set to NO only classes defined in header files are included. 257 | 258 | EXTRACT_LOCAL_CLASSES = YES 259 | 260 | # This flag is only useful for Objective-C code. When set to YES local 261 | # methods, which are defined in the implementation section but not in 262 | # the interface are included in the documentation. 263 | # If set to NO (the default) only methods in the interface are included. 264 | 265 | EXTRACT_LOCAL_METHODS = NO 266 | 267 | # If this flag is set to YES, the members of anonymous namespaces will be extracted 268 | # and appear in the documentation as a namespace called 'anonymous_namespace{file}', 269 | # where file will be replaced with the base name of the file that contains the anonymous 270 | # namespace. By default anonymous namespace are hidden. 271 | 272 | EXTRACT_ANON_NSPACES = NO 273 | 274 | # If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all 275 | # undocumented members of documented classes, files or namespaces. 276 | # If set to NO (the default) these members will be included in the 277 | # various overviews, but no documentation section is generated. 278 | # This option has no effect if EXTRACT_ALL is enabled. 279 | 280 | HIDE_UNDOC_MEMBERS = NO 281 | 282 | # If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all 283 | # undocumented classes that are normally visible in the class hierarchy. 284 | # If set to NO (the default) these classes will be included in the various 285 | # overviews. This option has no effect if EXTRACT_ALL is enabled. 286 | 287 | HIDE_UNDOC_CLASSES = NO 288 | 289 | # If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all 290 | # friend (class|struct|union) declarations. 291 | # If set to NO (the default) these declarations will be included in the 292 | # documentation. 293 | 294 | HIDE_FRIEND_COMPOUNDS = NO 295 | 296 | # If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any 297 | # documentation blocks found inside the body of a function. 298 | # If set to NO (the default) these blocks will be appended to the 299 | # function's detailed documentation block. 300 | 301 | HIDE_IN_BODY_DOCS = NO 302 | 303 | # The INTERNAL_DOCS tag determines if documentation 304 | # that is typed after a \internal command is included. If the tag is set 305 | # to NO (the default) then the documentation will be excluded. 306 | # Set it to YES to include the internal documentation. 307 | 308 | INTERNAL_DOCS = NO 309 | 310 | # If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate 311 | # file names in lower-case letters. If set to YES upper-case letters are also 312 | # allowed. This is useful if you have classes or files whose names only differ 313 | # in case and if your file system supports case sensitive file names. Windows 314 | # and Mac users are advised to set this option to NO. 315 | 316 | CASE_SENSE_NAMES = YES 317 | 318 | # If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen 319 | # will show members with their full class and namespace scopes in the 320 | # documentation. If set to YES the scope will be hidden. 321 | 322 | HIDE_SCOPE_NAMES = NO 323 | 324 | # If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen 325 | # will put a list of the files that are included by a file in the documentation 326 | # of that file. 327 | 328 | SHOW_INCLUDE_FILES = YES 329 | 330 | # If the INLINE_INFO tag is set to YES (the default) then a tag [inline] 331 | # is inserted in the documentation for inline members. 332 | 333 | INLINE_INFO = YES 334 | 335 | # If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen 336 | # will sort the (detailed) documentation of file and class members 337 | # alphabetically by member name. If set to NO the members will appear in 338 | # declaration order. 339 | 340 | SORT_MEMBER_DOCS = YES 341 | 342 | # If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the 343 | # brief documentation of file, namespace and class members alphabetically 344 | # by member name. If set to NO (the default) the members will appear in 345 | # declaration order. 346 | 347 | SORT_BRIEF_DOCS = NO 348 | 349 | # If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be 350 | # sorted by fully-qualified names, including namespaces. If set to 351 | # NO (the default), the class list will be sorted only by class name, 352 | # not including the namespace part. 353 | # Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES. 354 | # Note: This option applies only to the class list, not to the 355 | # alphabetical list. 356 | 357 | SORT_BY_SCOPE_NAME = NO 358 | 359 | # The GENERATE_TODOLIST tag can be used to enable (YES) or 360 | # disable (NO) the todo list. This list is created by putting \todo 361 | # commands in the documentation. 362 | 363 | GENERATE_TODOLIST = YES 364 | 365 | # The GENERATE_TESTLIST tag can be used to enable (YES) or 366 | # disable (NO) the test list. This list is created by putting \test 367 | # commands in the documentation. 368 | 369 | GENERATE_TESTLIST = YES 370 | 371 | # The GENERATE_BUGLIST tag can be used to enable (YES) or 372 | # disable (NO) the bug list. This list is created by putting \bug 373 | # commands in the documentation. 374 | 375 | GENERATE_BUGLIST = YES 376 | 377 | # The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or 378 | # disable (NO) the deprecated list. This list is created by putting 379 | # \deprecated commands in the documentation. 380 | 381 | GENERATE_DEPRECATEDLIST= YES 382 | 383 | # The ENABLED_SECTIONS tag can be used to enable conditional 384 | # documentation sections, marked by \if sectionname ... \endif. 385 | 386 | ENABLED_SECTIONS = 387 | 388 | # The MAX_INITIALIZER_LINES tag determines the maximum number of lines 389 | # the initial value of a variable or define consists of for it to appear in 390 | # the documentation. If the initializer consists of more lines than specified 391 | # here it will be hidden. Use a value of 0 to hide initializers completely. 392 | # The appearance of the initializer of individual variables and defines in the 393 | # documentation can be controlled using \showinitializer or \hideinitializer 394 | # command in the documentation regardless of this setting. 395 | 396 | MAX_INITIALIZER_LINES = 30 397 | 398 | # Set the SHOW_USED_FILES tag to NO to disable the list of files generated 399 | # at the bottom of the documentation of classes and structs. If set to YES the 400 | # list will mention the files that were used to generate the documentation. 401 | 402 | SHOW_USED_FILES = YES 403 | 404 | # If the sources in your project are distributed over multiple directories 405 | # then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy 406 | # in the documentation. The default is NO. 407 | 408 | SHOW_DIRECTORIES = NO 409 | 410 | # The FILE_VERSION_FILTER tag can be used to specify a program or script that 411 | # doxygen should invoke to get the current version for each file (typically from the 412 | # version control system). Doxygen will invoke the program by executing (via 413 | # popen()) the command , where is the value of 414 | # the FILE_VERSION_FILTER tag, and is the name of an input file 415 | # provided by doxygen. Whatever the program writes to standard output 416 | # is used as the file version. See the manual for examples. 417 | 418 | FILE_VERSION_FILTER = 419 | 420 | #--------------------------------------------------------------------------- 421 | # configuration options related to warning and progress messages 422 | #--------------------------------------------------------------------------- 423 | 424 | # The QUIET tag can be used to turn on/off the messages that are generated 425 | # by doxygen. Possible values are YES and NO. If left blank NO is used. 426 | 427 | QUIET = NO 428 | 429 | # The WARNINGS tag can be used to turn on/off the warning messages that are 430 | # generated by doxygen. Possible values are YES and NO. If left blank 431 | # NO is used. 432 | 433 | WARNINGS = YES 434 | 435 | # If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings 436 | # for undocumented members. If EXTRACT_ALL is set to YES then this flag will 437 | # automatically be disabled. 438 | 439 | WARN_IF_UNDOCUMENTED = YES 440 | 441 | # If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for 442 | # potential errors in the documentation, such as not documenting some 443 | # parameters in a documented function, or documenting parameters that 444 | # don't exist or using markup commands wrongly. 445 | 446 | WARN_IF_DOC_ERROR = YES 447 | 448 | # This WARN_NO_PARAMDOC option can be abled to get warnings for 449 | # functions that are documented, but have no documentation for their parameters 450 | # or return value. If set to NO (the default) doxygen will only warn about 451 | # wrong or incomplete parameter documentation, but not about the absence of 452 | # documentation. 453 | 454 | WARN_NO_PARAMDOC = NO 455 | 456 | # The WARN_FORMAT tag determines the format of the warning messages that 457 | # doxygen can produce. The string should contain the $file, $line, and $text 458 | # tags, which will be replaced by the file and line number from which the 459 | # warning originated and the warning text. Optionally the format may contain 460 | # $version, which will be replaced by the version of the file (if it could 461 | # be obtained via FILE_VERSION_FILTER) 462 | 463 | WARN_FORMAT = "$file:$line: $text" 464 | 465 | # The WARN_LOGFILE tag can be used to specify a file to which warning 466 | # and error messages should be written. If left blank the output is written 467 | # to stderr. 468 | 469 | WARN_LOGFILE = 470 | 471 | #--------------------------------------------------------------------------- 472 | # configuration options related to the input files 473 | #--------------------------------------------------------------------------- 474 | 475 | # The INPUT tag can be used to specify the files and/or directories that contain 476 | # documented source files. You may enter file names like "myfile.cpp" or 477 | # directories like "/usr/src/myproject". Separate the files or directories 478 | # with spaces. 479 | 480 | INPUT = @top_srcdir@/src 481 | 482 | # This tag can be used to specify the character encoding of the source files that 483 | # doxygen parses. Internally doxygen uses the UTF-8 encoding, which is also the default 484 | # input encoding. Doxygen uses libiconv (or the iconv built into libc) for the transcoding. 485 | # See http://www.gnu.org/software/libiconv for the list of possible encodings. 486 | 487 | INPUT_ENCODING = UTF-8 488 | 489 | # If the value of the INPUT tag contains directories, you can use the 490 | # FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 491 | # and *.h) to filter out the source-files in the directories. If left 492 | # blank the following patterns are tested: 493 | # *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx 494 | # *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py 495 | 496 | FILE_PATTERNS = 497 | 498 | # The RECURSIVE tag can be used to turn specify whether or not subdirectories 499 | # should be searched for input files as well. Possible values are YES and NO. 500 | # If left blank NO is used. 501 | 502 | RECURSIVE = NO 503 | 504 | # The EXCLUDE tag can be used to specify files and/or directories that should 505 | # excluded from the INPUT source files. This way you can easily exclude a 506 | # subdirectory from a directory tree whose root is specified with the INPUT tag. 507 | 508 | EXCLUDE = 509 | 510 | # The EXCLUDE_SYMLINKS tag can be used select whether or not files or 511 | # directories that are symbolic links (a Unix filesystem feature) are excluded 512 | # from the input. 513 | 514 | EXCLUDE_SYMLINKS = NO 515 | 516 | # If the value of the INPUT tag contains directories, you can use the 517 | # EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude 518 | # certain files from those directories. Note that the wildcards are matched 519 | # against the file with absolute path, so to exclude all test directories 520 | # for example use the pattern */test/* 521 | 522 | EXCLUDE_PATTERNS = 523 | 524 | # The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names 525 | # (namespaces, classes, functions, etc.) that should be excluded from the output. 526 | # The symbol name can be a fully qualified name, a word, or if the wildcard * is used, 527 | # a substring. Examples: ANamespace, AClass, AClass::ANamespace, ANamespace::*Test 528 | 529 | EXCLUDE_SYMBOLS = 530 | 531 | # The EXAMPLE_PATH tag can be used to specify one or more files or 532 | # directories that contain example code fragments that are included (see 533 | # the \include command). 534 | 535 | EXAMPLE_PATH = 536 | 537 | # If the value of the EXAMPLE_PATH tag contains directories, you can use the 538 | # EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp 539 | # and *.h) to filter out the source-files in the directories. If left 540 | # blank all files are included. 541 | 542 | EXAMPLE_PATTERNS = 543 | 544 | # If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be 545 | # searched for input files to be used with the \include or \dontinclude 546 | # commands irrespective of the value of the RECURSIVE tag. 547 | # Possible values are YES and NO. If left blank NO is used. 548 | 549 | EXAMPLE_RECURSIVE = NO 550 | 551 | # The IMAGE_PATH tag can be used to specify one or more files or 552 | # directories that contain image that are included in the documentation (see 553 | # the \image command). 554 | 555 | IMAGE_PATH = 556 | 557 | # The INPUT_FILTER tag can be used to specify a program that doxygen should 558 | # invoke to filter for each input file. Doxygen will invoke the filter program 559 | # by executing (via popen()) the command , where 560 | # is the value of the INPUT_FILTER tag, and is the name of an 561 | # input file. Doxygen will then use the output that the filter program writes 562 | # to standard output. If FILTER_PATTERNS is specified, this tag will be 563 | # ignored. 564 | 565 | INPUT_FILTER = 566 | 567 | # The FILTER_PATTERNS tag can be used to specify filters on a per file pattern 568 | # basis. Doxygen will compare the file name with each pattern and apply the 569 | # filter if there is a match. The filters are a list of the form: 570 | # pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further 571 | # info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER 572 | # is applied to all files. 573 | 574 | FILTER_PATTERNS = 575 | 576 | # If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using 577 | # INPUT_FILTER) will be used to filter the input files when producing source 578 | # files to browse (i.e. when SOURCE_BROWSER is set to YES). 579 | 580 | FILTER_SOURCE_FILES = NO 581 | 582 | #--------------------------------------------------------------------------- 583 | # configuration options related to source browsing 584 | #--------------------------------------------------------------------------- 585 | 586 | # If the SOURCE_BROWSER tag is set to YES then a list of source files will 587 | # be generated. Documented entities will be cross-referenced with these sources. 588 | # Note: To get rid of all source code in the generated output, make sure also 589 | # VERBATIM_HEADERS is set to NO. If you have enabled CALL_GRAPH or CALLER_GRAPH 590 | # then you must also enable this option. If you don't then doxygen will produce 591 | # a warning and turn it on anyway 592 | 593 | SOURCE_BROWSER = NO 594 | 595 | # Setting the INLINE_SOURCES tag to YES will include the body 596 | # of functions and classes directly in the documentation. 597 | 598 | INLINE_SOURCES = NO 599 | 600 | # Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct 601 | # doxygen to hide any special comment blocks from generated source code 602 | # fragments. Normal C and C++ comments will always remain visible. 603 | 604 | STRIP_CODE_COMMENTS = YES 605 | 606 | # If the REFERENCED_BY_RELATION tag is set to YES (the default) 607 | # then for each documented function all documented 608 | # functions referencing it will be listed. 609 | 610 | REFERENCED_BY_RELATION = YES 611 | 612 | # If the REFERENCES_RELATION tag is set to YES (the default) 613 | # then for each documented function all documented entities 614 | # called/used by that function will be listed. 615 | 616 | REFERENCES_RELATION = YES 617 | 618 | # If the REFERENCES_LINK_SOURCE tag is set to YES (the default) 619 | # and SOURCE_BROWSER tag is set to YES, then the hyperlinks from 620 | # functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will 621 | # link to the source code. Otherwise they will link to the documentstion. 622 | 623 | REFERENCES_LINK_SOURCE = YES 624 | 625 | # If the USE_HTAGS tag is set to YES then the references to source code 626 | # will point to the HTML generated by the htags(1) tool instead of doxygen 627 | # built-in source browser. The htags tool is part of GNU's global source 628 | # tagging system (see http://www.gnu.org/software/global/global.html). You 629 | # will need version 4.8.6 or higher. 630 | 631 | USE_HTAGS = NO 632 | 633 | # If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen 634 | # will generate a verbatim copy of the header file for each class for 635 | # which an include is specified. Set to NO to disable this. 636 | 637 | VERBATIM_HEADERS = YES 638 | 639 | #--------------------------------------------------------------------------- 640 | # configuration options related to the alphabetical class index 641 | #--------------------------------------------------------------------------- 642 | 643 | # If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index 644 | # of all compounds will be generated. Enable this if the project 645 | # contains a lot of classes, structs, unions or interfaces. 646 | 647 | ALPHABETICAL_INDEX = NO 648 | 649 | # If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then 650 | # the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns 651 | # in which this list will be split (can be a number in the range [1..20]) 652 | 653 | COLS_IN_ALPHA_INDEX = 5 654 | 655 | # In case all classes in a project start with a common prefix, all 656 | # classes will be put under the same header in the alphabetical index. 657 | # The IGNORE_PREFIX tag can be used to specify one or more prefixes that 658 | # should be ignored while generating the index headers. 659 | 660 | IGNORE_PREFIX = 661 | 662 | #--------------------------------------------------------------------------- 663 | # configuration options related to the HTML output 664 | #--------------------------------------------------------------------------- 665 | 666 | # If the GENERATE_HTML tag is set to YES (the default) Doxygen will 667 | # generate HTML output. 668 | 669 | GENERATE_HTML = YES 670 | 671 | # The HTML_OUTPUT tag is used to specify where the HTML docs will be put. 672 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 673 | # put in front of it. If left blank `html' will be used as the default path. 674 | 675 | HTML_OUTPUT = api 676 | 677 | # The HTML_FILE_EXTENSION tag can be used to specify the file extension for 678 | # each generated HTML page (for example: .htm,.php,.asp). If it is left blank 679 | # doxygen will generate files with .html extension. 680 | 681 | HTML_FILE_EXTENSION = .html 682 | 683 | # The HTML_HEADER tag can be used to specify a personal HTML header for 684 | # each generated HTML page. If it is left blank doxygen will generate a 685 | # standard header. 686 | 687 | HTML_HEADER = 688 | 689 | # The HTML_FOOTER tag can be used to specify a personal HTML footer for 690 | # each generated HTML page. If it is left blank doxygen will generate a 691 | # standard footer. 692 | 693 | HTML_FOOTER = 694 | 695 | # The HTML_STYLESHEET tag can be used to specify a user-defined cascading 696 | # style sheet that is used by each HTML page. It can be used to 697 | # fine-tune the look of the HTML output. If the tag is left blank doxygen 698 | # will generate a default style sheet. Note that doxygen will try to copy 699 | # the style sheet file to the HTML output directory, so don't put your own 700 | # stylesheet in the HTML output directory as well, or it will be erased! 701 | 702 | HTML_STYLESHEET = 703 | 704 | # If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes, 705 | # files or namespaces will be aligned in HTML using tables. If set to 706 | # NO a bullet list will be used. 707 | 708 | HTML_ALIGN_MEMBERS = YES 709 | 710 | # If the GENERATE_HTMLHELP tag is set to YES, additional index files 711 | # will be generated that can be used as input for tools like the 712 | # Microsoft HTML help workshop to generate a compressed HTML help file (.chm) 713 | # of the generated HTML documentation. 714 | 715 | GENERATE_HTMLHELP = NO 716 | 717 | # If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML 718 | # documentation will contain sections that can be hidden and shown after the 719 | # page has loaded. For this to work a browser that supports 720 | # JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox 721 | # Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari). 722 | 723 | HTML_DYNAMIC_SECTIONS = NO 724 | 725 | # If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can 726 | # be used to specify the file name of the resulting .chm file. You 727 | # can add a path in front of the file if the result should not be 728 | # written to the html output directory. 729 | 730 | CHM_FILE = 731 | 732 | # If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can 733 | # be used to specify the location (absolute path including file name) of 734 | # the HTML help compiler (hhc.exe). If non-empty doxygen will try to run 735 | # the HTML help compiler on the generated index.hhp. 736 | 737 | HHC_LOCATION = 738 | 739 | # If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag 740 | # controls if a separate .chi index file is generated (YES) or that 741 | # it should be included in the master .chm file (NO). 742 | 743 | GENERATE_CHI = NO 744 | 745 | # If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag 746 | # controls whether a binary table of contents is generated (YES) or a 747 | # normal table of contents (NO) in the .chm file. 748 | 749 | BINARY_TOC = NO 750 | 751 | # The TOC_EXPAND flag can be set to YES to add extra items for group members 752 | # to the contents of the HTML help documentation and to the tree view. 753 | 754 | TOC_EXPAND = NO 755 | 756 | # The DISABLE_INDEX tag can be used to turn on/off the condensed index at 757 | # top of each HTML page. The value NO (the default) enables the index and 758 | # the value YES disables it. 759 | 760 | DISABLE_INDEX = NO 761 | 762 | # This tag can be used to set the number of enum values (range [1..20]) 763 | # that doxygen will group on one line in the generated HTML documentation. 764 | 765 | ENUM_VALUES_PER_LINE = 4 766 | 767 | # If the GENERATE_TREEVIEW tag is set to YES, a side panel will be 768 | # generated containing a tree-like index structure (just like the one that 769 | # is generated for HTML Help). For this to work a browser that supports 770 | # JavaScript, DHTML, CSS and frames is required (for instance Mozilla 1.0+, 771 | # Netscape 6.0+, Internet explorer 5.0+, or Konqueror). Windows users are 772 | # probably better off using the HTML help feature. 773 | 774 | GENERATE_TREEVIEW = NO 775 | 776 | # If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be 777 | # used to set the initial width (in pixels) of the frame in which the tree 778 | # is shown. 779 | 780 | TREEVIEW_WIDTH = 250 781 | 782 | #--------------------------------------------------------------------------- 783 | # configuration options related to the LaTeX output 784 | #--------------------------------------------------------------------------- 785 | 786 | # If the GENERATE_LATEX tag is set to YES (the default) Doxygen will 787 | # generate Latex output. 788 | 789 | GENERATE_LATEX = NO 790 | 791 | # The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put. 792 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 793 | # put in front of it. If left blank `latex' will be used as the default path. 794 | 795 | LATEX_OUTPUT = latex 796 | 797 | # The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be 798 | # invoked. If left blank `latex' will be used as the default command name. 799 | 800 | LATEX_CMD_NAME = latex 801 | 802 | # The MAKEINDEX_CMD_NAME tag can be used to specify the command name to 803 | # generate index for LaTeX. If left blank `makeindex' will be used as the 804 | # default command name. 805 | 806 | MAKEINDEX_CMD_NAME = makeindex 807 | 808 | # If the COMPACT_LATEX tag is set to YES Doxygen generates more compact 809 | # LaTeX documents. This may be useful for small projects and may help to 810 | # save some trees in general. 811 | 812 | COMPACT_LATEX = NO 813 | 814 | # The PAPER_TYPE tag can be used to set the paper type that is used 815 | # by the printer. Possible values are: a4, a4wide, letter, legal and 816 | # executive. If left blank a4wide will be used. 817 | 818 | PAPER_TYPE = a4wide 819 | 820 | # The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX 821 | # packages that should be included in the LaTeX output. 822 | 823 | EXTRA_PACKAGES = 824 | 825 | # The LATEX_HEADER tag can be used to specify a personal LaTeX header for 826 | # the generated latex document. The header should contain everything until 827 | # the first chapter. If it is left blank doxygen will generate a 828 | # standard header. Notice: only use this tag if you know what you are doing! 829 | 830 | LATEX_HEADER = 831 | 832 | # If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated 833 | # is prepared for conversion to pdf (using ps2pdf). The pdf file will 834 | # contain links (just like the HTML output) instead of page references 835 | # This makes the output suitable for online browsing using a pdf viewer. 836 | 837 | PDF_HYPERLINKS = NO 838 | 839 | # If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of 840 | # plain latex in the generated Makefile. Set this option to YES to get a 841 | # higher quality PDF documentation. 842 | 843 | USE_PDFLATEX = NO 844 | 845 | # If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode. 846 | # command to the generated LaTeX files. This will instruct LaTeX to keep 847 | # running if errors occur, instead of asking the user for help. 848 | # This option is also used when generating formulas in HTML. 849 | 850 | LATEX_BATCHMODE = NO 851 | 852 | # If LATEX_HIDE_INDICES is set to YES then doxygen will not 853 | # include the index chapters (such as File Index, Compound Index, etc.) 854 | # in the output. 855 | 856 | LATEX_HIDE_INDICES = NO 857 | 858 | #--------------------------------------------------------------------------- 859 | # configuration options related to the RTF output 860 | #--------------------------------------------------------------------------- 861 | 862 | # If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output 863 | # The RTF output is optimized for Word 97 and may not look very pretty with 864 | # other RTF readers or editors. 865 | 866 | GENERATE_RTF = NO 867 | 868 | # The RTF_OUTPUT tag is used to specify where the RTF docs will be put. 869 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 870 | # put in front of it. If left blank `rtf' will be used as the default path. 871 | 872 | RTF_OUTPUT = rtf 873 | 874 | # If the COMPACT_RTF tag is set to YES Doxygen generates more compact 875 | # RTF documents. This may be useful for small projects and may help to 876 | # save some trees in general. 877 | 878 | COMPACT_RTF = NO 879 | 880 | # If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated 881 | # will contain hyperlink fields. The RTF file will 882 | # contain links (just like the HTML output) instead of page references. 883 | # This makes the output suitable for online browsing using WORD or other 884 | # programs which support those fields. 885 | # Note: wordpad (write) and others do not support links. 886 | 887 | RTF_HYPERLINKS = NO 888 | 889 | # Load stylesheet definitions from file. Syntax is similar to doxygen's 890 | # config file, i.e. a series of assignments. You only have to provide 891 | # replacements, missing definitions are set to their default value. 892 | 893 | RTF_STYLESHEET_FILE = 894 | 895 | # Set optional variables used in the generation of an rtf document. 896 | # Syntax is similar to doxygen's config file. 897 | 898 | RTF_EXTENSIONS_FILE = 899 | 900 | #--------------------------------------------------------------------------- 901 | # configuration options related to the man page output 902 | #--------------------------------------------------------------------------- 903 | 904 | # If the GENERATE_MAN tag is set to YES (the default) Doxygen will 905 | # generate man pages 906 | 907 | GENERATE_MAN = NO 908 | 909 | # The MAN_OUTPUT tag is used to specify where the man pages will be put. 910 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 911 | # put in front of it. If left blank `man' will be used as the default path. 912 | 913 | MAN_OUTPUT = man 914 | 915 | # The MAN_EXTENSION tag determines the extension that is added to 916 | # the generated man pages (default is the subroutine's section .3) 917 | 918 | MAN_EXTENSION = .3 919 | 920 | # If the MAN_LINKS tag is set to YES and Doxygen generates man output, 921 | # then it will generate one additional man file for each entity 922 | # documented in the real man page(s). These additional files 923 | # only source the real man page, but without them the man command 924 | # would be unable to find the correct page. The default is NO. 925 | 926 | MAN_LINKS = NO 927 | 928 | #--------------------------------------------------------------------------- 929 | # configuration options related to the XML output 930 | #--------------------------------------------------------------------------- 931 | 932 | # If the GENERATE_XML tag is set to YES Doxygen will 933 | # generate an XML file that captures the structure of 934 | # the code including all documentation. 935 | 936 | GENERATE_XML = NO 937 | 938 | # The XML_OUTPUT tag is used to specify where the XML pages will be put. 939 | # If a relative path is entered the value of OUTPUT_DIRECTORY will be 940 | # put in front of it. If left blank `xml' will be used as the default path. 941 | 942 | XML_OUTPUT = xml 943 | 944 | # The XML_SCHEMA tag can be used to specify an XML schema, 945 | # which can be used by a validating XML parser to check the 946 | # syntax of the XML files. 947 | 948 | XML_SCHEMA = 949 | 950 | # The XML_DTD tag can be used to specify an XML DTD, 951 | # which can be used by a validating XML parser to check the 952 | # syntax of the XML files. 953 | 954 | XML_DTD = 955 | 956 | # If the XML_PROGRAMLISTING tag is set to YES Doxygen will 957 | # dump the program listings (including syntax highlighting 958 | # and cross-referencing information) to the XML output. Note that 959 | # enabling this will significantly increase the size of the XML output. 960 | 961 | XML_PROGRAMLISTING = YES 962 | 963 | #--------------------------------------------------------------------------- 964 | # configuration options for the AutoGen Definitions output 965 | #--------------------------------------------------------------------------- 966 | 967 | # If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will 968 | # generate an AutoGen Definitions (see autogen.sf.net) file 969 | # that captures the structure of the code including all 970 | # documentation. Note that this feature is still experimental 971 | # and incomplete at the moment. 972 | 973 | GENERATE_AUTOGEN_DEF = NO 974 | 975 | #--------------------------------------------------------------------------- 976 | # configuration options related to the Perl module output 977 | #--------------------------------------------------------------------------- 978 | 979 | # If the GENERATE_PERLMOD tag is set to YES Doxygen will 980 | # generate a Perl module file that captures the structure of 981 | # the code including all documentation. Note that this 982 | # feature is still experimental and incomplete at the 983 | # moment. 984 | 985 | GENERATE_PERLMOD = NO 986 | 987 | # If the PERLMOD_LATEX tag is set to YES Doxygen will generate 988 | # the necessary Makefile rules, Perl scripts and LaTeX code to be able 989 | # to generate PDF and DVI output from the Perl module output. 990 | 991 | PERLMOD_LATEX = NO 992 | 993 | # If the PERLMOD_PRETTY tag is set to YES the Perl module output will be 994 | # nicely formatted so it can be parsed by a human reader. This is useful 995 | # if you want to understand what is going on. On the other hand, if this 996 | # tag is set to NO the size of the Perl module output will be much smaller 997 | # and Perl will parse it just the same. 998 | 999 | PERLMOD_PRETTY = YES 1000 | 1001 | # The names of the make variables in the generated doxyrules.make file 1002 | # are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX. 1003 | # This is useful so different doxyrules.make files included by the same 1004 | # Makefile don't overwrite each other's variables. 1005 | 1006 | PERLMOD_MAKEVAR_PREFIX = 1007 | 1008 | #--------------------------------------------------------------------------- 1009 | # Configuration options related to the preprocessor 1010 | #--------------------------------------------------------------------------- 1011 | 1012 | # If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will 1013 | # evaluate all C-preprocessor directives found in the sources and include 1014 | # files. 1015 | 1016 | ENABLE_PREPROCESSING = YES 1017 | 1018 | # If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro 1019 | # names in the source code. If set to NO (the default) only conditional 1020 | # compilation will be performed. Macro expansion can be done in a controlled 1021 | # way by setting EXPAND_ONLY_PREDEF to YES. 1022 | 1023 | MACRO_EXPANSION = NO 1024 | 1025 | # If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES 1026 | # then the macro expansion is limited to the macros specified with the 1027 | # PREDEFINED and EXPAND_AS_DEFINED tags. 1028 | 1029 | EXPAND_ONLY_PREDEF = NO 1030 | 1031 | # If the SEARCH_INCLUDES tag is set to YES (the default) the includes files 1032 | # in the INCLUDE_PATH (see below) will be search if a #include is found. 1033 | 1034 | SEARCH_INCLUDES = YES 1035 | 1036 | # The INCLUDE_PATH tag can be used to specify one or more directories that 1037 | # contain include files that are not input files but should be processed by 1038 | # the preprocessor. 1039 | 1040 | INCLUDE_PATH = 1041 | 1042 | # You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard 1043 | # patterns (like *.h and *.hpp) to filter out the header-files in the 1044 | # directories. If left blank, the patterns specified with FILE_PATTERNS will 1045 | # be used. 1046 | 1047 | INCLUDE_FILE_PATTERNS = 1048 | 1049 | # The PREDEFINED tag can be used to specify one or more macro names that 1050 | # are defined before the preprocessor is started (similar to the -D option of 1051 | # gcc). The argument of the tag is a list of macros of the form: name 1052 | # or name=definition (no spaces). If the definition and the = are 1053 | # omitted =1 is assumed. To prevent a macro definition from being 1054 | # undefined via #undef or recursively expanded use the := operator 1055 | # instead of the = operator. 1056 | 1057 | PREDEFINED = 1058 | 1059 | # If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then 1060 | # this tag can be used to specify a list of macro names that should be expanded. 1061 | # The macro definition that is found in the sources will be used. 1062 | # Use the PREDEFINED tag if you want to use a different macro definition. 1063 | 1064 | EXPAND_AS_DEFINED = 1065 | 1066 | # If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then 1067 | # doxygen's preprocessor will remove all function-like macros that are alone 1068 | # on a line, have an all uppercase name, and do not end with a semicolon. Such 1069 | # function macros are typically used for boiler-plate code, and will confuse 1070 | # the parser if not removed. 1071 | 1072 | SKIP_FUNCTION_MACROS = YES 1073 | 1074 | #--------------------------------------------------------------------------- 1075 | # Configuration::additions related to external references 1076 | #--------------------------------------------------------------------------- 1077 | 1078 | # The TAGFILES option can be used to specify one or more tagfiles. 1079 | # Optionally an initial location of the external documentation 1080 | # can be added for each tagfile. The format of a tag file without 1081 | # this location is as follows: 1082 | # TAGFILES = file1 file2 ... 1083 | # Adding location for the tag files is done as follows: 1084 | # TAGFILES = file1=loc1 "file2 = loc2" ... 1085 | # where "loc1" and "loc2" can be relative or absolute paths or 1086 | # URLs. If a location is present for each tag, the installdox tool 1087 | # does not have to be run to correct the links. 1088 | # Note that each tag file must have a unique name 1089 | # (where the name does NOT include the path) 1090 | # If a tag file is not located in the directory in which doxygen 1091 | # is run, you must also specify the path to the tagfile here. 1092 | 1093 | TAGFILES = 1094 | 1095 | # When a file name is specified after GENERATE_TAGFILE, doxygen will create 1096 | # a tag file that is based on the input files it reads. 1097 | 1098 | GENERATE_TAGFILE = 1099 | 1100 | # If the ALLEXTERNALS tag is set to YES all external classes will be listed 1101 | # in the class index. If set to NO only the inherited external classes 1102 | # will be listed. 1103 | 1104 | ALLEXTERNALS = NO 1105 | 1106 | # If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed 1107 | # in the modules index. If set to NO, only the current project's groups will 1108 | # be listed. 1109 | 1110 | EXTERNAL_GROUPS = YES 1111 | 1112 | # The PERL_PATH should be the absolute path and name of the perl script 1113 | # interpreter (i.e. the result of `which perl'). 1114 | 1115 | PERL_PATH = /usr/bin/perl 1116 | 1117 | #--------------------------------------------------------------------------- 1118 | # Configuration options related to the dot tool 1119 | #--------------------------------------------------------------------------- 1120 | 1121 | # If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will 1122 | # generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base 1123 | # or super classes. Setting the tag to NO turns the diagrams off. Note that 1124 | # this option is superseded by the HAVE_DOT option below. This is only a 1125 | # fallback. It is recommended to install and use dot, since it yields more 1126 | # powerful graphs. 1127 | 1128 | CLASS_DIAGRAMS = YES 1129 | 1130 | # You can define message sequence charts within doxygen comments using the \msc 1131 | # command. Doxygen will then run the mscgen tool (see http://www.mcternan.me.uk/mscgen/) to 1132 | # produce the chart and insert it in the documentation. The MSCGEN_PATH tag allows you to 1133 | # specify the directory where the mscgen tool resides. If left empty the tool is assumed to 1134 | # be found in the default search path. 1135 | 1136 | MSCGEN_PATH = 1137 | 1138 | # If set to YES, the inheritance and collaboration graphs will hide 1139 | # inheritance and usage relations if the target is undocumented 1140 | # or is not a class. 1141 | 1142 | HIDE_UNDOC_RELATIONS = YES 1143 | 1144 | # If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is 1145 | # available from the path. This tool is part of Graphviz, a graph visualization 1146 | # toolkit from AT&T and Lucent Bell Labs. The other options in this section 1147 | # have no effect if this option is set to NO (the default) 1148 | 1149 | HAVE_DOT = NO 1150 | 1151 | # If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen 1152 | # will generate a graph for each documented class showing the direct and 1153 | # indirect inheritance relations. Setting this tag to YES will force the 1154 | # the CLASS_DIAGRAMS tag to NO. 1155 | 1156 | CLASS_GRAPH = YES 1157 | 1158 | # If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen 1159 | # will generate a graph for each documented class showing the direct and 1160 | # indirect implementation dependencies (inheritance, containment, and 1161 | # class references variables) of the class with other documented classes. 1162 | 1163 | COLLABORATION_GRAPH = YES 1164 | 1165 | # If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen 1166 | # will generate a graph for groups, showing the direct groups dependencies 1167 | 1168 | GROUP_GRAPHS = YES 1169 | 1170 | # If the UML_LOOK tag is set to YES doxygen will generate inheritance and 1171 | # collaboration diagrams in a style similar to the OMG's Unified Modeling 1172 | # Language. 1173 | 1174 | UML_LOOK = NO 1175 | 1176 | # If set to YES, the inheritance and collaboration graphs will show the 1177 | # relations between templates and their instances. 1178 | 1179 | TEMPLATE_RELATIONS = NO 1180 | 1181 | # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT 1182 | # tags are set to YES then doxygen will generate a graph for each documented 1183 | # file showing the direct and indirect include dependencies of the file with 1184 | # other documented files. 1185 | 1186 | INCLUDE_GRAPH = YES 1187 | 1188 | # If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and 1189 | # HAVE_DOT tags are set to YES then doxygen will generate a graph for each 1190 | # documented header file showing the documented files that directly or 1191 | # indirectly include this file. 1192 | 1193 | INCLUDED_BY_GRAPH = YES 1194 | 1195 | # If the CALL_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will 1196 | # generate a call dependency graph for every global function or class method. 1197 | # Note that enabling this option will significantly increase the time of a run. 1198 | # So in most cases it will be better to enable call graphs for selected 1199 | # functions only using the \callgraph command. 1200 | 1201 | CALL_GRAPH = NO 1202 | 1203 | # If the CALLER_GRAPH, SOURCE_BROWSER and HAVE_DOT tags are set to YES then doxygen will 1204 | # generate a caller dependency graph for every global function or class method. 1205 | # Note that enabling this option will significantly increase the time of a run. 1206 | # So in most cases it will be better to enable caller graphs for selected 1207 | # functions only using the \callergraph command. 1208 | 1209 | CALLER_GRAPH = NO 1210 | 1211 | # If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen 1212 | # will graphical hierarchy of all classes instead of a textual one. 1213 | 1214 | GRAPHICAL_HIERARCHY = YES 1215 | 1216 | # If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES 1217 | # then doxygen will show the dependencies a directory has on other directories 1218 | # in a graphical way. The dependency relations are determined by the #include 1219 | # relations between the files in the directories. 1220 | 1221 | DIRECTORY_GRAPH = YES 1222 | 1223 | # The DOT_IMAGE_FORMAT tag can be used to set the image format of the images 1224 | # generated by dot. Possible values are png, jpg, or gif 1225 | # If left blank png will be used. 1226 | 1227 | DOT_IMAGE_FORMAT = png 1228 | 1229 | # The tag DOT_PATH can be used to specify the path where the dot tool can be 1230 | # found. If left blank, it is assumed the dot tool can be found in the path. 1231 | 1232 | DOT_PATH = 1233 | 1234 | # The DOTFILE_DIRS tag can be used to specify one or more directories that 1235 | # contain dot files that are included in the documentation (see the 1236 | # \dotfile command). 1237 | 1238 | DOTFILE_DIRS = 1239 | 1240 | # The MAX_DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of 1241 | # nodes that will be shown in the graph. If the number of nodes in a graph 1242 | # becomes larger than this value, doxygen will truncate the graph, which is 1243 | # visualized by representing a node as a red box. Note that doxygen if the number 1244 | # of direct children of the root node in a graph is already larger than 1245 | # MAX_DOT_GRAPH_NOTES then the graph will not be shown at all. Also note 1246 | # that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH. 1247 | 1248 | DOT_GRAPH_MAX_NODES = 50 1249 | 1250 | # The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the 1251 | # graphs generated by dot. A depth value of 3 means that only nodes reachable 1252 | # from the root by following a path via at most 3 edges will be shown. Nodes 1253 | # that lay further from the root node will be omitted. Note that setting this 1254 | # option to 1 or 2 may greatly reduce the computation time needed for large 1255 | # code bases. Also note that the size of a graph can be further restricted by 1256 | # DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction. 1257 | 1258 | MAX_DOT_GRAPH_DEPTH = 0 1259 | 1260 | # Set the DOT_TRANSPARENT tag to YES to generate images with a transparent 1261 | # background. This is disabled by default, which results in a white background. 1262 | # Warning: Depending on the platform used, enabling this option may lead to 1263 | # badly anti-aliased labels on the edges of a graph (i.e. they become hard to 1264 | # read). 1265 | 1266 | DOT_TRANSPARENT = NO 1267 | 1268 | # Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output 1269 | # files in one run (i.e. multiple -o and -T options on the command line). This 1270 | # makes dot run faster, but since only newer versions of dot (>1.8.10) 1271 | # support this, this feature is disabled by default. 1272 | 1273 | DOT_MULTI_TARGETS = NO 1274 | 1275 | # If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will 1276 | # generate a legend page explaining the meaning of the various boxes and 1277 | # arrows in the dot generated graphs. 1278 | 1279 | GENERATE_LEGEND = YES 1280 | 1281 | # If the DOT_CLEANUP tag is set to YES (the default) Doxygen will 1282 | # remove the intermediate dot files that are used to generate 1283 | # the various graphs. 1284 | 1285 | DOT_CLEANUP = YES 1286 | 1287 | #--------------------------------------------------------------------------- 1288 | # Configuration::additions related to the search engine 1289 | #--------------------------------------------------------------------------- 1290 | 1291 | # The SEARCHENGINE tag specifies whether or not a search engine should be 1292 | # used. If set to NO the values of all tags below this one will be ignored. 1293 | 1294 | SEARCHENGINE = NO 1295 | -------------------------------------------------------------------------------- /doc/Makefile.am: -------------------------------------------------------------------------------- 1 | MAINTAINERCLEANFILES = Makefile.in api/* 2 | 3 | EXTRA_DIST = index.xhtml packagedoc.css api/index.html api examples 4 | 5 | # apidir = $(docdir)/api 6 | # api_DATA = api/index.html api/* 7 | 8 | # examplesdir = $(docdir)/examples 9 | # examples_DATA = examples/* 10 | 11 | api/index.html: $(top_srcdir)/src/*.cxx $(top_srcdir)/src/*.h 12 | doxygen 13 | -------------------------------------------------------------------------------- /doc/examples/array-slowdown.cxx: -------------------------------------------------------------------------------- 1 | #include 2 | #include 3 | 4 | 5 | int main() { 6 | using namespace std; 7 | 8 | for (int e=7; e<=11; ++e) { 9 | for (int stride=(1< 5 | 6 | void simpleDecompose(numtype *data, int rows, int cols) { 7 | using namespace blitz; 8 | using namespace bwave; 9 | 10 | // Create a blitz array on data, assuming C-style memory layout 11 | // (data is used directly, not copied): 12 | GeneralArrayStorage<2> storage; 13 | storage.ordering() = secondDim, firstDim; 14 | Array array(data, shape(rows, cols), neverDeleteData, storage); 15 | 16 | // Create a CDF(2,2) nonstandard wavelet decomposition in 2 dimensions: 17 | WaveletDecomp<2> decomp(WL_CDF_2_2, NONSTD_DECOMP); 18 | 19 | // Apply the decomposition on the data (in situ): 20 | decomp.apply(array); 21 | } 22 | -------------------------------------------------------------------------------- /doc/examples/simpleDecompose.h: -------------------------------------------------------------------------------- 1 | // simpleDecompose.h 2 | 3 | typedef short numtype; 4 | 5 | void simpleDecompose(numtype *data, int rows, int cols); 6 | -------------------------------------------------------------------------------- /doc/index.xhtml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | blitzwave C++ Wavelet Library 13 | 14 | 15 | 16 | 17 | 18 | 21 | 22 | 35 | 36 |
37 |

Overview

38 | 39 |

blitzwave is a c++ wavelet library building on the 40 | blitz++ array template library. 41 | blitzwave is heavily templated and supports wavelet decompositions of 42 | n-dimensional arrays of various numerical data types. 43 | You can define and use your own wavelets, a number of pre-defined, 44 | ready-to-use wavelets are available.

45 |

Performance is quite good, similar to the 46 | WAILI library 47 | (using datatype int for blitzwave).

48 | 49 |

The blitzwave library is placed under the GNU General Public License.

50 | 51 |

It is hosted on GitHub, 52 | also take a look at the project page.

53 | 54 | 55 |

What's new?

56 | 57 |

Version 0.7.0

58 | 59 |
    60 |
  • Made code compatible to newer GCC versions.
  • 61 |
  • blitzwave now uses namespaces. All classes and functions 62 | are available under the namespace "bwave". Please add 63 | "using namespace bwave;" or similar to your code to use 64 | blitzwave
  • 65 |
  • Changed build system to automake+autoconf.
  • 66 |
  • Moved test code to separate files.
  • 67 |
  • Changed C++ file suffix from .cc to .cxx.
  • 68 |
69 | 70 |

Version 0.6.0

71 | 72 |
    73 |
  • A standard installer has been added ("make install").
  • 74 |
  • pkg-config is now supported for library detection (i.e. of blitz++).
  • 75 |
  • Improved compiler compatibility and language conformance. blitzwave 76 | will now compile with g++ -Wall -Werror -pedantic-errors -Wundef -Wno-long-long.
  • 77 |
78 | 79 | 80 |

Version 0.5.0

81 | 82 |
    83 |
  • Blitzwave works with the blitz++ BZ_DEBUG option now.
  • 84 |
  • A TinyVector range-violation has been fixed.
  • 85 |
86 | 87 | 88 |

Version 0.4.0

89 | 90 |
    91 |
  • More small bugfixes.
  • 92 |
93 | 94 | 95 |

Version 0.3.0

96 | 97 |
    98 |
  • Some small changes and bugfixes.
  • 99 |
100 | 101 | 102 |

Version 0.2.0

103 | 104 |
    105 |
  • A few Bugs have been found and fixed.
  • 106 |
  • There are more predefined wavelets now.
  • 107 |
  • API Documentation has been improved a lot.
  • 108 |
  • Lot's of small code changes and some small API changes.
  • 109 |
110 | 111 | 112 |

Status

113 | 114 |

blitzwave is stable and produces mathematically correct results. It 115 | has been used in production for several different scientific projects 116 | (that I know of). The API may still be subject to minor changes.

117 | 118 |

Several popular wavelets are pre-defined in the library, 119 | more may be added over time.

120 | 121 |

If you should find bugs/errors, both in code or underlying math, 122 | please let me know. Corrections, patches and code contributions are 123 | always welcome.

124 | 125 | 126 |

Details

127 | 128 |

Wavelet Algorithm

129 | 130 |

blitzwave uses the fast and well-known lifting scheme for it's 131 | wavelet transformations. See the 132 | references for literature on the subject.

133 | 134 |

Boundary handling

135 | 136 |

Boundary handling is done via data extension. The extension is 137 | done anew in every lifting step, ensuring perfect reconstruction 138 | after decomposition-recomposition independent of extension scheme. 139 | Currently, only zero- and constant extension are implemented, 140 | symmetric extension and other methods will follow.

141 | 142 | 143 |

Documentation

144 | 145 |

The API-Documentation is available here.

146 | 147 | 148 |

Download

149 | 150 |

Releases

151 | 152 |

The source code of current and past blitzwave releases is 153 | 154 | available here.

155 | 156 |

Development

157 | 158 |

Since version 0.7.0, the blitzwave source code is managed with 159 | Git. You can clone the blitzwave 160 | Git repository on GitHub. 161 |

162 | 163 |

Installation

164 | 165 |

Blitzwave can be installed as a library with "make install". 166 | However, blitzwave consists of only 6 files, so it might be 167 | appropriate to just copy them into your Project.

168 | 169 |

The only library dependency is blitz++, you need to have that 170 | installed. Apart from blitz++ you will need an ISO-C++ compliant 171 | compiler, because both blitz++ and blitzwave make use of advanced 172 | C++ features. GCC 3.x will do nicely.

173 | 174 | 175 |

FAQ

176 | 177 |

How do i get started?

178 | 179 |

Run "./configure" and "make", then move to the "src" directory. 180 | Execute the "WaveletDecomp-test" binary which will demonstrate image 181 | compression and wavelet form reconstruction. 182 | There is a such a test-function included in each header file. Look at 183 | its implementation for some usage examples. (There is also an "examples" 184 | directory, but it's still quite empty.)

185 | 186 | 187 |

Which predefined wavelets are available?

188 | 189 |

blitzwave currently comes with the Cohen-Daubechies-Feauveau 190 | CDF(1,1) (= Haar Wavelet), CDF(2,2) (= LeGall(5,3), JPEG 2000), 191 | CDF(3,1), CDF(3,3), CDF(4,2) (Cubic-Spline, a variant, is also included), 192 | CDF(9,7) (also called Daubechies 9/7, JPEG 2000) wavelets and the 193 | well-known Daubechies D4 wavelet.

194 | 195 | 196 | 197 |

How do I define a wavelet?

198 | 199 |

To define a wavelet, you create a Wavelet object by specifying 200 | the appropriate lifting steps and normalization factors:

201 | 202 |
Wavelet myWavelet( "CDF(2,2)", sqrt(2.0), sqrt(2.0)/2,
203 |         Wavelet::LiftingStep(Wavelet::LiftingStep::DUAL,    0,  2, -1, -1),
204 |         Wavelet::LiftingStep(Wavelet::LiftingStep::PRIMAL, -1,  4,  1,  1)
205 | );
206 | 
207 | 208 |

You can then check if you've give the right values at the right place:

209 | 210 |
 cout << myWavelet << endl;
211 | 212 |

This will result in a control output:

213 | 214 |
Wavelet: CDF(2,2)
215 |         Lifting steps:
216 |                 dual lifting:   d(i) = d(i) + 1/2 ( - s(i) - s(i+1) )
217 |                 primal lifting: s(i) = s(i) + 1/4 ( d(i-1) + d(i) )
218 |         Normalisation:
219 |                 s(i) = s(i) * 1.41421
220 |                 d(i) = d(i) * 0.707107
221 | 222 | 223 |

Why are compile times so high?

224 | 225 |

This is because of the extensive use of templates in blitzwave 226 | and blitz++. I'm not sure yet if it's possible to speed up compiling 227 | while maintaining flexibility.

228 | 229 |

However, if compile times are unacceptably high for your needs, 230 | you can easily write a non-templated wrapper for a specific data-type 231 | and -dimensionality. Because blitz++ arrays can be created to use 232 | preexisting data without copying, neither blitz++ nor blitzwave need 233 | to be used by the interface of your wrapper. Therefore, blitzwave can 234 | be easily integrated into applications without using any of it's data-types.

235 |

Simple example for such a wrapper:

236 |
// simpleDecompose.h
237 | 
238 | typedef short numtype;
239 | 
240 | void simpleDecompose(numtype *data, int rows, int cols);
241 | 242 | 243 |
// simpleDecompose.cxx
244 | 
245 | #include "simpleDecompose.h"
246 | #include <WaveletDecomp.h>
247 | 
248 | void simpleDecompose(numtype *data, int rows, int cols) {
249 |     using namespace blitz;
250 |     using namespace bwave;
251 | 
252 |     // Create a blitz array on data assuming C-style memory layout
253 |     // (data is used directly, not copied):
254 |     GeneralArrayStorage<2> storage;
255 |     storage.ordering() = secondDim, firstDim;
256 |     Array<numtype, 2> array(data, shape(rows, cols), neverDeleteData,
257 |     	storage);
258 | 
259 |     // Create a CDF(2,2) nonstandard wavelet decomposition in 2 dimensions:
260 |     WaveletDecomp<2> decomp(WL_CDF_2_2, NONSTD_DECOMP);
261 | 	
262 |     // Apply the decomposition on the data (in situ):
263 |     decomp.apply(array);
264 | }
265 | 266 | 267 |

Performance seems to depend on array size in a strange way. Why?

268 | 269 |

Decomposition speed will break down to about 10% for certain array 270 | sizes on some machines. This is because blitzwave need to do strided 271 | memory access (which is provided by blitz++). There reason for the 272 | performance breakdown does not lie within blitz++, however. Some machine 273 | architectures will to strided memory writes very slow for some specific 274 | stride lengths, especially greater powers of 2.

275 |

I've seen this behavior on Intel and AMD machines, on an Alpha 276 | to a lesser degree, but not on a Sun Sparc, for example. I don't know 277 | the technical reason, try this code 278 | snippet for a demonstration of the problem.

279 | 280 | 281 | 282 |

References

283 | 284 |
    285 |
  1. W. Sweldens. The lifting scheme: A new philosophy in biorthogonal 286 | wavelet constructions. In A. F. Laine and M. Unser, editors, Wavelet 287 | Applications in Signal and Image Processing III, pages 68-79. Proc. SPIE 2569, 288 | 1995.

  2. 289 | 290 |
  3. W. Sweldens. The lifting scheme: A custom-design construction 291 | of biorthogonal wavelets. Appl. Comput. Harmon. Anal., 3(2):186-200, 1996.

  4. 292 | 293 |
  5. R. Calderbank, I. Daubechies, W. Sweldens, and B.-L. Yeo. Wavelet 294 | transforms that map integers to integers. Technical report, Department 295 | of Mathematics, Princeton University, 1996.

  6. 296 | 297 |
  7. B. Wohlberg and C. Brislawn, Reversible integer-to-integer 298 | transforms and symmetric extension of even-length filter banks, 299 | Proceedings of Visual Communication and Image Processing (VCIP) 2003.

  8. 300 |
301 |

2013-12-17, Oliver Schulz <oliver.schulz at tdau-dortmund.de>

302 | 303 |
304 | 305 | 306 | -------------------------------------------------------------------------------- /doc/packagedoc.css: -------------------------------------------------------------------------------- 1 | html { } 2 | 3 | body { 4 | margin-top: 2%; 5 | margin-left: 2%; 6 | margin-right: 2%; 7 | margin-bottom: 2%; 8 | 9 | padding-left: 2ex; 10 | padding-right: 2ex; 11 | padding-top: 2ex; 12 | padding-bottom: 2ex; 13 | 14 | font-family: serif; 15 | font-size: medium; 16 | color: black; 17 | } 18 | 19 | #header { 20 | } 21 | 22 | #navigation { 23 | } 24 | 25 | #content { 26 | } 27 | 28 | ul.toc-0 { 29 | list-style-type: none; 30 | margin-left: 0; 31 | padding-left: 0; 32 | } 33 | 34 | p { 35 | margin-top:.25em; margin-bottom:.25em; 36 | text-indent:2ex; text-align:left; 37 | } 38 | 39 | h1 { font-size: xx-large; font-family: Helvetica, Sans-Serif; text-align:center;} 40 | h2 { font-size: xx-large; font-family: Helvetica, Sans-Serif; } 41 | h3 { font-size: x-large; font-family: Helvetica, Sans-Serif; } 42 | h4 { font-size: x-large; font-family: Times, Serif; } 43 | h5 { font-size: large; font-family: Times, Serif; } 44 | h6 { font-size: medium; font-family: Times, Serif; } 45 | 46 | 47 | pre.sourcecode { 48 | margin-left: auto; 49 | margin-right: auto; 50 | font-family: "Courier", monospace; 51 | font-size: small; 52 | background-color: silver; 53 | } 54 | 55 | p.author { 56 | border-top: medium solid black; 57 | padding-top: .5em; 58 | text-align: right; 59 | } 60 | 61 | 62 | /* screen media ********************************************************/ 63 | 64 | @media screen { 65 | 66 | html { background-color:#909080; } 67 | 68 | body { 69 | 70 | margin-top: 2%; 71 | margin-left: 2%; 72 | margin-right: 2%; 73 | margin-bottom: 2%; 74 | 75 | padding-left: 2ex; 76 | padding-right: 2ex; 77 | padding-top: 2ex; 78 | padding-bottom: 2ex; 79 | 80 | font-family: serif; 81 | font-size: medium; 82 | color: black; 83 | } 84 | 85 | #header { 86 | background-color:#E0E0D0; 87 | } 88 | 89 | #navigation { 90 | margin-top:2ex; 91 | float:left; 92 | width:23ex; 93 | background-color:#E0E0D0; 94 | padding-top:.1ex; padding-bottom:.1ex; 95 | } 96 | 97 | #content { 98 | margin-top:2ex; 99 | margin-left:25ex; 100 | padding-left:2ex; padding-right:2ex; 101 | padding-top:.1ex; padding-bottom:.1ex; 102 | background-color:#E0E0D0; 103 | } 104 | 105 | h1 { text-align:center; margin-top:0; margin-bottom:0; } 106 | 107 | pre.sourcecode { 108 | width: 100ex; 109 | padding: 1ex; 110 | background-color: #B0B0A0; 111 | } 112 | 113 | } 114 | 115 | 116 | /* print media ********************************************************/ 117 | 118 | @media print { 119 | 120 | #navigation { 121 | display: none; 122 | } 123 | 124 | } 125 | -------------------------------------------------------------------------------- /m4/cxx-project-deps.m4: -------------------------------------------------------------------------------- 1 | dnl -*- mode: autoconf -*- 2 | dnl 3 | dnl Autoconf macro resolve C/C++ library dependencies 4 | dnl 5 | dnl CXX_PROJECT_DEPS([DEPENDENCIES]) 6 | dnl 7 | dnl The macro defines the following substitution variables 8 | dnl 9 | dnl DEP_CFLAGS CFLAGS for depencencies, also added to CFLAGS 10 | dnl DEP_LIBS LIBS for dependencies, also added to LIBS 11 | 12 | 13 | AC_DEFUN([CXX_PROJECT_DEPS], 14 | [ 15 | AC_REQUIRE([CXX_PROJECT_INIT]) 16 | 17 | DEPS="$1" 18 | 19 | PKGCONFIG_DEPS="" 20 | for DEPNAME in $DEPS; do 21 | echo "SEARCHING FOR \"${DEPNAME}\" ..." 22 | AC_MSG_CHECKING(${PKGCONFIG} ${DEPNAME}) 23 | if ${PKGCONFIG} ${DEPNAME}; then 24 | AC_MSG_RESULT(yes) 25 | PKGCONFIG_DEPS="$PKGCONFIG_DEPS ${DEPNAME}" 26 | else 27 | AC_MSG_RESULT(no) 28 | LIBCONFIG="${DEPNAME}-config" 29 | AC_MSG_CHECKING(${LIBCONFIG}) 30 | if which "${LIBCONFIG}" > /dev/null 2> /dev/null ; then 31 | AC_MSG_RESULT(yes) 32 | DEP_CFLAGS="${DEP_CFLAGS} "`"${LIBCONFIG}" --cflags` 33 | DEP_LIBS="`${LIBCONFIG} --libs` ${DEP_LIBS}" 34 | else 35 | AC_MSG_RESULT(no) 36 | NEW_LIBS="" 37 | AC_CHECK_LIB(${DEPNAME}, main, NEW_LIBS="-l${DEPNAME}", [AC_MSG_ERROR([Could not find ]${DEPNAME}[ library!])]) 38 | DEP_LIBS="${NEW_LIBS} ${DEP_LIBS}" 39 | fi 40 | fi 41 | done 42 | 43 | CFLAGS="$CFLAGS $DEP_CFLAGS" 44 | CXXFLAGS="$CXXFLAGS $DEP_CFLAGS" 45 | LIBS="$DEP_LIBS $LIBS" 46 | 47 | AC_SUBST(DEP_CFLAGS) 48 | AC_SUBST(DEP_LIBS) 49 | 50 | if test "${PKGCONFIG_DEPS}" != "" ; then 51 | for PKGNAME in ${PKGCONFIG_DEPS}; do 52 | if ! "${PKGCONFIG}" "${PKGNAME}"; then 53 | AC_MSG_ERROR([Package requirements not met - no package ']${PKGNAME}[' found]) 54 | fi 55 | done 56 | CFLAGS="$CFLAGS `${PKGCONFIG} ${PKGCONFIG_DEPS} --cflags`" 57 | CXXFLAGS="$CXXFLAGS `${PKGCONFIG} ${PKGCONFIG_DEPS} --cflags`" 58 | LIBS="`${PKGCONFIG} ${PKGCONFIG_DEPS} --libs` $LIBS" 59 | fi 60 | 61 | AC_SUBST(PKGCONFIG_DEPS) 62 | 63 | SHLIBEXT="${shrext_cmds}" 64 | AC_SUBST(SHLIBEXT) 65 | ]) 66 | 67 | 68 | # 69 | # EOF 70 | # 71 | -------------------------------------------------------------------------------- /m4/cxx-project-init.m4: -------------------------------------------------------------------------------- 1 | dnl -*- mode: autoconf -*- 2 | dnl 3 | dnl Autoconf macro initialize a basic C++ project with a few custom options 4 | dnl Synopsis: 5 | dnl 6 | dnl CXX_PROJECT_INIT 7 | dnl 8 | 9 | 10 | AC_DEFUN([CXX_PROJECT_INIT], 11 | [ 12 | # Workaround for older autoconf versions (< 2.60) 13 | if test "x$docdir" == "x"; then 14 | docdir='${datadir}/doc/${PACKAGE_TARNAME}' 15 | AC_SUBST(docdir) 16 | fi 17 | 18 | # Checks for tools: 19 | 20 | AC_CHECK_PROGS(GREP, grep, false) 21 | AC_CHECK_PROGS(SED, sed, false) 22 | 23 | AC_CHECK_PROGS(DOXYGEN, doxygen, false) 24 | AM_CONDITIONAL([COND_DOXYGEN], [test "$DOXYGEN" != "false"]) 25 | 26 | AC_CHECK_PROGS(PKGCONFIG, pkg-config, false) 27 | AM_CONDITIONAL([COND_PKGCONFIG], [test "$PKGCONFIG" != "false"]) 28 | ]) 29 | 30 | 31 | # 32 | # EOF 33 | # 34 | -------------------------------------------------------------------------------- /src/Makefile.am: -------------------------------------------------------------------------------- 1 | MAINTAINERCLEANFILES = Makefile.in 2 | 3 | EXTRA_DIST = testimage.pnm 4 | 5 | lib_LTLIBRARIES = libblitzwave.la 6 | 7 | libblitzwave_la_SOURCES = arrayTools.cxx Wavelet.cxx WaveletDecomp.cxx 8 | libblitzwave_la_headers = arrayTools.h WaveletDecomp.h Wavelet.h 9 | 10 | pkginclude_HEADERS = $(libblitzwave_la_headers) 11 | 12 | noinst_PROGRAMS = arrayTools-test WaveletDecomp-test Wavelet-test 13 | 14 | arrayTools_test_SOURCES = arrayTools-test.cxx 15 | arrayTools_test_LDADD = libblitzwave.la 16 | arrayTools_test_LDFLAGS = -static 17 | 18 | WaveletDecomp_test_SOURCES = WaveletDecomp-test.cxx 19 | WaveletDecomp_test_LDADD = libblitzwave.la 20 | WaveletDecomp_test_LDFLAGS = -static 21 | 22 | Wavelet_test_SOURCES = Wavelet-test.cxx 23 | Wavelet_test_LDADD = libblitzwave.la 24 | Wavelet_test_LDFLAGS = -static 25 | -------------------------------------------------------------------------------- /src/Wavelet-test.cxx: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003-2008 Oliver Schulz 2 | 3 | // This program is free software; you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation; either version 2 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // This program is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with this program; if not, write to the Free Software 15 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 | 17 | 18 | #include "Wavelet.h" 19 | #include "WaveletDecomp.h" 20 | 21 | using namespace std; 22 | using namespace bwave; 23 | 24 | 25 | int main(int argc, char *argv[], char *envp[]) { 26 | cout << WL_CDF_1_1 << endl; 27 | cout << WL_CDF_2_2 << endl; 28 | 29 | assert ( WL_HAAR == WL_CDF_1_1 ); 30 | assert ( !(WL_HAAR == WL_CDF_2_2) ); 31 | 32 | return 0; 33 | } 34 | -------------------------------------------------------------------------------- /src/Wavelet.cxx: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003-2008 Oliver Schulz 2 | 3 | // This program is free software; you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation; either version 2 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // This program is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with this program; if not, write to the Free Software 15 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 | 17 | 18 | #include "Wavelet.h" 19 | #include "WaveletDecomp.h" 20 | 21 | using namespace std; 22 | 23 | namespace bwave { 24 | 25 | 26 | Wavelet::LiftingStep::LiftingStep (Type t, int o, double d, double c0) 27 | : m_type(t), m_origin(o), m_coeffs(1), m_divisor(d) { m_coeffs[0]=c0; } 28 | 29 | Wavelet::LiftingStep::LiftingStep (Type t, int o, double d, double c0, double c1) 30 | : m_type(t), m_origin(o), m_coeffs(2), m_divisor(d) { m_coeffs[0]=c0; m_coeffs[1]=c1; } 31 | 32 | Wavelet::LiftingStep::LiftingStep (Type t, int o, double d, double c0, double c1, double c2) 33 | : m_type(t), m_origin(o), m_coeffs(3), m_divisor(d) { m_coeffs[0]=c0; m_coeffs[1]=c1; m_coeffs[2]=c2; } 34 | 35 | Wavelet::LiftingStep::LiftingStep (Type t, int o, double d, double c0, double c1, double c2, double c3) 36 | : m_type(t), m_origin(o), m_coeffs(4), m_divisor(d) { m_coeffs[0]=c0; m_coeffs[1]=c1; m_coeffs[2]=c2; m_coeffs[3]=c3; } 37 | 38 | Wavelet::LiftingStep::LiftingStep (Type t, int o, double d, double c0, double c1, double c2, double c3, double c4) 39 | : m_type(t), m_origin(o), m_coeffs(5), m_divisor(d) { m_coeffs[0]=c0; m_coeffs[1]=c1; m_coeffs[2]=c2; m_coeffs[3]=c3; m_coeffs[4]=c4; } 40 | 41 | Wavelet::LiftingStep::LiftingStep (Type t, int o, double d, double c0, double c1, double c2, double c3, double c4, double c5) 42 | : m_type(t), m_origin(o), m_coeffs(6), m_divisor(d) { m_coeffs[0]=c0; m_coeffs[1]=c1; m_coeffs[2]=c2; m_coeffs[3]=c3; m_coeffs[4]=c4; m_coeffs[5]=c5; } 43 | 44 | 45 | bool Wavelet::LiftingStep::operator==(const LiftingStep &s) const { 46 | if (!( (type()==s.type()) && equals(origin(), s.origin()) && equals(size(), s.size()) 47 | && equals(divisor(), s.divisor()) )) return false; 48 | for (int i=0; i0 ? " + " : " ") ); 65 | if (!Wavelet::equals(fabs(s.coeff(i)),1.0)) os << fabs(s.coeff(i)) << " "; 66 | os << src << "(i" << (s.origin()+i > 0 ? "+" : ""); 67 | if (s.origin()+i != 0) os << s.origin()+i; 68 | os << ")"; 69 | } 70 | os << " )"; 71 | } 72 | else if ( (s.type()==Wavelet::LiftingStep::SSCALE) || 73 | (s.type()==Wavelet::LiftingStep::DSCALE) ) 74 | { 75 | string trg = ( s.type()==Wavelet::LiftingStep::SSCALE ? "s" : "d" ); 76 | os << trg << "-scaling: "; 77 | os << trg << "(i) = " << s.coeff(0); 78 | if (s.divisor()!=1.) os << "/" << s.divisor(); 79 | os << " * " << trg << "(i)"; 80 | } 81 | else assert(false); 82 | 83 | return os; 84 | } 85 | 86 | 87 | bool Wavelet::equals(double x, double y) 88 | { return fabs(x-y) < std::numeric_limits::epsilon()*2; } 89 | 90 | 91 | bool Wavelet::operator==(const Wavelet &w) const { 92 | if (!( equals(steps(), w.steps()) && equals(normS(), w.normS()) 93 | && equals(normD(), w.normD()) )) return false; 94 | for (int i=0; i Wavelet::forwardFkt(unsigned int size, 111 | int scale, unsigned int trans) const 112 | { 113 | using namespace blitz; 114 | WaveletDecomp<1> wldec(*this, NONSTD_DECOMP, ::abs(scale), NESTED_COEFFS); 115 | Array data(size); data=0; 116 | for (unsigned int i=0; i+1 tmp(size); tmp=0; tmp(i)=1; 118 | wldec.apply(tmp); 119 | data(i) = wldec.coeffs(tmp, shape(scale))(trans) * wldec.normFactor(shape(scale)); 120 | } 121 | return data; 122 | } 123 | 124 | 125 | blitz::Array Wavelet::inverseFkt(unsigned int size, 126 | int scale, unsigned int trans) const 127 | { 128 | using namespace blitz; 129 | WaveletDecomp<1> wldec(*this, NONSTD_DECOMP, ::abs(scale), NESTED_COEFFS); 130 | Array data(size); data=0; 131 | wldec.coeffs(data, shape(scale))(trans) = 1 / wldec.normFactor(shape(scale)); 132 | wldec.applyInv(data); 133 | return data; 134 | } 135 | 136 | 137 | 138 | std::ostream & operator<<(std::ostream &os, const Wavelet &w) { 139 | os << "Wavelet: " << w.name() << endl; 140 | // os << "\tCoefficient initialization:" << endl; 141 | // os << "\t\tLF coefficients s(i) = data(2i)" << endl; 142 | // os << "\t\tHF coefficients d(i) = data(2i+1)." << endl; 143 | os << "\tLifting steps:" << endl; 144 | for (int i=0; i 2 | 3 | // This program is free software; you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation; either version 2 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // This program is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with this program; if not, write to the Free Software 15 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 | 17 | 18 | #ifndef WAVELET_H 19 | #define WAVELET_H 20 | 21 | #include 22 | #include 23 | #include 24 | #include 25 | #include 26 | #include 27 | #include 28 | 29 | #include "arrayTools.h" 30 | 31 | namespace bwave { 32 | 33 | 34 | /// @brief General Wavelet class. 35 | /// 36 | /// Instances define specific lifting schemes and therefore specific 37 | /// wavelets. Keep your lifting steps integer compatible if you want 38 | /// do operate on both integer an floating point data-types. 39 | /// Some constant instances of this class are available for instant 40 | /// usage, for example @c WL_HAAR and @c WL_D_4. 41 | 42 | class Wavelet { 43 | public: 44 | /// @brief Compare two numbers within numeric limits. 45 | /// @return @c true if @c x and @c y and (almost) equal, @c false if not. 46 | static bool equals(double x, double y); 47 | 48 | public: 49 | /// @brief Superclass for LiftingStep and other possible components 50 | /// / operations defining a wavelet. 51 | 52 | class WaveletComponent { 53 | public: 54 | virtual ~WaveletComponent() { } 55 | }; 56 | 57 | /// @brief Instances define a lifting step in a wavelet lifting scheme. 58 | /// 59 | /// A lifting step consists of a filter and a divisor. 60 | /// When applied, the lifting step filters one of two 61 | /// given data channels (s and d), divides the filtered values by 62 | /// the divisor and then adds/subtracts them to/from the 63 | /// data in the other channel. The divisor is necessary 64 | /// for integer lifting, use only integer filter coefficients 65 | /// and integer divisor for integer compatibility. You can use such 66 | /// an integer compatible lifting for both integer and floating point 67 | /// data-types. Divisors which are powers of two will result 68 | /// in much faster computation. 69 | /// 70 | /// In addition to classical primal/dual lifting steps you 71 | /// can specify scaling steps to scale the d- or s-channel. 72 | /// However, scaling steps lead to information loss in at least 73 | /// one transformation direction when operating on integer data. 74 | 75 | class LiftingStep : public WaveletComponent { 76 | public: 77 | /// @brief Constants to model lifting step types. 78 | enum Type { PRIMAL, DUAL, SSCALE, DSCALE }; 79 | 80 | protected: 81 | Type m_type; 82 | int m_origin; 83 | std::vector m_coeffs; 84 | double m_divisor; 85 | 86 | template inline void applyFS 87 | (blitz::Array &s, blitz::Array &d, bool inverse, ExtensionMode be) const; 88 | 89 | public: 90 | /// @brief Get type of lifting. 91 | /// @return PRIMAL for a primal, DUAL for a dual lifting step, 92 | /// SSCALE, DSCALE for a scaling step. 93 | Type type() const { return m_type; } 94 | 95 | /// @brief Get the origin of the lifting step filter. 96 | /// @return The relative position of the first filter coefficient 97 | /// for the convolution. 98 | int origin() const { return m_origin; } 99 | 100 | /// @brief Get the lifting step filter size. 101 | /// @return The number of filter coefficients. 102 | int size() const { return int(m_coeffs.size()); } 103 | 104 | /// @brief Get a filter coefficient. 105 | /// @param i index of the coefficient (i>=0) 106 | /// @return The i-th filter coefficient. 107 | double coeff(int i) const { return m_coeffs[i]; } 108 | 109 | /// @brief Get the divisor. 110 | /// @return The lifting step divisor. 111 | double divisor() const { return m_divisor; } 112 | 113 | /// @brief Apply the lifting step on some data. 114 | /// @param s "Low-frequency-" or "Phi-" data channel. 115 | /// @param d "High-frequency-" or "Psi-" data channel. 116 | /// @param inverse Do inverse lifting. 117 | /// @param be Use this extension mode for boundary handling. 118 | template inline void apply 119 | (blitz::Array &s, blitz::Array &d, bool inverse, ExtensionMode be=CONSTANT_EXT) const; 120 | 121 | /// @brief Default constructor. 122 | LiftingStep () {} 123 | 124 | /// @brief Construct a LiftingStep from it's specification. 125 | /// @param t PRIMAL for a primal, DUAL for a dual lifting step, 126 | /// SSCALE, DSCALE for a scaling step. 127 | /// @param o Filter origin. 128 | /// @param d Divisor. 129 | /// @param c0 First filter coefficient, use @c c1, @c c2, etc. for more. 130 | /// 131 | /// Use only this constructor (i.e. use only one filter coefficient) 132 | /// to specify a scaling step. 133 | LiftingStep (Type t, int o, double d, double c0); 134 | /// @see LiftingStep (Type t, int o, double d, double c0) 135 | LiftingStep (Type t, int o, double d, double c0, double c1); 136 | /// @see LiftingStep (Type t, int o, double d, double c0) 137 | LiftingStep (Type t, int o, double d, double c0, double c1, double c2); 138 | /// @see LiftingStep (Type t, int o, double d, double c0) 139 | LiftingStep (Type t, int o, double d, double c0, double c1, double c2, double c3); 140 | /// @see LiftingStep (Type t, int o, double d, double c0) 141 | LiftingStep (Type t, int o, double d, double c0, double c1, double c2, double c3, double c4); 142 | /// @see LiftingStep (Type t, int o, double d, double c0) 143 | LiftingStep (Type t, int o, double d, double c0, double c1, double c2, double c3, double c4, double c5); 144 | 145 | /// @brief Compare two lifting steps. 146 | /// @param s target to compare with 147 | /// @return @c true if step types, filters and divisors are equal, 148 | /// @c false if not. 149 | bool operator==(const LiftingStep &s) const; 150 | 151 | /// @brief Destructor. 152 | virtual ~LiftingStep() {} 153 | }; 154 | 155 | protected: 156 | std::string m_spec; 157 | double m_nS, m_nD; 158 | std::vector m_steps; 159 | 160 | public: 161 | /// @brief Get the name of the wavelet. 162 | const std::string& name() const { return m_spec; } 163 | 164 | /// @brief Query if wavelet is integer compatible. 165 | /// @return @c true if wavelet is integer compatible, @c false if not. 166 | /// 167 | /// Integer compatibility means that wavelet decomposition and 168 | /// reconstruction do not use floating point operations on the 169 | /// data. Wavelet decomposition and reconstruction may still 170 | /// lead to information loss on integer data if the lifting 171 | /// scheme contains scaling steps. 172 | /// 173 | /// Not implemented yet! 174 | bool integerCompatible() const; 175 | 176 | /// @brief Query if wavelet and scaling coefficients are normalized after 177 | /// lifting. 178 | /// @return @c true if normS() and normD() both equal 1, 179 | /// @c false if not. 180 | bool normalized() const; 181 | 182 | /// @brief Get number of steps in the lifting scheme. 183 | int steps() const { return int(m_steps.size()); } 184 | 185 | /// @brief Get a step of the lifting scheme. 186 | /// @param i index of the step to get (0 <= i < steps()). 187 | const LiftingStep& liftingStep(int i) const { return m_steps[i]; } 188 | 189 | /// @brief Get the normalization factor for the scaling coefficients. 190 | /// 191 | /// Wavelet and scaling coefficients are not automatically normalized 192 | /// after lifting, otherwise integer applications would not be possible. 193 | double normS() const { return m_nS; } 194 | 195 | /// @brief Get the normalization factor for the wavelet coefficients. 196 | /// @see normS(). 197 | double normD() const { return m_nD; } 198 | 199 | /// @brief Compare with another wavelet. 200 | /// @param w the wavelet to compare with. 201 | /// @return @c true if the wavelets are equal, @c false if not. 202 | bool operator==(const Wavelet &w) const; 203 | 204 | /// @brief Apply the lifting scheme on the data channels s and d. 205 | /// @param s usually initialised with the even original data values, 206 | /// contains the scaling coefficients after lifting. 207 | /// @param d usually initialised with the odd original data values, 208 | /// contains the wavelet coefficients after lifting. 209 | /// @param be extension method to use for boundary handling. 210 | template void lift( blitz::Array &s, 211 | blitz::Array &d, ExtensionMode be=CONSTANT_EXT) const; 212 | 213 | /// @brief Apply the inverse lifting scheme on the data channels s and d. 214 | /// @param s usually initialised with the scaling coefficients. 215 | /// @param d usually initialised with the wavelet coefficients. 216 | /// @param be extension method to use for boundary handling. 217 | template void invLift( blitz::Array &s, 218 | blitz::Array &d, ExtensionMode be=CONSTANT_EXT) const; 219 | 220 | 221 | /// @brief Get sampled values (i.e. the form) of the forward transformation 222 | /// scaling or wavelet function. 223 | /// @param size number of samples. 224 | /// @param scale the scale of the function, use positive values to generate 225 | /// scaling, negative values to generate wavelet functions. 226 | /// @param trans the translation of the function. 227 | /// @return Array of function values. 228 | /// 229 | /// Useful for getting the data to plot wavelet and scaling functions. Use 230 | /// a higher number of samples for better resolution. 231 | blitz::Array forwardFkt(unsigned int size = 1<<9, int scale = 6, 232 | unsigned int trans = 3) const; 233 | 234 | /// @brief Get sampled values (i.e. the form) of the inverse transformation 235 | /// scaling or wavelet function. 236 | /// @see forwardFkt(unsigned int size = 1<<9, int scale = 6, unsigned int trans = 3) 237 | blitz::Array inverseFkt(unsigned int size = 1<<9, int scale = 6, 238 | unsigned int trans = 3) const; 239 | 240 | /// @brief Construct an empty wavelet. 241 | Wavelet() {} 242 | 243 | /// @brief Construct a wavelet and it's lifting scheme. 244 | /// @param name the name of the wavelet. 245 | /// @param ns normalization factor for scaling coefficients. 246 | /// @param nd normalization factor for wavelet coefficients. 247 | /// @param s0 first lifting step. 248 | /// @param s1 second lifting step, more steps can be specified. 249 | /// 250 | /// The normalisation factors can later be queried using normS() 251 | /// and normD(). 252 | Wavelet(const std::string &name, double ns, double nd, const LiftingStep &s0, const LiftingStep &s1); 253 | /// @see Wavelet(const std::string &name, double ns, double nd, const LiftingStep &s0, const LiftingStep &s1) 254 | Wavelet(const std::string &name, double ns, double nd, const LiftingStep &s0, const LiftingStep &s1, const LiftingStep &s2); 255 | /// @see Wavelet(const std::string &name, double ns, double nd, const LiftingStep &s0, const LiftingStep &s1) 256 | Wavelet(const std::string &name, double ns, double nd, const LiftingStep &s0, const LiftingStep &s1, const LiftingStep &s2, const LiftingStep &s3); 257 | 258 | virtual ~Wavelet() {} 259 | }; 260 | 261 | 262 | /// @brief Print a description a lifting step. 263 | /// @param os the stream to print to. 264 | /// @param s the lifting step to print. 265 | std::ostream & operator<<(std::ostream &os, const Wavelet::LiftingStep &s); 266 | 267 | /// @brief Print a description a wavelet. 268 | /// @param os the stream to print to. 269 | /// @param w the wavelet to print. 270 | std::ostream & operator<<(std::ostream &os, const Wavelet &w); 271 | 272 | 273 | /// @brief The Cohen-Daubechies-Feauveau (CDF) (1,1) wavelet, 274 | /// identical to the Haar wavelet. 275 | extern const Wavelet WL_CDF_1_1; 276 | 277 | /// @brief The CDF(2,2) biorthogonal wavelet. 278 | /// 279 | /// This wavelet (also known as LeGall(5,3)) is used in 280 | /// the JPEG2000 standard. 281 | extern const Wavelet WL_CDF_2_2; 282 | 283 | /// @brief The CDF(3,1) biorthogonal wavelet. 284 | extern const Wavelet WL_CDF_3_1; 285 | 286 | /// @brief The CDF(3,3) biorthogonal wavelet. 287 | extern const Wavelet WL_CDF_3_3; 288 | 289 | /// @brief The CDF(4,2) biorthogonal wavelet. 290 | extern const Wavelet WL_CDF_4_2; 291 | 292 | /// @brief The CDF(9,7) biorthogonal wavelet (used in JPEG 2000). 293 | /// 294 | /// This wavelet (often called Daubechies(9,7) or just 9/7-filter 295 | /// in the literature) is used in the JPEG2000 standard. 296 | extern const Wavelet WL_CDF_97; 297 | 298 | /// @brief The Haar wavelet. 299 | extern const Wavelet WL_HAAR; 300 | 301 | /// @brief The LeGall(5,3) biorthogonal wavelet, identical to CDF(2,2). 302 | /// 303 | /// This wavelet is used in the JPEG2000 standard. 304 | extern const Wavelet WL_LEG_5_3; 305 | 306 | /// @brief A cubic-spline biorthogonal wavelet, equals CDF(4,2) except 307 | /// for normalization. 308 | /// 309 | /// Lifting includes a scaling step leading to information loss for 310 | /// integer values during recomposition. 311 | extern const Wavelet WL_CUBIC_SPLINE; 312 | 313 | /// @brief The Daubechies D4 wavelet. 314 | extern const Wavelet WL_D_4; 315 | 316 | 317 | template void Wavelet::LiftingStep::applyFS 318 | (blitz::Array &s, blitz::Array &d, bool inverse, ExtensionMode be) const 319 | { 320 | assert(size() == tp_size); 321 | tp_Type coeffs[tp_size]; 322 | for (int i=0; i liftFilter(origin(), coeffs, (tp_Type) divisor()); 324 | 325 | if (type() == PRIMAL) { 326 | if (!inverse) liftFilter.applyAdd(d, s, be); 327 | else liftFilter.applySub(d, s, be); 328 | } else if (type() == DUAL) { 329 | if (!inverse) liftFilter.applyAdd(s, d, be); 330 | else liftFilter.applySub(s, d, be); 331 | } else if (type() == SSCALE) { 332 | if (!inverse) { 333 | s *= tp_Type(coeff(0)); 334 | if (divisor()!=1.) s /= tp_Type(divisor()); //!! Add speed-up for divisor()==2^n 335 | } 336 | else { 337 | if (divisor()!=1.) s *= tp_Type(divisor()); //!! Add speed-up for divisor()==2^n 338 | s /= tp_Type(coeff(0)); 339 | } 340 | } else if (type() == DSCALE) { 341 | if (!inverse) { 342 | d *= tp_Type(coeff(0)); 343 | if (divisor()!=1.) d /= tp_Type(divisor()); //!! Add speed-up for divisor()==2^n 344 | } 345 | else { 346 | if (divisor()!=1.) d *= tp_Type(divisor()); //!! Add speed-up for divisor()==2^n 347 | d /= tp_Type(coeff(0)); 348 | } 349 | } else { 350 | assert(false); 351 | } 352 | } 353 | 354 | 355 | template void Wavelet::LiftingStep::apply 356 | (blitz::Array &s, blitz::Array &d, bool inverse, ExtensionMode be) const 357 | { 358 | switch(size()) { 359 | case 1: applyFS(s, d, inverse, be); break; 360 | case 2: applyFS(s, d, inverse, be); break; 361 | case 3: applyFS(s, d, inverse, be); break; 362 | //case 4: applyFS(s, d, inverse, be); break; 363 | //case 5: applyFS(s, d, inverse, be); break; 364 | //case 6: applyFS(s, d, inverse, be); break; 365 | default: assert(false); 366 | } 367 | } 368 | 369 | 370 | template void Wavelet::lift( blitz::Array &s, 371 | blitz::Array &d, ExtensionMode be) const 372 | { 373 | for (int step=0; step void Wavelet::invLift( blitz::Array &s, 379 | blitz::Array &d, ExtensionMode be) const 380 | { 381 | for (int step=steps()-1; step>=0; --step) 382 | liftingStep(step).apply(s, d, true, be); 383 | } 384 | 385 | 386 | } // namespace bwave 387 | 388 | #endif 389 | -------------------------------------------------------------------------------- /src/WaveletDecomp-test.cxx: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003-2008 Oliver Schulz 2 | 3 | // This program is free software; you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation; either version 2 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // This program is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with this program; if not, write to the Free Software 15 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 | 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #include "WaveletDecomp.h" 23 | 24 | using namespace std; 25 | using namespace blitz; 26 | using namespace bwave; 27 | 28 | 29 | int main(int argc, char *argv[], char *envp[]) { 30 | try { 31 | Array img; 32 | if (argc==2) readPNM(argv[1], img); 33 | else readPNM("testimage.pnm", img); 34 | 35 | typedef int numtype; 36 | 37 | Array intimg(img.shape()); 38 | intimg = numtype(1)*img; 39 | 40 | Array origData(intimg.shape()); origData=intimg; 41 | 42 | double timer = runTime(); 43 | WaveletDecomp<3> decomp(WL_CDF_2_2, NONSTD_DECOMP, 0); 44 | decomp.dimSelection(TinyVector(true, true, false)); 45 | 46 | 47 | // Speed test: 48 | for(int i=0; i<100; ++i) { 49 | decomp.apply(intimg); 50 | decomp.applyInv(intimg); 51 | } 52 | 53 | timer = runTime() - timer; 54 | cout << "Time: " << (double) timer << " s" << endl; 55 | cout << "MaxDiff (must be << 1): " << max(abs(origData-intimg)) << endl; 56 | 57 | 58 | // Coefficient sorting test: 59 | 60 | TinyVector decDepth = decomp.apply(intimg); 61 | Array sepimg(intimg.shape()); 62 | WaveletDecomp<3> decomp2(decomp, SEPARATED_COEFFS); 63 | Array, 1> idx( decomp2.indices(intimg) ); 64 | for (int i=0; i recDepth = decomp.applyInv(intimg); 70 | cout << "MaxDiff (must be << 1): " << max(abs(origData-intimg)) << endl; 71 | 72 | cout << "Decomposition depth = " << decDepth << endl; 73 | cout << "Recomposition depth = " << recDepth << endl; 74 | /*cout << "Decomposition indices:" << endl; 75 | for (int i=0; i index = idx(ix); 85 | Array coeffs = decomp.coeffs(intimg, index); 86 | 87 | // obsolete: 88 | // int level=0, type=0; 89 | // for (int i=0; i<3; ++i) { 90 | // level = max(level, abs(index(i))); 91 | // if (index(i)<0) ++type; 92 | // } 93 | // 94 | // double thresh = 10; 95 | // thresh *= pow( sqrt(2.0) , double(type)); 96 | // thresh /= pow( sqrt(2.0) , 2*double(level)); 97 | 98 | double thresh = 9 / decomp.normFactor(index); 99 | numtype ithresh = numtype(thresh); 100 | 101 | for (int i=0; i ithresh ? coeffs(i,j,k) : 0; 105 | } 106 | 107 | 108 | for (int ix=0; ix outimg(intimg.shape()); 124 | 125 | sepimg = sepimg / 2 + 128; 126 | outimg = (unsigned char) 1*sepimg; 127 | writePNM("decomp.pnm", outimg); 128 | 129 | //intimg = abs(origData - intimg); 130 | outimg = (unsigned char) 1*intimg; 131 | writePNM("recomp.pnm", outimg); 132 | 133 | 134 | // Wavelet form generation: 135 | 136 | WaveletDecomp<1> wldec(WL_CDF_2_2, NONSTD_DECOMP, 0, NESTED_COEFFS); 137 | Array rwavelet(256); rwavelet=0; 138 | wldec.coeffs(rwavelet, shape(-6))(1) = 1 / wldec.normFactor(shape(-6)); 139 | wldec.applyInv(rwavelet); 140 | 141 | Array awavelet(256); awavelet=0; 142 | for (int i=0; i<255; ++i) { 143 | Array wltmp(256); wltmp=0; wltmp(i)=1; 144 | wldec.apply(wltmp); 145 | awavelet(i) = wldec.coeffs(wltmp, shape(-6))(1) * wldec.normFactor(shape(-6)); 146 | } 147 | 148 | cout << "sum(a-wavelet * a-wavelet): " << sum(awavelet*awavelet) << endl; 149 | cout << "sum(r-wavelet * r-wavelet): " << sum(rwavelet*rwavelet) << endl; 150 | cout << "sum(a-wavelet * r-wavelet): " << sum(awavelet*rwavelet) << endl; 151 | 152 | ofstream wlFormOut("waveletForm.txt"); 153 | for (int i=0; i 2 | 3 | // This program is free software; you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation; either version 2 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // This program is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with this program; if not, write to the Free Software 15 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 | 17 | 18 | #include "WaveletDecomp.h" 19 | 20 | using namespace std; 21 | using namespace blitz; 22 | 23 | namespace bwave { 24 | 25 | } // namespace bwave 26 | -------------------------------------------------------------------------------- /src/WaveletDecomp.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003-2013 Oliver Schulz 2 | 3 | // This program is free software; you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation; either version 2 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // This program is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with this program; if not, write to the Free Software 15 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 | 17 | 18 | #ifndef WAVELETDECOMP_H 19 | #define WAVELETDECOMP_H 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | #include "Wavelet.h" 26 | 27 | namespace bwave { 28 | 29 | 30 | /// @brief Decomposition type. 31 | /// 32 | /// Possible values for this enum are @c STD_DECOMP for 33 | /// standard decompositions and @c NONSTD_DECOMP for non-standard 34 | /// decompositions. 35 | 36 | enum DecompType { 37 | STD_DECOMP=0, 38 | NONSTD_DECOMP=1 39 | }; 40 | 41 | 42 | /// @brief Wavelet/Scaling coefficient storage mode. 43 | /// 44 | /// @c NESTED_COEFFS specifies the nested coefficients storage 45 | /// mode native to the in-place lifting scheme operations. 46 | /// Coefficients of different type (scale) are stored alternate 47 | /// in memory. 48 | /// 49 | /// @c SEPARATED_COEFFS specifies the separated (or isotropic) 50 | /// storage scheme originally established by Mallat. The 51 | /// coefficients of equal type (scale) are stored in contiguous 52 | /// blocks. 53 | /// 54 | /// The class WaveletDecomp provides a method @c coeffs(...) to 55 | /// extract coefficients of equal type, so coefficients can be 56 | /// accessed transparently and independent of the storage scheme. 57 | 58 | enum CoeffStorage { 59 | NESTED_COEFFS=0, 60 | SEPARATED_COEFFS=1 61 | }; 62 | 63 | 64 | /// @brief Represents a specific wavelet decomposition 65 | /// 66 | /// Instances of WaveletDecomp specify the details of 67 | /// a wavelet decomposition, which can then be applied 68 | /// to data of any type but fixed dimensionality. 69 | /// The data dimensionality is set with the template 70 | /// parameter @c tp_rank. 71 | 72 | template class WaveletDecomp { 73 | protected: 74 | Wavelet m_wavelet; 75 | DecompType m_decomp; 76 | CoeffStorage m_storageMode; 77 | ExtensionMode m_extMode; 78 | int m_maxLevel; 79 | blitz::TinyVector m_dimSelect; 80 | 81 | template inline void trafoStep 82 | (blitz::Array &data, int targetDim, bool inverse) const; 83 | 84 | template inline blitz::TinyVector waveletDecompose 85 | (blitz::Array &data, int maxlevel=0) const; 86 | 87 | template inline blitz::TinyVector waveletRecompose 88 | (blitz::Array &data, int maxlevel=0) const; 89 | 90 | public: 91 | /// @brief Get the wavelet used in this decomposition. 92 | const Wavelet& wavelet() const { return m_wavelet; } 93 | 94 | /// @brief Get the type of this decomposition (i.e. standard 95 | /// or non-standard). 96 | DecompType decompType() const { return m_decomp; } 97 | 98 | /// @brief Get the maximum decomposition level. 99 | int maxLevel() const { return m_maxLevel; } 100 | 101 | /// @brief Get the mode in which the wavelet/scaling coefficients 102 | /// are stored. 103 | /// @see CoeffStorage 104 | CoeffStorage storageMode() const { return m_storageMode; } 105 | 106 | /// @brief Set the mode in which the wavelet/scaling coefficients 107 | /// are stored. 108 | /// @param newCS the new storage mode 109 | /// 110 | /// Note that lifting-based operations (i.e. @c apply(...) and 111 | /// @c applyInv(...) only work in @c NESTED_COEFFS mode. 112 | /// @see CoeffStorage 113 | CoeffStorage storageMode(CoeffStorage newCS) 114 | { return m_storageMode=newCS; } 115 | 116 | /// @brief Get the current method used for boundary handling / array 117 | /// extension. 118 | /// @see ExtensionMode 119 | ExtensionMode extensionMode() const { return m_extMode; } 120 | 121 | /// @brief Set the method to be used for boundary handling / array 122 | /// extension. 123 | /// @param newEM The new array extension method. 124 | /// @see ExtensionMode 125 | ExtensionMode extensionMode(ExtensionMode newEM) 126 | { return m_extMode=newEM; } 127 | 128 | /// @brief Get the selected dimensions. 129 | const blitz::TinyVector& selectedDims() { return m_dimSelect; } 130 | 131 | /// @brief Query if decomposition will be applied in array dimension @c dim. 132 | bool dimSelected(int dim) const { return m_dimSelect(dim); } 133 | 134 | /// @brief Get the dimensions selected for decomposition. 135 | /// @see dimSelection(blitz::TinyVector selection) 136 | blitz::TinyVector dimSelection() const { return m_dimSelect; } 137 | 138 | /// @brief Select the dimensions in which to apply the wavelet decomposition. 139 | /// @param selection A boolean vector, set true for the dimensions in 140 | /// which to apply decomposition. 141 | /// 142 | /// The wavelet decomposition can be specified to work in all or only 143 | /// some dimensions (data directions). All possible combinations are valid. 144 | blitz::TinyVector dimSelection(blitz::TinyVector selection) 145 | { return m_dimSelect = selection; } 146 | 147 | /// @brief Apply this wavelet decomposition to a data array. 148 | /// @param data The data to be decomposed. 149 | /// @return A vector of the decomposition depths in the 150 | /// different data dimensions. 151 | /// 152 | /// Does a wavelet decomposition given on the given data. 153 | /// The data is wavelet-decomposed in-place, storageMode() must 154 | /// be @c NESTED_COEFFS. Afterwards, data array contains the 155 | /// wavelet/scaling coefficients, use the @c coeffs(..) method 156 | /// for coefficient access. 157 | /// @see coeffs(blitz::Array &data, blitz::TinyVector indices) 158 | template inline blitz::TinyVector apply 159 | (blitz::Array &data) const 160 | { 161 | assert(storageMode()==NESTED_COEFFS); 162 | return waveletDecompose(data, m_maxLevel); 163 | } 164 | 165 | /// @brief Apply the inverse wavelet transformation. 166 | /// @param data The wavelet/scaling coefficients. 167 | /// @return A vector of the recomposition depths in the 168 | /// different data dimensions. 169 | /// 170 | /// Does a wavelet recomposition using the given coefficients. 171 | /// The recomposition is done in-place, storageMode() must 172 | /// be @c NESTED_COEFFS. Afterwards, the data array contains the 173 | /// recomposed data. 174 | template inline blitz::TinyVector applyInv 175 | (blitz::Array &data) const 176 | { 177 | assert(storageMode()==NESTED_COEFFS); 178 | return waveletRecompose(data, m_maxLevel); 179 | } 180 | 181 | 182 | /// @brief Get the indices of the coefficients that this 183 | /// decomposition will/has produce(d) for the given data. 184 | /// @param data original data or transformed data. 185 | /// @return An array of coefficient scaling indices which occur 186 | /// in the decomposed data. 187 | /// 188 | /// There method is useful if you want to iterate over all 189 | /// wavelet/scaling coefficients in the decomposed data. 190 | /// Since wavelet decomposition is done in-place, it does not 191 | /// matter whether this method is called before or after decomposition 192 | /// of the data, since the data extents (which determine the possible 193 | /// indices will stay the same. 194 | /// 195 | /// @see coeffs(blitz::Array &data, blitz::TinyVector indices) 196 | template 197 | blitz::Array< blitz::TinyVector, 1> indices( 198 | const blitz::Array &data) const; 199 | 200 | /// @brief Get all wavelet/scaling coefficients of the same type 201 | /// (i.e. corresponding to basis functions differing only by 202 | /// translation) 203 | /// @param data The decomposed data to extract the coefficients from. 204 | /// @param indices An index vector specifying the coefficient type to 205 | /// extract. 206 | /// @return An array of the coefficients. This not a copy of the 207 | /// relevant parts of @c data, but a reference to them. 208 | /// 209 | /// Wavelet decomposition of multi-dimensional, non-square data array 210 | /// produces coefficients coefficients corresponding to lots of 211 | /// scaled and translated basis functions, which are themselves mixed 212 | /// products of the basic scaling and wavelet function. Coefficients 213 | /// which differ only by the translation of their basic function 214 | /// are said here to be of the same @em type. These coefficient types 215 | /// are designated here by an index vector. It's components specify the 216 | /// factory of the basis function in the respective dimensions. A 217 | /// positive value specifies a scaling function, a negative one a 218 | /// wavelet function. The component's absolute value specifies the scale 219 | /// as an exponent of 2. 220 | /// 221 | /// Example: Let Phi_i be the scaling, Psi_i be the wavelet function 222 | /// of scale i. Let the data have three dimensions x,y,z. 223 | /// Then the coefficients corresponding to the basis function 224 | /// Psi_4(x)*Phi_3(y)*Psi_3(z) would have the index vector (-4, 3, -3). 225 | /// 226 | /// The bases function Phi_0 can be said to correspond to original, 227 | /// non-decomposed data. Therefore, if data is not decomposed in 228 | /// some dimensions, the only valid index vector component in these 229 | /// dimensions is 0. 230 | /// 231 | /// @note This method does @em not check if the requested coefficient 232 | /// type exists for this decomposition and the given coefficient data. 233 | /// The method @c indices(...) can be used to get a list of valid index 234 | /// vectors. 235 | template 236 | blitz::Array coeffs(const blitz::Array &data, 237 | blitz::TinyVector indices) const; 238 | 239 | /// @brief Get the normalization factor for the specified coefficient type. 240 | /// @param indices The index vector specifying the coefficient type 241 | /// @return The factor needed to normalize the coefficients. 242 | /// 243 | /// The Wavelet and scaling coefficients are not automatically normalized 244 | /// after decomposition, otherwise integer applications would not be possible. 245 | /// Also, normalisation is unneeded or even unwanted for some applications. 246 | double normFactor(blitz::TinyVector indices) const { 247 | blitz::TinyVector baseNF(wavelet().normS(), wavelet().normD()); 248 | double norm=1; 249 | for (int i=0; i=0 ? pow(baseNF(0), indices(i)) 251 | : pow(baseNF(0), -indices(i)-1) * baseNF(1); 252 | } 253 | return norm; 254 | } 255 | 256 | 257 | /// @brief Copy other decomposition while changing coefficient storage mode 258 | /// @param other Decomposition to copy 259 | /// @param cs Coefficient storage mode 260 | /// 261 | /// Useful to work with data in different coefficient storage modes. 262 | WaveletDecomp(WaveletDecomp other, CoeffStorage cs) 263 | : m_wavelet(other.m_wavelet), m_decomp(other.m_decomp), m_storageMode(cs), 264 | m_extMode(other.m_extMode), m_maxLevel(other.m_maxLevel), m_dimSelect(other.m_dimSelect) 265 | {} 266 | 267 | /// @brief Construct a new wavelet decomposition. 268 | /// @param wavelet Wavelet to use in the decomposition. 269 | /// @param decomp Decomposition type. 270 | /// @param maxlevel Maximum decomposition depth 271 | /// @param cs Coefficient storage mode 272 | /// @param em Internal array extension / boundary handling method 273 | /// 274 | /// The decomposition can directly be applied to data after construction, 275 | /// no further preparation is necessary. 276 | /// 277 | /// @see apply(blitz::Array &data) 278 | /// @see applyInv(blitz::Array &data) 279 | WaveletDecomp(Wavelet wl, DecompType decomp=NONSTD_DECOMP, 280 | int maxlevel=0, CoeffStorage cs=NESTED_COEFFS, ExtensionMode em=CONSTANT_EXT) 281 | : m_wavelet(wl), m_decomp(decomp), m_storageMode(cs), m_extMode(em), 282 | m_maxLevel(maxlevel) 283 | { m_dimSelect = true; } 284 | }; 285 | 286 | 287 | template template 288 | inline void WaveletDecomp::trafoStep 289 | (blitz::Array &data, int targetDim, bool inverse) const 290 | { 291 | using namespace blitz; 292 | assert( targetDim < tp_rank ); 293 | TinyVector stride=1, lboundS=data.lbound(), lboundD=data.lbound(); 294 | stride(targetDim)=2; 295 | lboundD(targetDim)+=1; 296 | 297 | TinyVector uboundS, uboundD; 298 | for (int dim=0; dim subsetS(lboundS, uboundS, stride); 304 | StridedDomain subsetD(lboundD, uboundD, stride); 305 | blitz::Array s( data(subsetS) ); 306 | blitz::Array d( data(subsetD) ); 307 | 308 | int n = data.size() / data.extent(targetDim); 309 | 310 | TinyVector position = data.lbound(); 311 | int lastDim = targetDim!=tp_rank-1 ? tp_rank-1 : tp_rank-2; 312 | 313 | for (int i=0; i sliceS( slice(s, targetDim, position) ); 315 | Array sliceD( slice(d, targetDim, position) ); 316 | if (!inverse) m_wavelet.lift(sliceS, sliceD, m_extMode); 317 | else m_wavelet.invLift(sliceS, sliceD, m_extMode); 318 | 319 | if (i < n-1) { 320 | position(lastDim) += 1; 321 | for (int d=lastDim; d>0; --d) { 322 | if ( (d!=targetDim) && (position(d)>data.ubound(d)) ) { 323 | position(d)=data.lbound(d); 324 | ++position(targetDim!=d-1 ? d-1 : d-2); 325 | } 326 | } 327 | } 328 | } 329 | 330 | } 331 | 332 | 333 | template template 334 | inline blitz::TinyVector 335 | WaveletDecomp::waveletDecompose 336 | (blitz::Array &data, int maxlevel) const 337 | { 338 | using namespace blitz; 339 | 340 | TinyVector depth=0; 341 | 342 | switch (decompType()) { 343 | case STD_DECOMP: assert(false); break; 344 | case NONSTD_DECOMP: { 345 | for (int dim=0; dim1) && dimSelected(dim) ) { 347 | trafoStep(data, dim, false); 348 | depth(dim) += 1; 349 | } 350 | 351 | bool descend = false; 352 | for (int dim=0; dim2) && dimSelected(dim)) descend = true; 354 | 355 | if ( descend && ((maxlevel==0) || (maxlevel>1)) ) { 356 | TinyVector stride, lbound, ubound; 357 | for (int dim=0; dim subsetS(lbound, ubound, stride); 363 | blitz::Array sub(data(subsetS)); 364 | 365 | depth += waveletDecompose(sub, maxlevel>0 ? maxlevel-1 : 0); 366 | } 367 | 368 | break; 369 | } 370 | default: assert(false); 371 | } 372 | 373 | return depth; 374 | } 375 | 376 | 377 | template template 378 | inline blitz::TinyVector 379 | WaveletDecomp::waveletRecompose 380 | (blitz::Array &data, int maxlevel) const 381 | { 382 | using namespace blitz; 383 | 384 | TinyVector depth=0; 385 | 386 | switch (decompType()) { 387 | case STD_DECOMP: assert(false); break; 388 | case NONSTD_DECOMP: { 389 | bool descend = false; 390 | for (int dim=0; dim2) && dimSelected(dim)) descend = true; 392 | 393 | if ( descend && ((maxlevel==0) || (maxlevel>1)) ) { 394 | TinyVector stride, lbound, ubound; 395 | for (int dim=0; dim subsetS(lbound, ubound, stride); 401 | blitz::Array sub(data(subsetS)); 402 | 403 | depth += waveletRecompose(sub, maxlevel>0 ? maxlevel-1 : 0); 404 | } 405 | 406 | for (int dim=tp_rank-1; dim>=0; --dim) 407 | if ( (data.extent(dim)>1) && dimSelected(dim) ) { 408 | trafoStep(data, dim, true); 409 | depth(dim) -= 1; 410 | } 411 | 412 | break; 413 | } 414 | default: assert(false); 415 | } 416 | 417 | return depth; 418 | } 419 | 420 | 421 | template template 422 | blitz::Array< blitz::TinyVector, 1> 423 | WaveletDecomp::indices( 424 | const blitz::Array &data) const 425 | { 426 | using namespace blitz; 427 | TinyVector decompDepth; 428 | Array< TinyVector, 1> idx; 429 | 430 | for (int dim=0; dim0 ? min(m_maxLevel, val) : val) : 0; 435 | } 436 | 437 | switch (decompType()) { 438 | case STD_DECOMP: assert(false); break; 439 | case NONSTD_DECOMP: { 440 | int maxLevel = max(decompDepth); 441 | idx.resize(max(1, maxLevel*(1<=level) 447 | { 448 | int offset = end-begin+1; 449 | for (int i=begin; i<=end; ++i) { 450 | idx(i+offset) = idx(i); 451 | idx(i)(dim) = -level; 452 | idx(i+offset)(dim) = level; 453 | } 454 | end += offset; 455 | } 456 | begin = end; 457 | } 458 | idx.resizeAndPreserve(end+1); 459 | break; 460 | } 461 | default: assert(false); 462 | } 463 | return idx; 464 | } 465 | 466 | 467 | template template 468 | blitz::Array WaveletDecomp::coeffs( 469 | const blitz::Array &data, 470 | blitz::TinyVector indices) const 471 | { 472 | using namespace blitz; 473 | 474 | Array c; 475 | TinyVector ubound, lbound, stride; 476 | 477 | for (int dim=0; dim=0 specifies phi(i) coeff, 480 | // i<0 specifies psi(-i) coeff; 481 | int n = data.extent(dim); 482 | 483 | if (storageMode()==NESTED_COEFFS) { 484 | // Remark: coefficient location in data(l) 485 | // for phi(i): 0 <= l <= n-1, stride = 2^i 486 | // for psi(i): 2^(i-1) <= l <= n-1, stride = 2^i 487 | stride(dim) = i>=0 ? 1 << i : 1 << -i; 488 | lbound(dim) = data.lbound()(dim) + ( i>=0 ? 0 : 1 << (-i-1) ); 489 | ubound(dim) = lbound(dim) + (data.ubound()(dim)-lbound(dim)) / stride(dim) * stride(dim); 490 | } else if (storageMode()==SEPARATED_COEFFS) { 491 | // Remark: coefficient location in data(l) 492 | // for phi(i): 0 <= l <= ceil(n/2^i)-1 493 | // for psi(i): ceil(n/2^i) <= l <= ceil(n/2^(i-1))-1 494 | // Remark: ceil(n/2^i) = (n + (1<> i; 495 | stride(dim) = 1; 496 | lbound(dim) = data.lbound()(dim) + ( i>=0 ? 0 : (n + (1<<-i) - 1) >> -i ); 497 | ubound(dim) = data.lbound()(dim) + ( i>=0 ? ( (n + (1<> i) - 1 498 | : ( (n + (1<<(-i-1)) - 1) >> (-i-1) ) - 1 ); 499 | } else assert(false); 500 | 501 | assert( lbound(dim) <= ubound(dim)); 502 | assert( lbound(dim) >= data.lbound(dim)); 503 | assert( ubound(dim) <= data.ubound(dim)); 504 | } 505 | 506 | StridedDomain subset(lbound, ubound, stride); 507 | c.reference(data(subset)); 508 | 509 | return c; 510 | } 511 | 512 | 513 | } // namespace bwave 514 | 515 | #endif 516 | -------------------------------------------------------------------------------- /src/arrayTools-test.cxx: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003-2008 Oliver Schulz 2 | 3 | // This program is free software; you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation; either version 2 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // This program is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with this program; if not, write to the Free Software 15 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 | 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #include "arrayTools.h" 23 | 24 | using namespace std; 25 | using namespace blitz; 26 | using namespace bwave; 27 | 28 | 29 | int main(int argc, char *argv[], char *envp[]) { 30 | try { 31 | // Array slicing test: 32 | Array a(4,3); 33 | a = 11, 12, 13, 34 | 21, 22, 23, 35 | 31, 32, 33, 36 | 41, 42, 43; 37 | 38 | a.reverseSelf(0); a.reverseSelf(1); 39 | a.reindexSelf(shape(1,1)); 40 | 41 | cout << a << endl; 42 | cout << slice(a, 0, shape(-55,2)) << endl; 43 | 44 | 45 | /*Array b = slice(a, 1, shape(2,-1)); 46 | 47 | cout << b << endl; 48 | 49 | cout << endl << "Array Extension: " << endl; 50 | Array ext(b.rows()+5+6); 51 | 52 | ext=0; 53 | symmExt(b, ext, -1); 54 | cout << ext << endl; 55 | 56 | ext=0; 57 | symmExt(b, ext, 18); 58 | cout << ext << endl; 59 | 60 | ext=0; 61 | symmExt(b, ext, -18); 62 | cout << ext << endl;*/ 63 | 64 | // Filter test: 65 | 66 | Array intData(256); 67 | ifstream intDataIn("intdata.txt"); 68 | for (int i=0; i> intData(i); 69 | 70 | Array filtered(intData.shape()); filtered=5; 71 | 72 | double timer = runTime(); 73 | for (int i=0; i<100000; ++i) { 74 | int filterData[6] = { 5, -39, 162, 162, -39, 5 }; 75 | GenFilter testGenFilter(-3, filterData, 256); 76 | 77 | testGenFilter.apply(intData, filtered); 78 | } 79 | timer = runTime() - timer; 80 | cout << "Time: " << timer << " s" << endl; 81 | 82 | ofstream filteredOut("filtered.txt"); 83 | for (int i=0; i image; 88 | readPNM("testimage.pnm", image); 89 | writePNM("out.pnm", image); !!*/ 90 | 91 | // Array fill test: 92 | 93 | { 94 | cout << endl; 95 | 96 | Array src(6); src = 2,4,5,7,8,9; 97 | Array trg(13); trg = -1; 98 | src.reindexSelf(shape(3)); trg.reindexSelf(shape(-2)); 99 | 100 | cout << src << endl; 101 | 102 | ExtensionMode em = CONSTANT_EXT; 103 | 104 | fill(trg, src, -100, em); //cout << trg << endl; 105 | fill(trg, src, -5, em); //cout << trg << endl; 106 | fill(trg, src, 3, em); cout << trg << endl; 107 | fill(trg, src, 7, em); //cout << trg << endl; 108 | fill(trg, src, 100, em); //cout << trg << endl; 109 | } 110 | } 111 | catch(std::exception &e) { 112 | cerr << endl << endl << "Exception: " << e.what() << endl << endl; 113 | } 114 | 115 | return 0; 116 | } 117 | -------------------------------------------------------------------------------- /src/arrayTools.cxx: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003-2008 Oliver Schulz 2 | 3 | // This program is free software; you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation; either version 2 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // This program is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with this program; if not, write to the Free Software 15 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 | 17 | 18 | #include 19 | #include 20 | #include 21 | 22 | #include "arrayTools.h" 23 | 24 | using namespace std; 25 | using namespace blitz; 26 | 27 | namespace bwave { 28 | 29 | 30 | double runTime() { 31 | timeval t; 32 | gettimeofday(&t, 0); 33 | return double(t.tv_sec) + double(t.tv_usec)/double(1000000); 34 | } 35 | 36 | 37 | void readPNM(const std::string &filename, blitz::Array &target) { 38 | std::ifstream source(filename.c_str()); 39 | 40 | string format; format+=source.get(); format+=source.get(); 41 | 42 | int w, h, maxval; 43 | source >> w >> h >> maxval; 44 | source.get(); 45 | 46 | if (maxval!=255) { 47 | cerr << "Error: Unsupported max value!" << endl; 48 | exit(1); 49 | } 50 | 51 | if (format=="P5") { 52 | if ((target.cols()!=w) || (target.rows()!=h) || (target.depth()!=1)) 53 | target.resize(shape(h, w, 1)); 54 | } else if (format=="P6") { 55 | if ((target.cols()!=w) || (target.rows()!=h) || (target.depth()!=3)) 56 | target.resize(shape(h, w, 3)); 57 | } else { 58 | cerr << "Error: Unknown PNM Format \"" << format << "\"!" << endl; 59 | exit(1); 60 | } 61 | 62 | if (!target.isStorageContiguous()) exit(1); 63 | 64 | source.read((char*)target.dataFirst(), target.size()*sizeof(char)); 65 | } 66 | 67 | 68 | void writePNM(const std::string &filename, blitz::Array &source) { 69 | std::ofstream target(filename.c_str()); 70 | 71 | if (!source.isStorageContiguous()) exit(1); 72 | 73 | if (source.depth() == 1) target << "P5" << char(10); 74 | if (source.depth() == 3) target << "P6" << char(10); 75 | target << source.cols() << " " << source.rows() << char(10) << 255 << char(10); 76 | target.write ((char*)source.dataFirst(), source.size()*sizeof(char)); 77 | } 78 | 79 | 80 | } // namespace bwave 81 | -------------------------------------------------------------------------------- /src/arrayTools.h: -------------------------------------------------------------------------------- 1 | // Copyright (C) 2003-2008 Oliver Schulz 2 | 3 | // This program is free software; you can redistribute it and/or modify 4 | // it under the terms of the GNU General Public License as published by 5 | // the Free Software Foundation; either version 2 of the License, or 6 | // (at your option) any later version. 7 | // 8 | // This program is distributed in the hope that it will be useful, 9 | // but WITHOUT ANY WARRANTY; without even the implied warranty of 10 | // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 11 | // GNU General Public License for more details. 12 | // 13 | // You should have received a copy of the GNU General Public License 14 | // along with this program; if not, write to the Free Software 15 | // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. 16 | 17 | 18 | #ifndef ARRAYTOOLS_H 19 | #define ARRAYTOOLS_H 20 | 21 | #include 22 | #include 23 | #include 24 | 25 | namespace bwave { 26 | 27 | 28 | /// @brief Array extension mode. 29 | /// 30 | /// Used to specify the array extension method for operations 31 | /// which do boundary handling by extension. 32 | /// 33 | /// Possible values are: @c ZERO_EXT, for extension with zeros, 34 | /// @c CONSTANT_EXT for boundary value repetition, @c SYMMETRIC_EXT 35 | /// for symmetric extension, @c SYMMETRIC2_EXT for symmetric extension 36 | /// with boundary value doubling and @c CYCLIC_EXT for cyclic extension 37 | /// (array repetition). 38 | 39 | enum ExtensionMode { 40 | ZERO_EXT=0, 41 | CONSTANT_EXT=1, 42 | SYMMETRIC_EXT=2, 43 | SYMMETRIC2_EXT=3, 44 | CYCLIC_EXT=2 45 | }; 46 | 47 | 48 | template 49 | blitz::Array slice(blitz::Array &array, 50 | int dimension, blitz::TinyVector position); 51 | 52 | template 53 | void fill(blitz::Array &trg, const blitz::Array 54 | &src, int origin=0, ExtensionMode em=ZERO_EXT); 55 | 56 | 57 | template static tp_Type rollR(tp_Type x, tp_Type i) { assert(false); return 0; } 58 | template<> inline int rollR(int x, int i) { return x >> i; } 59 | template<> inline short rollR(short x, short i) { return x >> i; } 60 | template<> inline char rollR(char x, char i) { return x >> i; } 61 | 62 | template static tp_Type div2BS(tp_Type divisor) { return -1; } 63 | template<> inline int div2BS(int divisor) { return (divisor>0) && !(divisor & (divisor-1)) ? int( log((double)divisor) / log(2.0) ) : -1; } 64 | template<> inline short div2BS(short divisor) { return (divisor>0) && !(divisor & (divisor-1)) ? short( log((double)divisor) / log(2.0) ) : -1; } 65 | template<> inline char div2BS(char divisor) { return (divisor>0) && !(divisor & (divisor-1)) ? char( log((double)divisor) / log(2.0) ) : -1; } 66 | 67 | 68 | template class GenFilter { 69 | protected: 70 | tp_Type m_coeffs[tp_size]; 71 | int m_origin; 72 | tp_Type m_divisor; 73 | 74 | template static tp_Type2 filterSP 75 | (const GenFilter &coeffs, const blitz::Array &in, int i) 76 | { 77 | tp_Type2 result=0; 78 | for (int j=0; j static tp_Type2 filterSP 83 | (const GenFilter &coeffs, const blitz::Array &in, int i) 84 | { return coeffs(0)*in(i+0); } 85 | 86 | template static tp_Type2 filterSP 87 | (const GenFilter &coeffs, const blitz::Array &in, int i) 88 | { return coeffs(0)*in(i+0) + coeffs(1)*in(i+1); } 89 | 90 | template static tp_Type2 filterSP 91 | (const GenFilter &coeffs, const blitz::Array &in, int i) 92 | { return coeffs(0)*in(i+0) + coeffs(1)*in(i+1) + coeffs(2)*in(i+2); } 93 | 94 | template static tp_Type2 filterSP 95 | (const GenFilter &coeffs, const blitz::Array &in, int i) 96 | { return coeffs(0)*in(i+0) + coeffs(1)*in(i+1) + coeffs(2)*in(i+2) + coeffs(3)*in(i+3); } 97 | 98 | template static tp_Type2 filterSP 99 | (const GenFilter &coeffs, const blitz::Array &in, int i) 100 | { return coeffs(0)*in(i+0) + coeffs(1)*in(i+1) + coeffs(2)*in(i+2) + coeffs(3)*in(i+3) + coeffs(4)*in(i+4); } 101 | 102 | template static tp_Type2 filterSP 103 | (const GenFilter &coeffs, const blitz::Array &in, int i) 104 | { return coeffs(0)*in(i+0) + coeffs(1)*in(i+1) + coeffs(2)*in(i+2) + coeffs(3)*in(i+3) + coeffs(4)*in(i+4) + coeffs(5)*in(i+5); } 105 | 106 | public: 107 | static void set(tp_Type &target, const tp_Type &value) { target = value; } 108 | static void inc(tp_Type &target, const tp_Type &value) { target += value; } 109 | static void dec(tp_Type &target, const tp_Type &value) { target -= value; } 110 | 111 | tp_Type operator()(unsigned i) const { return m_coeffs[i]; } 112 | tp_Type& operator()(unsigned i) { return m_coeffs[i]; } 113 | 114 | tp_Type divisor() const { return m_divisor; } 115 | tp_Type divisor(int newDiv) { m_divisor=newDiv; return divisor(); } 116 | 117 | template 118 | void apply(const blitz::Array &in, blitz::Array &out, ExtensionMode be) const 119 | { 120 | using namespace std; 121 | assert( in.lbound()(0)==0 ); 122 | assert( out.lbound()(0)==0 ); 123 | 124 | tp_Type bitShift = div2BS(m_divisor); 125 | 126 | const int nI=in.rows(); 127 | const int nO=out.rows(); 128 | const int fb = m_origin; 129 | const int fe = m_origin+tp_size-1; 130 | const int mainB = max(0, -fb), mainE = min(nI, nO)+min(0, -fe); 131 | 132 | blitz::Array dummy(max(1, tp_size-1 + max(mainB, nO-mainE) )); 133 | 134 | if (mainB>0) { 135 | fill(dummy, in, mainB, be); 136 | 137 | int inI=0; 138 | if (bitShift>=0) for (int outI=0; outI=0) for (int outI=mainB; outI=0) for (int outI=mainE; outI &in, blitz::Array &out, ExtensionMode be=ZERO_EXT) const 171 | { apply::set>(in, out, be); } 172 | 173 | void applyAdd(const blitz::Array &in, blitz::Array &out, ExtensionMode be=ZERO_EXT) const 174 | { apply::inc>(in, out, be); } 175 | 176 | void applySub(const blitz::Array &in, blitz::Array &out, ExtensionMode be=ZERO_EXT) const 177 | { apply::dec>(in, out, be); } 178 | 179 | GenFilter(int origin) : m_origin(origin) {} 180 | 181 | GenFilter(int origin, const tp_Type *x, tp_Type divis) 182 | : m_origin(origin), m_divisor(divis) 183 | { 184 | for (int i=0; i &target); 194 | 195 | void writePNM(const std::string &filename, blitz::Array &source); 196 | 197 | 198 | 199 | // -- template implementations: --------------------------------------- 200 | 201 | template 202 | blitz::Array slice(blitz::Array &array, 203 | int dimension, blitz::TinyVector position) 204 | { 205 | using namespace blitz; 206 | 207 | GeneralArrayStorage<1> newStorage; 208 | newStorage.ordering()(0) = firstDim; 209 | newStorage.ascendingFlag()(0) = array.stride(dimension)>=0; 210 | newStorage.base()(0) = array.base(dimension); 211 | 212 | position(dimension) = newStorage.ascendingFlag()(0) ? 213 | array.lbound(dimension) : array.ubound(dimension); 214 | tp_Type *data = &(array(position)); 215 | 216 | TinyVector newShape; newShape(0) = array.shape()(dimension); 217 | TinyVector newStride; newStride(0) = array.stride(dimension); 218 | 219 | return Array(data, newShape, newStride, neverDeleteData, newStorage); 220 | } 221 | 222 | 223 | template 224 | void fill(blitz::Array &trg, const blitz::Array 225 | &src, int origin, ExtensionMode em) 226 | { 227 | using namespace blitz; 228 | 229 | // Symmetric and cyclic extension not implemented yet 230 | assert ( em!= SYMMETRIC_EXT ); 231 | assert ( em!= SYMMETRIC2_EXT ); 232 | assert ( em!= CYCLIC_EXT ); 233 | 234 | //const int nSrc = src.rows(); 235 | //const int nTrg = trg.rows(); 236 | const int lSrc = src.lbound()(0); 237 | const int lTrg = trg.lbound()(0); 238 | const int uSrc = src.ubound()(0); 239 | const int uTrg = trg.ubound()(0); 240 | 241 | const int stop = uTrg+1; 242 | const int start = lTrg; 243 | const int sSrc = max(start-origin, 0)+lSrc; 244 | const int stage1 = min(max(origin, start), stop); 245 | const int stage2 = min(stage1+max(uSrc-sSrc+1,0), stop); 246 | 247 | tp_Type fillConst = (em==CONSTANT_EXT ? src(lSrc) : 0); 248 | for (int i=start; i