pax_global_header00006660000000000000000000000064123612740450014516gustar00rootroot0000000000000052 comment=3aacd90450f7f48818225b1b623dcdf77ed1ddfe libavg-1.8.2/000077500000000000000000000000001236127404500127725ustar00rootroot00000000000000libavg-1.8.2/BuildMacDeps.sh000077500000000000000000000075021236127404500156310ustar00rootroot00000000000000#!/bin/bash set -e set -x clean() { rm -rf ${AVG_PATH}/bin/ rm -rf ${AVG_PATH}/lib/ sudo rm -rf ${AVG_PATH}/include/ mkdir ${AVG_PATH}/bin mkdir ${AVG_PATH}/lib mkdir ${AVG_PATH}/include } buildLib() { LIBNAME=$1 CONFIG_ARGS=$2 echo -------------------------------------------------------------------- cd ${LIBNAME} ./configure --prefix=${AVG_PATH} ${CONFIG_ARGS} make clean make -j5 make install cd .. } buildglib() { echo -------------------------------------------------------------------- cd glib-2.29.2 LDFLAGS="-framework ApplicationServices $LDFLAGS -lresolv" ./configure --prefix=${AVG_PATH} --disable-shared --enable-static make clean make -j5 make install cd .. } buildfontconfig() { echo -------------------------------------------------------------------- cd fontconfig-2.7.0 automake LDFLAGS="-framework ApplicationServices ${LDFLAGS}" ./configure --prefix=${AVG_PATH} --disable-shared --with-add-fonts=/Library/Fonts,/System/Library/Fonts,~/Library/Fonts --with-confdir=/etc/fonts --with-cache-dir=~/.fontconfig --with-cache-dir=~/.fontconfig make clean make -j5 sudo make install sudo chown -R `whoami` ~/.fontconfig cd .. } buildgdkpixbuf() { echo -------------------------------------------------------------------- cd gdk-pixbuf-2.23.3 LDFLAGS="-framework ApplicationServices $LDFLAGS -lresolv" ./configure --prefix=${AVG_PATH} --disable-shared --with-included-loaders make clean make -j5 make install cd .. } buildlibrsvg() { echo -------------------------------------------------------------------- cd librsvg-2.34.0 autoreconf --force --install LDFLAGS=`xml2-config --libs` CPPFLAGS=`xml2-config --cflags` ./configure --prefix=${AVG_PATH} --disable-shared --disable-gtk-theme --disable-tools make clean make -j5 make install cd .. } buildboost() { echo -------------------------------------------------------------------- cd boost_1_54_0 ./bootstrap.sh --prefix=${AVG_PATH} --with-libraries=python,thread,date_time,system ./bjam clean ./bjam install cd .. rm -f ../lib/libboost_thread.dylib rm -f ../lib/libboost_python.dylib rm -f ../lib/libboost_date_time.dylib rm -f ../lib/libboost_system.dylib } if [[ x"${AVG_PATH}" == "x" ]] then echo ${AVG_PATH} echo Please set AVG_PATH and call 'source mac/avg_env.sh' before calling this script. exit -1 fi if [[ x"${AVG_MAC_ENV_SET}" == "x" ]] then echo Please call 'source mac/avg_env.sh' before calling this script. exit -1 fi clean cd ../deps buildLib libtool-2.2.6 buildLib autoconf-2.63 buildLib automake-1.11 buildLib nasm-2.10.09 buildLib libjpeg-turbo-1.3.0 "--host x86_64-apple-darwin --disable-shared NASM=${AVG_PATH}/bin/nasm" buildLib tiff-3.8.2 --disable-shared buildLib libpng-1.2.41 --disable-shared buildLib pkg-config-0.20 buildLib yasm-1.2.0 buildLib libav-9.9 "--arch=x86_64 --disable-debug --enable-pthreads --enable-runtime-cpudetect" buildLib SDL-1.2.15 "--disable-shared --disable-cdrom --disable-threads --disable-file --disable-video-x11 --without-x" buildLib gettext-0.18.1.1 "--disable-shared --with-included-gettext --disable-csharp --disable-libasprintf" buildglib buildLib freetype-2.5.0.1 "--disable-shared --with-old-mac-fonts" buildLib expat-2.0.0 --disable-shared buildfontconfig buildLib pixman-0.22.0 --disable-shared buildLib cairo-1.10.2 "--disable-shared --enable-xlib=no --enable-xlib-xrender=no --enable-quartz=no --enable-quartz-font=no --enable-quartz-image=no --enable-ps=no --enable-pdf=no --enable-svg=no" buildLib pango-1.24.4 "--disable-shared --without-x --with-included-modules=yes" buildgdkpixbuf buildlibrsvg buildboost buildLib libdc1394-2.2.1 "--disable-shared --disable-doxygen-doc --without-x" cd ../libavg libavg-1.8.2/COPYING000066400000000000000000000634741236127404500140430ustar00rootroot00000000000000 GNU LESSER GENERAL PUBLIC LICENSE Version 2.1, February 1999 Copyright (C) 1991, 1999 Free Software Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Everyone is permitted to copy and distribute verbatim copies of this license document, but changing it is not allowed. [This is the first released version of the Lesser GPL. It also counts as the successor of the GNU Library Public License, version 2, hence the version number 2.1.] Preamble The licenses for most software are designed to take away your freedom to share and change it. By contrast, the GNU General Public Licenses are intended to guarantee your freedom to share and change free software--to make sure the software is free for all its users. This license, the Lesser General Public License, applies to some specially designated software packages--typically libraries--of the Free Software Foundation and other authors who decide to use it. You can use it too, but we suggest you first think carefully about whether this license or the ordinary General Public License is the better strategy to use in any particular case, based on the explanations below. When we speak of free software, we are referring to freedom of use, not price. Our General Public Licenses are designed to make sure that you have the freedom to distribute copies of free software (and charge for this service if you wish); that you receive source code or can get it if you want it; that you can change the software and use pieces of it in new free programs; and that you are informed that you can do these things. To protect your rights, we need to make restrictions that forbid distributors to deny you these rights or to ask you to surrender these rights. These restrictions translate to certain responsibilities for you if you distribute copies of the library or if you modify it. For example, if you distribute copies of the library, whether gratis or for a fee, you must give the recipients all the rights that we gave you. You must make sure that they, too, receive or can get the source code. If you link other code with the library, you must provide complete object files to the recipients, so that they can relink them with the library after making changes to the library and recompiling it. And you must show them these terms so they know their rights. We protect your rights with a two-step method: (1) we copyright the library, and (2) we offer you this license, which gives you legal permission to copy, distribute and/or modify the library. To protect each distributor, we want to make it very clear that there is no warranty for the free library. Also, if the library is modified by someone else and passed on, the recipients should know that what they have is not the original version, so that the original author's reputation will not be affected by problems that might be introduced by others. Finally, software patents pose a constant threat to the existence of any free program. We wish to make sure that a company cannot effectively restrict the users of a free program by obtaining a restrictive license from a patent holder. Therefore, we insist that any patent license obtained for a version of the library must be consistent with the full freedom of use specified in this license. Most GNU software, including some libraries, is covered by the ordinary GNU General Public License. This license, the GNU Lesser General Public License, applies to certain designated libraries, and is quite different from the ordinary General Public License. We use this license for certain libraries in order to permit linking those libraries into non-free programs. When a program is linked with a library, whether statically or using a shared library, the combination of the two is legally speaking a combined work, a derivative of the original library. The ordinary General Public License therefore permits such linking only if the entire combination fits its criteria of freedom. The Lesser General Public License permits more lax criteria for linking other code with the library. We call this license the "Lesser" General Public License because it does Less to protect the user's freedom than the ordinary General Public License. It also provides other free software developers Less of an advantage over competing non-free programs. These disadvantages are the reason we use the ordinary General Public License for many libraries. However, the Lesser license provides advantages in certain special circumstances. For example, on rare occasions, there may be a special need to encourage the widest possible use of a certain library, so that it becomes a de-facto standard. To achieve this, non-free programs must be allowed to use the library. A more frequent case is that a free library does the same job as widely used non-free libraries. In this case, there is little to gain by limiting the free library to free software only, so we use the Lesser General Public License. In other cases, permission to use a particular library in non-free programs enables a greater number of people to use a large body of free software. For example, permission to use the GNU C Library in non-free programs enables many more people to use the whole GNU operating system, as well as its variant, the GNU/Linux operating system. Although the Lesser General Public License is Less protective of the users' freedom, it does ensure that the user of a program that is linked with the Library has the freedom and the wherewithal to run that program using a modified version of the Library. The precise terms and conditions for copying, distribution and modification follow. Pay close attention to the difference between a "work based on the library" and a "work that uses the library". The former contains code derived from the library, whereas the latter must be combined with the library in order to run. GNU LESSER GENERAL PUBLIC LICENSE TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 0. This License Agreement applies to any software library or other program which contains a notice placed by the copyright holder or other authorized party saying it may be distributed under the terms of this Lesser General Public License (also called "this License"). Each licensee is addressed as "you". A "library" means a collection of software functions and/or data prepared so as to be conveniently linked with application programs (which use some of those functions and data) to form executables. The "Library", below, refers to any such software library or work which has been distributed under these terms. A "work based on the Library" means either the Library or any derivative work under copyright law: that is to say, a work containing the Library or a portion of it, either verbatim or with modifications and/or translated straightforwardly into another language. (Hereinafter, translation is included without limitation in the term "modification".) "Source code" for a work means the preferred form of the work for making modifications to it. For a library, complete source code means all the source code for all modules it contains, plus any associated interface definition files, plus the scripts used to control compilation and installation of the library. Activities other than copying, distribution and modification are not covered by this License; they are outside its scope. The act of running a program using the Library is not restricted, and output from such a program is covered only if its contents constitute a work based on the Library (independent of the use of the Library in a tool for writing it). Whether that is true depends on what the Library does and what the program that uses the Library does. 1. You may copy and distribute verbatim copies of the Library's complete source code as you receive it, in any medium, provided that you conspicuously and appropriately publish on each copy an appropriate copyright notice and disclaimer of warranty; keep intact all the notices that refer to this License and to the absence of any warranty; and distribute a copy of this License along with the Library. You may charge a fee for the physical act of transferring a copy, and you may at your option offer warranty protection in exchange for a fee. 2. You may modify your copy or copies of the Library or any portion of it, thus forming a work based on the Library, and copy and distribute such modifications or work under the terms of Section 1 above, provided that you also meet all of these conditions: a) The modified work must itself be a software library. b) You must cause the files modified to carry prominent notices stating that you changed the files and the date of any change. c) You must cause the whole of the work to be licensed at no charge to all third parties under the terms of this License. d) If a facility in the modified Library refers to a function or a table of data to be supplied by an application program that uses the facility, other than as an argument passed when the facility is invoked, then you must make a good faith effort to ensure that, in the event an application does not supply such function or table, the facility still operates, and performs whatever part of its purpose remains meaningful. (For example, a function in a library to compute square roots has a purpose that is entirely well-defined independent of the application. Therefore, Subsection 2d requires that any application-supplied function or table used by this function must be optional: if the application does not supply it, the square root function must still compute square roots.) These requirements apply to the modified work as a whole. If identifiable sections of that work are not derived from the Library, and can be reasonably considered independent and separate works in themselves, then this License, and its terms, do not apply to those sections when you distribute them as separate works. But when you distribute the same sections as part of a whole which is a work based on the Library, the distribution of the whole must be on the terms of this License, whose permissions for other licensees extend to the entire whole, and thus to each and every part regardless of who wrote it. Thus, it is not the intent of this section to claim rights or contest your rights to work written entirely by you; rather, the intent is to exercise the right to control the distribution of derivative or collective works based on the Library. In addition, mere aggregation of another work not based on the Library with the Library (or with a work based on the Library) on a volume of a storage or distribution medium does not bring the other work under the scope of this License. 3. You may opt to apply the terms of the ordinary GNU General Public License instead of this License to a given copy of the Library. To do this, you must alter all the notices that refer to this License, so that they refer to the ordinary GNU General Public License, version 2, instead of to this License. (If a newer version than version 2 of the ordinary GNU General Public License has appeared, then you can specify that version instead if you wish.) Do not make any other change in these notices. Once this change is made in a given copy, it is irreversible for that copy, so the ordinary GNU General Public License applies to all subsequent copies and derivative works made from that copy. This option is useful when you wish to copy part of the code of the Library into a program that is not a library. 4. You may copy and distribute the Library (or a portion or derivative of it, under Section 2) in object code or executable form under the terms of Sections 1 and 2 above provided that you accompany it with the complete corresponding machine-readable source code, which must be distributed under the terms of Sections 1 and 2 above on a medium customarily used for software interchange. If distribution of object code is made by offering access to copy from a designated place, then offering equivalent access to copy the source code from the same place satisfies the requirement to distribute the source code, even though third parties are not compelled to copy the source along with the object code. 5. A program that contains no derivative of any portion of the Library, but is designed to work with the Library by being compiled or linked with it, is called a "work that uses the Library". Such a work, in isolation, is not a derivative work of the Library, and therefore falls outside the scope of this License. However, linking a "work that uses the Library" with the Library creates an executable that is a derivative of the Library (because it contains portions of the Library), rather than a "work that uses the library". The executable is therefore covered by this License. Section 6 states terms for distribution of such executables. When a "work that uses the Library" uses material from a header file that is part of the Library, the object code for the work may be a derivative work of the Library even though the source code is not. Whether this is true is especially significant if the work can be linked without the Library, or if the work is itself a library. The threshold for this to be true is not precisely defined by law. If such an object file uses only numerical parameters, data structure layouts and accessors, and small macros and small inline functions (ten lines or less in length), then the use of the object file is unrestricted, regardless of whether it is legally a derivative work. (Executables containing this object code plus portions of the Library will still fall under Section 6.) Otherwise, if the work is a derivative of the Library, you may distribute the object code for the work under the terms of Section 6. Any executables containing that work also fall under Section 6, whether or not they are linked directly with the Library itself. 6. As an exception to the Sections above, you may also combine or link a "work that uses the Library" with the Library to produce a work containing portions of the Library, and distribute that work under terms of your choice, provided that the terms permit modification of the work for the customer's own use and reverse engineering for debugging such modifications. You must give prominent notice with each copy of the work that the Library is used in it and that the Library and its use are covered by this License. You must supply a copy of this License. If the work during execution displays copyright notices, you must include the copyright notice for the Library among them, as well as a reference directing the user to the copy of this License. Also, you must do one of these things: a) Accompany the work with the complete corresponding machine-readable source code for the Library including whatever changes were used in the work (which must be distributed under Sections 1 and 2 above); and, if the work is an executable linked with the Library, with the complete machine-readable "work that uses the Library", as object code and/or source code, so that the user can modify the Library and then relink to produce a modified executable containing the modified Library. (It is understood that the user who changes the contents of definitions files in the Library will not necessarily be able to recompile the application to use the modified definitions.) b) Use a suitable shared library mechanism for linking with the Library. A suitable mechanism is one that (1) uses at run time a copy of the library already present on the user's computer system, rather than copying library functions into the executable, and (2) will operate properly with a modified version of the library, if the user installs one, as long as the modified version is interface-compatible with the version that the work was made with. c) Accompany the work with a written offer, valid for at least three years, to give the same user the materials specified in Subsection 6a, above, for a charge no more than the cost of performing this distribution. d) If distribution of the work is made by offering access to copy from a designated place, offer equivalent access to copy the above specified materials from the same place. e) Verify that the user has already received a copy of these materials or that you have already sent this user a copy. For an executable, the required form of the "work that uses the Library" must include any data and utility programs needed for reproducing the executable from it. However, as a special exception, the materials to be distributed need not include anything that is normally distributed (in either source or binary form) with the major components (compiler, kernel, and so on) of the operating system on which the executable runs, unless that component itself accompanies the executable. It may happen that this requirement contradicts the license restrictions of other proprietary libraries that do not normally accompany the operating system. Such a contradiction means you cannot use both them and the Library together in an executable that you distribute. 7. You may place library facilities that are a work based on the Library side-by-side in a single library together with other library facilities not covered by this License, and distribute such a combined library, provided that the separate distribution of the work based on the Library and of the other library facilities is otherwise permitted, and provided that you do these two things: a) Accompany the combined library with a copy of the same work based on the Library, uncombined with any other library facilities. This must be distributed under the terms of the Sections above. b) Give prominent notice with the combined library of the fact that part of it is a work based on the Library, and explaining where to find the accompanying uncombined form of the same work. 8. You may not copy, modify, sublicense, link with, or distribute the Library except as expressly provided under this License. Any attempt otherwise to copy, modify, sublicense, link with, or distribute the Library is void, and will automatically terminate your rights under this License. However, parties who have received copies, or rights, from you under this License will not have their licenses terminated so long as such parties remain in full compliance. 9. You are not required to accept this License, since you have not signed it. However, nothing else grants you permission to modify or distribute the Library or its derivative works. These actions are prohibited by law if you do not accept this License. Therefore, by modifying or distributing the Library (or any work based on the Library), you indicate your acceptance of this License to do so, and all its terms and conditions for copying, distributing or modifying the Library or works based on it. 10. Each time you redistribute the Library (or any work based on the Library), the recipient automatically receives a license from the original licensor to copy, distribute, link with or modify the Library subject to these terms and conditions. You may not impose any further restrictions on the recipients' exercise of the rights granted herein. You are not responsible for enforcing compliance by third parties with this License. 11. If, as a consequence of a court judgment or allegation of patent infringement or for any other reason (not limited to patent issues), conditions are imposed on you (whether by court order, agreement or otherwise) that contradict the conditions of this License, they do not excuse you from the conditions of this License. If you cannot distribute so as to satisfy simultaneously your obligations under this License and any other pertinent obligations, then as a consequence you may not distribute the Library at all. For example, if a patent license would not permit royalty-free redistribution of the Library by all those who receive copies directly or indirectly through you, then the only way you could satisfy both it and this License would be to refrain entirely from distribution of the Library. If any portion of this section is held invalid or unenforceable under any particular circumstance, the balance of the section is intended to apply, and the section as a whole is intended to apply in other circumstances. It is not the purpose of this section to induce you to infringe any patents or other property right claims or to contest validity of any such claims; this section has the sole purpose of protecting the integrity of the free software distribution system which is implemented by public license practices. Many people have made generous contributions to the wide range of software distributed through that system in reliance on consistent application of that system; it is up to the author/donor to decide if he or she is willing to distribute software through any other system and a licensee cannot impose that choice. This section is intended to make thoroughly clear what is believed to be a consequence of the rest of this License. 12. If the distribution and/or use of the Library is restricted in certain countries either by patents or by copyrighted interfaces, the original copyright holder who places the Library under this License may add an explicit geographical distribution limitation excluding those countries, so that distribution is permitted only in or among countries not thus excluded. In such case, this License incorporates the limitation as if written in the body of this License. 13. The Free Software Foundation may publish revised and/or new versions of the Lesser General Public License from time to time. Such new versions will be similar in spirit to the present version, but may differ in detail to address new problems or concerns. Each version is given a distinguishing version number. If the Library specifies a version number of this License which applies to it and "any later version", you have the option of following the terms and conditions either of that version or of any later version published by the Free Software Foundation. If the Library does not specify a license version number, you may choose any version ever published by the Free Software Foundation. 14. If you wish to incorporate parts of the Library into other free programs whose distribution conditions are incompatible with these, write to the author to ask for permission. For software which is copyrighted by the Free Software Foundation, write to the Free Software Foundation; we sometimes make exceptions for this. Our decision will be guided by the two goals of preserving the free status of all derivatives of our free software and of promoting the sharing and reuse of software generally. NO WARRANTY 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. END OF TERMS AND CONDITIONS How to Apply These Terms to Your New Libraries If you develop a new library, and you want it to be of the greatest possible use to the public, we recommend making it free software that everyone can redistribute and change. You can do so by permitting redistribution under these terms (or, alternatively, under the terms of the ordinary General Public License). To apply these terms, attach the following notices to the library. It is safest to attach them to the start of each source file to most effectively convey the exclusion of warranty; and each file should have at least the "copyright" line and a pointer to where the full notice is found. Copyright (C) This library is free software; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. This library is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details. You should have received a copy of the GNU Lesser General Public License along with this library; if not, write to the Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA Also add information on how to contact you by electronic and paper mail. You should also get your employer (if you work as a programmer) or your school, if any, to sign a "copyright disclaimer" for the library, if necessary. Here is a sample; alter the names: Yoyodyne, Inc., hereby disclaims all copyright interest in the library `Frob' (a library for tweaking knobs) written by James Random Hacker. , 1 April 1990 Ty Coon, President of Vice That's all there is to it! libavg-1.8.2/CreateVersionFile.py000077500000000000000000000143141236127404500167230ustar00rootroot00000000000000#!/usr/bin/env python # -*- coding: utf-8 -*- # libavg - Media Playback Engine. # Copyright (C) 2003-2014 Ulrich von Zadow # # This library is free software; you can redistribute it and/or # modify it under the terms of the GNU Lesser General Public # License as published by the Free Software Foundation; either # version 2 of the License, or (at your option) any later version. # # This library is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # Lesser General Public License for more details. # # You should have received a copy of the GNU Lesser General Public # License along with this library; if not, write to the Free Software # Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA # # Current versions can be found at www.libavg.de # # The script generates a header file that contains versioning data for # the current build. import os import sys import subprocess import errno import re import socket import getpass import platform import datetime import pickle CHECK_FIELDS = ('releaseVersion', 'revision', 'branchurl') OUTPUT_TEMPLATE = '''// version.h // This file is automatically generated by CreateVersionFile.py #define AVG_VERSION_RELEASE "%(releaseVersion)s" #define AVG_VERSION_FULL "%(fullVersion)s" #define AVG_VERSION_BRANCH_URL "%(branchurl)s" #define AVG_VERSION_BUILDER "%(builder)s" #define AVG_VERSION_BUILDTIME "%(buildtime)s" #define AVG_VERSION_REVISION %(revision)s #define AVG_VERSION_MAJOR "%(major)s" #define AVG_VERSION_MINOR "%(minor)s" #define AVG_VERSION_MICRO "%(micro)s" ''' TOPDIR = os.path.dirname(os.path.abspath(__file__)) INPUT_FILE = os.path.join(TOPDIR, 'm4', 'avg_version.m4') CACHE_FILE = os.path.join(TOPDIR, 'versioninfo.cache') OUTPUT_FILENAME = 'version.h' def err(text): print >>sys.stderr, text def getSvnRevision(): revision = 0 try: process = subprocess.Popen(['svnversion'], cwd=TOPDIR, stdout=subprocess.PIPE) output, discard = process.communicate() except OSError, e: print e, dir(e) if e.errno == errno.ENOENT: err('Cannot query current revision number via svninfo: ' '"svnversion" executable cannot be found.') else: match = re.search(r'^(\d+)(?::(\d+))?', output) if match: if match.group(2): revision = match.group(2) else: revision = match.group(1) return int(revision) def getSvnBranch(): url = '' branch = 'exported' try: env = os.environ.copy() env['LC_ALL'] = 'C' process = subprocess.Popen(['svn', 'info', '.'], cwd=TOPDIR, stdout=subprocess.PIPE, env=env) output, discard = process.communicate() except OSError, e: if e.errno == errno.ENOENT: err('Cannot query current branch via svn: ' '"svn" executable cannot be found.') branch = 'unknown' else: match = re.search(r'^URL: (.+)$', output, re.M) if match: url = match.group(1) if 'svn/trunk' in url: branch = 'trunk' elif 'svn/branches/' in url: match = re.search(r'svn\/branches\/(.+)/?', url) if match: branch = match.group(1) return (url, branch) def getBuilder(): user = getpass.getuser() hostname = socket.gethostname() return '%s@%s %s' % (user, hostname, platform.platform()) def extractComponentFromM4(text, component): match = re.search(r'%s\s*\].*\[\s*([A-Za-z0-9\.]+)\s*\]' % component, text, re.M) if match: return match.group(1) else: err('Cannot identify %s version component in %s' % (component, INPUT_FILE)) sys.exit(1) def getVersionComponents(): f = open(INPUT_FILE) contents = f.read() f.close() major = extractComponentFromM4(contents, 'VERSION_MAJOR') minor = extractComponentFromM4(contents, 'VERSION_MINOR') micro = extractComponentFromM4(contents, 'VERSION_MICRO') return (major, minor, micro) def assembleVersionInfo(major, minor, micro): releaseVersion = '%s.%s.%s' % (major, minor, micro) revision = getSvnRevision() branchurl, branch = getSvnBranch() builder = getBuilder() buildtime = datetime.datetime.now().isoformat() if revision and branch: fullVersion = '%s-%s/r%s' % (releaseVersion, branch, revision) elif revision: fullVersion = '%s-r%s' % (releaseVersion, revision) else: fullVersion = releaseVersion return locals() def dumpVersionInfo(versionInfo): for k, v in versionInfo.iteritems(): print ' %s: %s' % (k, v) def hasChanged(versionInfo): try: cachef = open(CACHE_FILE) except IOError: return True try: cachedVersionInfo = pickle.load(cachef) except Exception, e: err('Corrupted %s file, forcing rewrite (%s)' % (CACHE_FILE, str(e))) cachef.close() return True cachef.close() for field in CHECK_FIELDS: if versionInfo.get(field) != cachedVersionInfo.get(field): return True return False def writeVersionHeader(versionInfo, originalFile): outf = open(originalFile, 'w') outf.write(OUTPUT_TEMPLATE % versionInfo) outf.close() try: cachef = open(CACHE_FILE, 'w') except IOError: pass else: pickle.dump(versionInfo, cachef) cachef.close() def main(topBuildDir=TOPDIR): versionInfo = assembleVersionInfo(*getVersionComponents()) outputFile = os.path.join(topBuildDir, OUTPUT_FILENAME) # Avoid to write again if the content hasn't significantly changed if not os.path.exists(outputFile) or hasChanged(versionInfo): dumpVersionInfo(versionInfo) writeVersionHeader(versionInfo, outputFile) if __name__ == '__main__': if len(sys.argv) == 2: main(sys.argv[1]) elif len(sys.argv) == 1: main() else: err('%s [top build dir]' % sys.argv[0]) sys.exit(1) libavg-1.8.2/Makefile.am000066400000000000000000000004721236127404500150310ustar00rootroot00000000000000SUBDIRS = src man ACLOCAL_AMFLAGS = -I m4 EXTRA_DIST = bootstrap COPYING NEWS \ CreateVersionFile.py BuildMacDeps.sh makedocs.sh \ valgrind.cmdline valgrind.suppressions \ $(wildcard mac/*) $(wildcard mac/installscripts/*) install-data-hook: $(mkinstalldirs) $(DESTDIR)/$(datadir)/avg/ libavg-1.8.2/NEWS000066400000000000000000000401241236127404500134720ustar00rootroot00000000000000libavg 1.8.2 - July 15, 2014 Bugfixes: * Fixed Audio (#500) libavg 1.8.1 - June 21, 2014 Bugfixes: * Fixed anim keepAttr bug (#496) * Fixed XInput multitouch support (r9651, #489) * Documentation fixes (r9648, r9637, r9636, #487) * Cleaner test output (r9629, r9630, #410) * Fixed undefined reference in VDPAUHelper (r9635, #486) * libav 0.10.0 support libavg 1.8.0 - Feb 15, 2014 svn revision 9557 Bugfixes libavg 1.8.0.pre2 - Feb 8, 2014 svn revision 9545 Bugfixes libavg 1.8.0.pre1 - Jan 11, 2014 svn revision 9495 Major New Features: * Skinnable widget library including all standard button types, sliders, scroll and progress bars, on-screen keyboard and media controls. * Major speed improvements: libavg can now handle thousands of visible nodes, switched to entirely shader-based rendering. * New cool Firebirds sample (Scotty). * Powerful unified event handling framework based on publish/subscribe pattern. * Support for GLES and Raspberry Pi. * Complete rewrite of the video decoder subsystem: Audio consistently works, VDPAU support. * Shiny new logging subsystem (Richy) * Powerful new app class (OXullo) Less Major New Features: * New StateMachine class * WordsNode.alphagamma * GPUInvertFilter (Richy) * Faster handling of filled vector nodes (Benjamin Granzow) * Easier creation of derived node classes in python * €1 jitter filter support for gestures * Global libavg.player variable * CPU Thread affinity used for cleaner playback when many threads are involved * Debug OpenGL context support * Player.callFromThread() * FontStyle class * SwipeRecognizer gesture recognizer * Bitmaps: added blt(), getResized(), (Incomplete) support for bitmaps > 2 GB, thread pool support for BitmapLoader. LOTS of minor new features, support for current OSes and graphics drivers, bugfixes, etc. libavg 1.7.1 - Jan 26, 2012 svn revision 7008, branch release1.7.x Bugfixes: - Mac avg_env.sh handling of PKG_CONFIG_PATH fixed (r6886). - Fixed handling of files > 2 gb in VideoWriter (r6905, Bug #279). - Fixed VideoWriter crash with some ffmpeg versions (r6922). - Fixed crash when stopping and seeking one video simultaneously (r6961). - Fixed slow tests on Linux machines with ATI display drivers (r6970). - Fixed TUIO support under Linux x86-64 (r6982). libavg 1.7.0 - Oct 29, 2011 svn revision 6888, branch release1.7.x Bugfixes libavg 1.7.0.pre1 - Oct 29, 2011 svn revision 6871 Major New Features: * Expanded effects support: New HueSatFXNode and InvertFXNode by Richard Klemm, major speed improvements. * Polished multitouch gesture support. * New Contact class that delivers per-touch data, per-touch callbacks that make event handling a lot easier. * SVG support. * New BitmapManager that allows loading of bitmaps in a background thread (OXullo Intersecans). Other Changes: * Lots of performance optimizations. * Linux ATI graphics are supported now. * Major speed improvements to VideoWriter. Saving full HD videos is not a problem anymore and costs little performance for the main rendering thread. * Callbacks don't hold references to python objects anymore - this should make freeing nodes a lot easier. * New StateMachine class. * Added Player.getPixelsPerMM(), getPhysicalScreenDimensions(), assumePixelsPerMM() * Added touch feedback class. libavg 1.6.0 - May 29, 2011 svn revision 6022, branch release1.6.x Bugfix release libavg 1.6.0.pre2 - May 27, 2011 svn revision 6018, branch release1.6.x Bugfix release libavg 1.6.0.pre1 - May 20, 2011 svn revision 5974 Major New Features: * New Sphinx-based reference. * Unified multitouch interface: internal tracker can now be activated using enableMultitouch(), Windows 7 touch is supported, linux multitouch using XInput 2.1 and LibMTDev. Drivers are autodetected if possible. * (Finally!) Added clean windows build files for VS 2010 to the open source distribution. Other Changes: * (Finally!) Found an invisible workaround for the Linux/Mesa graphics segfault that's been plaguing us for years (Chase Douglas). * Support for input devices defined in python (Henrik Thoms). * Added VideoWriter class (initial version by Henrik Thoms). * Added initial manipulation classes for multitouch gesture support. * Added connect/disconnectEventHandler functions to replace setEventHandler() * Added Player.getFrameDuration(). * Added geom.Arc and geom.PieSlice node classes. * Added Player.isUsingShaders(). * Added Player.getScreenResolution(). * 16 bit texture support is more robust. * Frame times are now monotonic, so libavg installations survive time zone changes. * libavg can be built with binutils-gold under linux. * Intelligent fallback for multisampling. * FXNodes can now change the size of the node - necessary e.g. for blur and shadow. * Added Player.getTimeSinceLastFrame(). * Added avg_checkvsync.py utility. libavg 1.5.3 - February 20, 2011 (Linux only) svn revision 5599 Major new feature: * Linux XInput 2.1 Multitouch support. libavg 1.5.1 - November 14, 2010 (Mac only) svn revision 5275 Fixed bug that caused fullscreen apps to crash on the mac (Bug # 162). libavg 1.5.0 - November 6, 2010 svn revision 5270 Major New Features: * Nodes can be constructed directly from python, making createNode unnecessary. * Added support for rendering avg scenes to offscreen canvases. * Added GPU-based effects framework and Blur, Shadow, Chromakey effects. * Added multitouch driver model and support for Apple Magic Trackpads and TUIO devices. * Support for flash videos with an alpha channel. Decoding is GPU-accellerated. Other Changes: * Added color controls (gamma, brightness, contrast) to all RasterNodes. * Node constructors have a parent parameter which makes a following addChild redundant. * Added Player.setEventHook(). * Added onscreen keyboard for touchscreens. * WordsNode.getNumLines(), .getCharIndexFromPos(), .getTextAsDisplayed(). * DivNode.getEffectiveMediaDir(). * Clearer profiling that works for multiple threads. * Added AVG_BREAK_ON_IMPORT and AVG_BREAK_ON_ASSERT env variables. * Added AVG_DUMP_TEST_FRAMES env variable. * Added Player.setWindowFrame(). * Added VideoNode.queuelength. * Video stability & timing improvements. * DivNode crop default is now false. * Node class names are unified: All names end with 'Node': WordsNode, DivNode, etc. * Added ImageNode.compression for 16 bpp texture support. * Added avg_audioplayer.py. * Various compiler compatibility fixes: Compiles with gcc 4.5 and VC++ 2010 now. * Lots of bugfixes - see the bug tracker. libavg 1.5.0.pre3 - November 4, 2010 svn revision 5267 libavg 1.5.0.pre2 - November 3, 2010 svn revision 5263 libavg 1.5.0.pre1 - October 31, 2010 svn revision 5244 libavg 1.0.0 - January 8, 2010 svn revision 4489 New Features: * hinting is now optional in words node. * Multitouch emulation module added to AVGMTApp. * masks now work with words nodes. * Added video.volume property and video.hasAudio() method. * Added AVG_LOG_CATEGORIES environment variable. Log configuration is now done using the environment and not by calling a method. * Added maskpos and masksize attribute so masks can be moved and rescaled. * Added Player.getKeyModifierState() * Added sse2 version of yuv->rgb color conversion. * Added avg_videoinfo.sh. * Added mesh node. * Added avg_showcamera --resetbus to reset the firewire bus after crashes. Other Improvements: * New anim framework is now stable. * Snow Leopard compatibility. * avg_showcamera has much better command line handling. * The test suite is faster and a lot more comprehensive. * hrefs and mediadirs are now unicode-aware, so filenames like "ö.png" should work. * node.unlink(True) now deletes all event handlers in the node, making it a lot easier to avoid memory leaks. * Lots of bug fixes: - Windows gamma is now reset correctly on program end. - Linux vsync now much more stable. - Setting node.pos.x now throws an error instead of being ignored. Same for all other Point2D attributes. - video.getNumFrames() now returns the exact number of frames. - Behaviour of nodes before Player.play() and when they are not in the avg tree is now much more stable. - Fixed words node sensitive area for centered and right-aligned nodes. libavg 1.0.0.pre3 - January 6, 2010 svn revision 4475 libavg 1.0.0.pre2 - December 23, 2009 svn revision 4398 libavg 1.0.0.pre1 - December 21, 2009 svn revision 4387 libavg 0.9.0 - August 23, 2009 svn revision 4100 Major new features: * Support for vector node types: Line, PolyLine, Curve, Circle, Polygon, Rectangle. Vector nodes can be textured, with the closed vectors taking two textures: one for the outline, one for the fill. Vector drawing is GPU-based. * Plugin support. Plugins written in C++ can define complete new node types. * Powerful (but still experimental) new animation framework. * Unified & much more stable camera drivers. Consistent support for all resolutions & framerates we could test. Support for more than one camera on all platforms. fw800 is supported. * Uniform support for aggregate types in node interfaces (node.pos, node.pivot, ...) Other improvements: * gcc 4.4 and ffmpeg 0.5.0 compatibility. * Added letterspacing support to words node. * Threaded videos are now the default. * Improved video seek and loop performance. * New Node::getElementByPos() method that returns the node at that point on the screen. * Added avg.svnrevision and avg.svndate properties so the avg version can be queried. * New avg_showfont.py utility to help font selection. * New avg_showcamera.py utility to help camera setup. * New avg.getMemoryUsage function that returns the resident set size. * New Words.addFontDir(). * Added support for mipmapping node textures, including videos. * rasternode.maskhref to support static alpha masks for any videos, word nodes, etc. Syntax and semantic changes: * In the course of adding aggregate types for node attributes, several attributes have changed: - words.size is now called words.fontsize. - pivotx and pivoty have been replaced by pivot. * right-aligned and centered words nodes are positioned differently. * avgtrackerrc syntax has changed significantly; see src/avgtrackerrc.minimal. * Support for firewire cameras using libdc1394 ver. 1 has been phased out. Please install ver. 2.x. * The old python-based anim framework is marked deprecated. You need to explicitly use the namespace anim to access it. libavg 0.9.0.pre3 - August 20, 2009 svn rev. 4086 libavg 0.9.0.pre2 - August 11, 2009 svn revision 4066 libavg 0.9.0.pre1 - August 9, 2009 svn revision 4046 libavg 0.8.0 - September 22, 2008 svn revision 3196 libavg 0.8.0.pre3 - September 16, 2008 svn revision 3171 * Fixed testgpu bug on older graphics cards. * Fixed gcc 4.3 compile. * Error instead of crash if vertex buffers are not supported. libavg 0.8.0.pre2 - September 13, 2008 svn revision 3161 Major new Features: * Major tracking improvements: Parts now run as shaders on the GPU, lots of optimizations, speed and ellipse axes of blobs are now available in python, blob contours can be calculated, etc. * Major rendering performance improvements. * Much improved words node - variant attribute to select font variant to use, _much_ faster rendering, full unicode support, getGlyphPos() and getGlyphSize() methods, avg_showfont.py utility (parts by oxullol02l.org). * Support for stereo sound mixing (Mostly Nick Hebner - hebern@gmail.com). * Support for audio playback for videos (Mostly Nick Hebner - hebern@gmail.com). Other improvements: * General Mac OS X 10.5 stability. * Added mediadir attribute for div nodes to specify where media used in child nodes should be loaded from. * Switched from ImageMagick to GraphicsMagick. * Nodes can now be constructed in python using a dict for the attributes (Nick Hebner - hebern@gmail.com). * Mouse Wheel support. * Added Player::setWindowPos() * Added Node::unlink() to remove a node from the tree. * The anim module now allows only one animation per node attribute. * avg_videoplayer.py utility. * Support for application-specific fonts. * Added Player::getGPUMemoryUsage() (oxullo@02l.net). * Experimental button, checkbox and textarea gui classes. * Added Player::loadString() to load avg tree from a string. * Added DivNode::reorderChild(), ::insertChildBefore() and ::removeChild(pNode). * Experimental TUIO protocol support in remote.py. * Support for bayer pattern decoding (oxullo@02l.net). * Added Node::getAbsPos(). * Added Node::getMediaSize(). * Unicode handling for keyboard events. * New Point2D class exposed to python. * Added anim.abortAnim(node, attrName). libavg 0.8.0.pre1 - September 9, 2008 svn revision 3118 libavg 0.7.1.pre1 - November 25, 2007 svn revision 2439 Major new features: * Rotating div nodes is now possible curtesy of Nick Hebner (hebnern@gmail.com) * Works with Mac OS X 10.5 (Leopard) Other improvements: * Improved font rendering on Mac (pango-1.18.2, freetype-2.3.5) * If AVG_CONSOLE_TEST is defined during make check, all tests that involve opening windows are skipped. * Fixed a memory corruption bug involving timeouts. * Added draggable class. * Added continuousAnimation class by Martin Heistermann * Added DivNode::reorderChild() * Fixes for new MacBook Pros with NVidia 8600 cards. libavg 0.7.0 - August 31, 2007 svn Revision 2309 Major new features: * Support for camera tracking and multitouch surfaces. (Lots of code by igor@c-base.org.) * Multi-threaded video decoding and video playback at speeds other than the player redraw speed. * API cleanups (not really a major feature, but a heads up that things will break :-)). * Much improved documentation. Other improvements: * Improved dynamic node API (DivNode::insertChild()). * Video4Linux support curtesy of Xullo (x@02l.net). * Update to new ffmpeg version. * Callback support on video end of file. * Support for python threads. * Improved warp interface. * Event callbacks now pass the event as a parameter. * Added Player::setOnFrameHandler(). * Added Node::getRelPos(). * Any pythoon callable can be used as event handler now using Node::setEventHandler(). * Added Anim.abort() and .isDone(). * Lots of new automatic low-level tests. * libavg now uses correct python package semantics. Use 'from libavg import avg' to import it now. It shouldn't be necessary to use PYTHONPATH anymore (igor@c-base.org). * Much faster Image::setBitmap(). libavg 0.6.0 - October 7, 2006 svn Revision 1664 Major new features: * Added support for dynamically adding and removing nodes to/from the tree. * libavg now runs under windows, curtesy of Thomas Schüppel. Other improvements: * Compatible with Mesa 6.5.1 OpenGL. * Much improved Gentoo ebuild. * Added event capture capability (setEventCapture/releaseEventCapture) to nodes. * Major speed improvement for motion jpeg videos. * Some panorama image improvements. * Text rendering speed improvements, minor text rendering quality improvements. * Fixed mac fontconfig configuration directory issue. * Fixed camera bug that caused an endless loop after 16 open/close cycles. * Better error checking for broken videos and missing video files. * More minor bugfixes. libavg 0.5.9 - August 11, 2006 * Test suite now completely automatic and a lot faster. libavg-1.8.2/bootstrap000077500000000000000000000015151236127404500147370ustar00rootroot00000000000000#!/bin/bash set -x set -e if [[ `uname` = Darwin ]] then if [[ x"$(which port)" = x"/opt/local/bin/port" ]] then echo "Macports detected" glibtoolize --copy --force aclocal -I m4 else if [[ "$AVG_MAC_ENV_SET" -ne "1" ]] then echo Please source mac/avg_env.sh before calling bootstrap. exit 5 fi # This uses locally-installed libtoolize and automake since the # apple-supplied one is buggy as of OS X 10.4.7 libtoolize --copy --force aclocal -I m4 # Patch that fixes 'absolute addressing not allowed in slidable # image' linker error. patch < mac/libtool.m4.patch m4/libtool.m4 fi else libtoolize --copy --force aclocal -I m4 fi autoheader automake --foreign --add-missing --copy autoconf libavg-1.8.2/compile000077500000000000000000000053261236127404500143560ustar00rootroot00000000000000#! /bin/sh # Wrapper for compilers which do not understand `-c -o'. # Copyright 1999, 2000 Free Software Foundation, Inc. # Written by Tom Tromey . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Usage: # compile PROGRAM [ARGS]... # `-o FOO.o' is removed from the args passed to the actual compile. prog=$1 shift ofile= cfile= args= while test $# -gt 0; do case "$1" in -o) # configure might choose to run compile as `compile cc -o foo foo.c'. # So we do something ugly here. ofile=$2 shift case "$ofile" in *.o | *.obj) ;; *) args="$args -o $ofile" ofile= ;; esac ;; *.c) cfile=$1 args="$args $1" ;; *) args="$args $1" ;; esac shift done if test -z "$ofile" || test -z "$cfile"; then # If no `-o' option was seen then we might have been invoked from a # pattern rule where we don't need one. That is ok -- this is a # normal compilation that the losing compiler can handle. If no # `.c' file was seen then we are probably linking. That is also # ok. exec "$prog" $args fi # Name of file we expect compiler to create. cofile=`echo $cfile | sed -e 's|^.*/||' -e 's/\.c$/.o/'` # Create the lock directory. # Note: use `[/.-]' here to ensure that we don't use the same name # that we are using for the .o file. Also, base the name on the expected # object file name, since that is what matters with a parallel build. lockdir=`echo $cofile | sed -e 's|[/.-]|_|g'`.d while true; do if mkdir $lockdir > /dev/null 2>&1; then break fi sleep 1 done # FIXME: race condition here if user kills between mkdir and trap. trap "rmdir $lockdir; exit 1" 1 2 15 # Run the compile. "$prog" $args status=$? if test -f "$cofile"; then mv "$cofile" "$ofile" fi rmdir $lockdir exit $status libavg-1.8.2/configure.ac000066400000000000000000000173131236127404500152650ustar00rootroot00000000000000 AC_PREREQ(2.53) dnl Use this file to bump version on release m4_include([m4/avg_version.m4]) AC_INIT(libavg, [VERSION_MAJOR.VERSION_MINOR.VERSION_MICRO], uzadow@libavg.de) dnl Hack to detect virtualenv if [[ x"$VIRTUAL_ENV" != "x" ]] && [[ $prefix = NONE ]]; then prefix=$VIRTUAL_ENV AC_MSG_RESULT([Virtualenv detected, setting prefix to $prefix]) fi AC_CANONICAL_TARGET AC_DISABLE_STATIC AC_PROG_LIBTOOL AC_CONFIG_MACRO_DIR([m4]) AC_CONFIG_SRCDIR([src/avgconfig.h.in]) AM_INIT_AUTOMAKE([check-news dist-zip]) m4_ifdef([AM_SILENT_RULES],[AM_SILENT_RULES([yes])]) # Checks for programs. AC_PROG_CXX AC_PROG_CC AC_PROG_CPP CXXFLAGS="-O3 -ffast-math -Wall -pipe -Wno-invalid-offsetof -Woverloaded-virtual -Wswitch -Wuninitialized -Wempty-body $CXXFLAGS" CFLAGS="-O3 -ffast-math -Wall -pipe $CFLAGS" if [[ $host_cpu == i386 ]] || [[ $host_cpu == i686 ]] || [[ $host_cpu == x86_64 ]]; then CXXFLAGS="-msse2 $CXXFLAGS" CFLAGS="-msse2 $CFLAGS" fi OBJC="gcc" OBJCFLAGS="" OBJCLDFLAGS="-lobjc" AC_SUBST(OBJC) AC_SUBST(OBJCFLAGS) AC_SUBST(OBJCLDFLAGS) _AM_DEPENDENCIES([OBJC]) LDFLAGS="$LDFLAGS -rdynamic" if [[ $target_vendor = apple ]] && [[ x"`which port`" = x"/opt/local/bin/port" ]]; then AC_MSG_RESULT([Macports detected. Adding include and lib search paths]) CFLAGS="$CFLAGS -I/opt/local/include" CXXFLAGS="$CXXFLAGS -I/opt/local/include" LDFLAGS="$LDFLAGS -L/opt/local/lib" fi AC_SEARCH_LIBS([clock_gettime],[rt]) AC_CHECK_LIB([dl], [dlopen]) AC_PATH_GENERIC(xml2,,,AC_MSG_ERROR([libxml2 not found. Aborting.])) PKG_CHECK_MODULES([PANGOFT2], [pangoft2]) AC_PATH_GENERIC(freetype,,,AC_MSG_ERROR([libfreetype not found. Aborting.])) PKG_CHECK_MODULES([GDK_PIXBUF], [gdk-pixbuf-2.0]) PKG_CHECK_MODULES([LIBRSVG], [librsvg-2.0]) PKG_CHECK_MODULES([FONTCONFIG], [fontconfig]) PKG_CHECK_MODULES([FFMPEG], [libswscale libavformat libavcodec libavutil], [LIBFFMPEG="$FFMPEG_LIBS"], [:]) AC_SUBST(LIBFFMPEG) AC_CHECK_HEADERS([libavformat/avformat.h]) if test -z "$FFMPEG_LIBS"; then AC_MSG_ERROR([Could not find ffmpeg development libraries.]) fi PKG_CHECK_MODULES([AVRESAMPLE], [libavresample], [LIBAVRESAMPLE="$AVRESAMPLE_LIBS"], [:]) AC_SUBST(LIBAVRESAMPLE) AC_CHECK_HEADERS([libavresample/avresample.h]) AM_PATH_PYTHON AX_PYTHON_DEVEL AC_ARG_VAR(BOOST_PYTHON_LIBS, [linker flags for BOOST, defaults to -lboost_python]) if test -z "$BOOST_PYTHON_LIBS" then AC_CHECK_LIB(boost_python, main, libboost_python_installed=yes, , $PYTHON_LDFLAGS) if test -z "$libboost_python_installed" then AC_MSG_ERROR([boost.python not found. Aborting.]) fi BOOST_PYTHON_LIBS="-lboost_python" fi AX_BOOST_THREAD if test -z "$BOOST_THREAD_LIBS"; then AC_MSG_ERROR([boost.thread not found. Aborting.]) fi AC_ARG_ENABLE(dc1394, AC_HELP_STRING([--enable-dc1394], [compile support for firewire cameras]), enable_1394=$enableval, enable_1394=maybe) if test "$enable_1394" = maybe; then PKG_CHECK_MODULES([DC1394_2], [libdc1394-2],,AC_MSG_NOTICE([libdc1394 ver 2 not found])) fi AM_CONDITIONAL(ENABLE_1394_2, test x"$DC1394_2_LIBS" != x ) if test x"$DC1394_2_LIBS" != "x"; then AC_DEFINE(AVG_ENABLE_1394_2, 1, [Enable firewire camera support v.2]) fi PKG_CHECK_MODULES([MTDEV], [mtdev], [AC_DEFINE(AVG_ENABLE_MTDEV, 1, [Enable Linux kernel multitouch])], AC_MSG_NOTICE(mtdev not found)) AM_CONDITIONAL(ENABLE_MTDEV, test x"$MTDEV_LIBS" != x) if test $target_vendor = apple; then AM_CONDITIONAL(HAVE_XI2_1, false) AM_CONDITIONAL(HAVE_XI2_2, false) else PKG_CHECK_MODULES(XI2_1, [xi >= 1.4.1.99.1] [inputproto >= 2.0.99.1] [inputproto < 2.1.99.5], HAVE_XI2_1="yes"; AC_DEFINE(HAVE_XI2_1, 1, [XI2_1 available]), HAVE_XI2_1="no"); PKG_CHECK_MODULES(XI2_2, [xi >= 1.5.99.2] [inputproto >= 2.1.99.5], HAVE_XI2_2="yes"; AC_DEFINE(HAVE_XI2_2, 1, [XI2_2 available]), HAVE_XI2_2="no"); AM_CONDITIONAL(HAVE_XI2_1, [ test "$HAVE_XI2_1" = "yes" ]) AM_CONDITIONAL(HAVE_XI2_2, [ test "$HAVE_XI2_2" = "yes" ]) fi AC_ARG_ENABLE(v4l2, AC_HELP_STRING([--enable-v4l2], [compile support for video4linux v2 video devices]), enable_v4l2=$enableval, enable_v4l2=maybe) if test "$enable_v4l2" = maybe; then AC_CHECK_TYPE([struct v4l2_buffer], [enable_v4l2=yes], [enable_v4l2=no], [#include #include ]) fi AM_CONDITIONAL(ENABLE_V4L2, test x$enable_v4l2 = xyes) if test "$enable_v4l2" = yes; then AC_DEFINE(AVG_ENABLE_V4L2, 1, [Enable Video4Linux2 camera support]) fi AC_CHECK_HEADER([linux/ppdev.h], enable_ParPort=yes, enable_ParPort=no) AM_CONDITIONAL(ENABLE_PARPORT, test x$enable_ParPort = xyes) if test "$enable_ParPort" = yes; then AC_DEFINE(AVG_ENABLE_PARPORT, 1, [Enable parallel port support]) fi AC_ARG_ENABLE(egl, AC_HELP_STRING([--enable-egl], [include EGL support [default=no]]), , enable_egl=no) AC_ARG_ENABLE(rpi, AC_HELP_STRING([--enable-rpi], [configure for RaspberryPi [default=no]]), , enable_rpi=no) if test "$enable_rpi" = yes; then CPPFLAGS="$CPPFLAGS -I/opt/vc/include -I/opt/vc/include/interface/vmcs_host/linux -I/opt/vc/include/interface/vcos/pthreads" LDFLAGS="$LDFLAGS -L/opt/vc/lib" AC_DEFINE(AVG_ENABLE_RPI, 1, [Build on RaspberryPi]) AM_CONDITIONAL(ENABLE_RPI, true) if test "$enable_egl" = no; then enable_egl=yes AC_MSG_NOTICE([--enable-rpi requires --enable-egl, added --enable-egl]) fi # suppress several hundreds "swp{b} use is deprecated for this architecture" assembler warnings CFLAGS="$CFLAGS -Wa,--no-warn" CXXFLAGS="$CXXFLAGS -Wa,--no-warn" else AM_CONDITIONAL(ENABLE_RPI, false) fi if test "$enable_egl" = yes; then AC_CHECK_HEADERS(["EGL/egl.h"], [egl_present=yes;]) AC_CHECK_HEADERS(["GLES2/gl2.h"], [gles2_present=yes;]) if [[ x"$egl_present" == x ]] || [[ x"$gles2_present" == x ]]; then AC_MSG_ERROR([EGL not found. Aborting]) fi AC_DEFINE(AVG_ENABLE_EGL, 1, [Enable EGL support]) else AX_CHECK_GL AX_CHECK_GLU if test x"$GL_LIBS" = x; then AC_MSG_ERROR([OpenGL not found. Aborting]) fi AC_DEFINE(AVG_ENABLE_OPENGL, 1, [Enable OpenGL support]) fi AM_CONDITIONAL(ENABLE_EGL, test x"$egl_present" != x) AM_CONDITIONAL(ENABLE_OPENGL, test x"$GL_LIBS" != x) AM_PATH_SDL(1.2.10,:,AC_MSG_ERROR([libSDL not found. Aborting.])) AC_CHECK_LIB([vdpau],[main],let vdpau_lib=1,let vdpau_lib=0) AC_CHECK_HEADERS([libavcodec/vdpau.h],let vdpau_h1=1,let vdpau_h1=0) AC_CHECK_HEADERS([vdpau/vdpau.h],let vdpau_h2=1,let vdpau_h2=0) if [[ $vdpau_lib -eq 1 ]] && [[ $vdpau_h1 -eq 1 ]] && [[ $vdpau_h2 -eq 1 ]]; then AC_DEFINE(AVG_ENABLE_VDPAU, 1, [Enable VDPAU support]) LIBVIDEO_LDADD="-lvdpau" AM_CONDITIONAL(USE_VDPAU_SRC, true) else LIBVIDEO_LDADD="" AM_CONDITIONAL(USE_VDPAU_SRC, false) fi AC_SUBST([LIBVIDEO_LDADD]) AM_CONDITIONAL(APPLE, test $target_vendor = apple) PREFIX=$prefix AC_SUBST(PREFIX) AC_CONFIG_HEADERS(src/avgconfig.h) AC_OUTPUT(Makefile src/Makefile src/test/Makefile src/test/plugin/Makefile src/base/Makefile src/base/triangulate/Makefile src/lmfit/Makefile src/wrapper/Makefile src/player/Makefile src/graphics/Makefile src/graphics/shaders/Makefile src/python/Makefile src/imaging/Makefile src/video/Makefile src/audio/Makefile src/utils/Makefile src/anim/Makefile src/python/data/Makefile src/samples/Makefile src/samples/firebirds/Makefile src/samples/firebirds/plugin/Makefile src/samples/firebirds/media/Makefile src/python/widget/Makefile src/python/app/Makefile src/oscpack/Makefile man/Makefile) libavg-1.8.2/depcomp000077500000000000000000000325611236127404500143560ustar00rootroot00000000000000#! /bin/sh # depcomp - compile a program generating dependencies as side-effects # Copyright 1999, 2000 Free Software Foundation, Inc. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # Originally written by Alexandre Oliva . if test -z "$depmode" || test -z "$source" || test -z "$object"; then echo "depcomp: Variables source, object and depmode must be set" 1>&2 exit 1 fi # `libtool' can also be set to `yes' or `no'. if test -z "$depfile"; then base=`echo "$object" | sed -e 's,^.*/,,' -e 's,\.\([^.]*\)$,.P\1,'` dir=`echo "$object" | sed 's,/.*$,/,'` if test "$dir" = "$object"; then dir= fi # FIXME: should be _deps on DOS. depfile="$dir.deps/$base" fi tmpdepfile=${tmpdepfile-`echo "$depfile" | sed 's/\.\([^.]*\)$/.T\1/'`} rm -f "$tmpdepfile" # Some modes work just like other modes, but use different flags. We # parameterize here, but still list the modes in the big case below, # to make depend.m4 easier to write. Note that we *cannot* use a case # here, because this file can only contain one case statement. if test "$depmode" = hp; then # HP compiler uses -M and no extra arg. gccflag=-M depmode=gcc fi if test "$depmode" = dashXmstdout; then # This is just like dashmstdout with a different argument. dashmflag=-xM depmode=dashmstdout fi case "$depmode" in gcc3) ## gcc 3 implements dependency tracking that does exactly what ## we want. Yay! Note: for some reason libtool 1.4 doesn't like ## it if -MD -MP comes after the -MF stuff. Hmm. "$@" -MT "$object" -MD -MP -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi mv "$tmpdepfile" "$depfile" ;; gcc) ## There are various ways to get dependency output from gcc. Here's ## why we pick this rather obscure method: ## - Don't want to use -MD because we'd like the dependencies to end ## up in a subdir. Having to rename by hand is ugly. ## (We might end up doing this anyway to support other compilers.) ## - The DEPENDENCIES_OUTPUT environment variable makes gcc act like ## -MM, not -M (despite what the docs say). ## - Using -M directly means running the compiler twice (even worse ## than renaming). if test -z "$gccflag"; then gccflag=-MD, fi "$@" -Wp,"$gccflag$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" echo "$object : \\" > "$depfile" alpha=ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz ## The second -e expression handles DOS-style file names with drive letters. sed -e 's/^[^:]*: / /' \ -e 's/^['$alpha']:\/[^:]*: / /' < "$tmpdepfile" >> "$depfile" ## This next piece of magic avoids the `deleted header file' problem. ## The problem is that when a header file which appears in a .P file ## is deleted, the dependency causes make to die (because there is ## typically no way to rebuild the header). We avoid this by adding ## dummy dependencies for each header file. Too bad gcc doesn't do ## this for us directly. tr ' ' ' ' < "$tmpdepfile" | ## Some versions of gcc put a space before the `:'. On the theory ## that the space means something, we add a space to the output as ## well. ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; hp) # This case exists only to let depend.m4 do its work. It works by # looking at the text of this script. This case will never be run, # since it is checked for above. exit 1 ;; sgi) if test "$libtool" = yes; then "$@" "-Wp,-MDupdate,$tmpdepfile" else "$@" -MDupdate "$tmpdepfile" fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" if test -f "$tmpdepfile"; then # yes, the sourcefile depend on other files echo "$object : \\" > "$depfile" # Clip off the initial element (the dependent). Don't try to be # clever and replace this with sed code, as IRIX sed won't handle # lines with more than a fixed number of characters (4096 in # IRIX 6.2 sed, 8192 in IRIX 6.5). We also remove comment lines; # the IRIX cc adds comments like `#:fec' to the end of the # dependency line. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' | \ tr ' ' ' ' >> $depfile echo >> $depfile # The second pass generates a dummy entry for each header file. tr ' ' ' ' < "$tmpdepfile" \ | sed -e 's/^.*\.o://' -e 's/#.*$//' -e '/^$/ d' -e 's/$/:/' \ >> $depfile else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; aix) # The C for AIX Compiler uses -M and outputs the dependencies # in a .u file. This file always lives in the current directory. # Also, the AIX compiler puts `$object:' at the start of each line; # $object doesn't have directory information. stripped=`echo "$object" | sed -e 's,^.*/,,' -e 's/\(.*\)\..*$/\1/'` tmpdepfile="$stripped.u" outname="$stripped.o" if test "$libtool" = yes; then "$@" -Wc,-M else "$@" -M fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi if test -f "$tmpdepfile"; then # Each line is of the form `foo.o: dependent.h'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed -e "s,^$outname:,$object :," < "$tmpdepfile" > "$depfile" sed -e "s,^$outname: \(.*\)$,\1:," < "$tmpdepfile" >> "$depfile" else # The sourcefile does not contain any dependencies, so just # store a dummy comment line, to avoid errors with the Makefile # "include basename.Plo" scheme. echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; icc) # Intel's C compiler understands `-MD -MF file'. However on # icc -MD -MF foo.d -c -o sub/foo.o sub/foo.c # ICC 7.0 will fill foo.d with something like # foo.o: sub/foo.c # foo.o: sub/foo.h # which is wrong. We want: # sub/foo.o: sub/foo.c # sub/foo.o: sub/foo.h # sub/foo.c: # sub/foo.h: # ICC 7.1 will output # foo.o: sub/foo.c sub/foo.h # and will wrap long lines using \ : # foo.o: sub/foo.c ... \ # sub/foo.h ... \ # ... "$@" -MD -MF "$tmpdepfile" stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile" exit $stat fi rm -f "$depfile" # Each line is of the form `foo.o: dependent.h', # or `foo.o: dep1.h dep2.h \', or ` dep3.h dep4.h \'. # Do two passes, one to just change these to # `$object: dependent.h' and one to simply `dependent.h:'. sed "s,^[^:]*:,$object :," < "$tmpdepfile" > "$depfile" # Some versions of the HPUX 10.20 sed can't process this invocation # correctly. Breaking it into two sed invocations is a workaround. sed 's,^[^:]*: \(.*\)$,\1,;s/^\\$//;/^$/d;/:$/d' < "$tmpdepfile" | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; tru64) # The Tru64 compiler uses -MD to generate dependencies as a side # effect. `cc -MD -o foo.o ...' puts the dependencies into `foo.o.d'. # At least on Alpha/Redhat 6.1, Compaq CCC V6.2-504 seems to put # dependencies in `foo.d' instead, so we check for that too. # Subdirectories are respected. dir=`echo "$object" | sed -e 's|/[^/]*$|/|'` test "x$dir" = "x$object" && dir= base=`echo "$object" | sed -e 's|^.*/||' -e 's/\.o$//' -e 's/\.lo$//'` if test "$libtool" = yes; then tmpdepfile1="$dir.libs/$base.lo.d" tmpdepfile2="$dir.libs/$base.d" "$@" -Wc,-MD else tmpdepfile1="$dir$base.o.d" tmpdepfile2="$dir$base.d" "$@" -MD fi stat=$? if test $stat -eq 0; then : else rm -f "$tmpdepfile1" "$tmpdepfile2" exit $stat fi if test -f "$tmpdepfile1"; then tmpdepfile="$tmpdepfile1" else tmpdepfile="$tmpdepfile2" fi if test -f "$tmpdepfile"; then sed -e "s,^.*\.[a-z]*:,$object:," < "$tmpdepfile" > "$depfile" # That's a space and a tab in the []. sed -e 's,^.*\.[a-z]*:[ ]*,,' -e 's,$,:,' < "$tmpdepfile" >> "$depfile" else echo "#dummy" > "$depfile" fi rm -f "$tmpdepfile" ;; #nosideeffect) # This comment above is used by automake to tell side-effect # dependency tracking mechanisms from slower ones. dashmstdout) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done test -z "$dashmflag" && dashmflag=-M # Require at least two characters before searching for `:' # in the target name. This is to cope with DOS-style filenames: # a dependency such as `c:/foo/bar' could be seen as target `c' otherwise. "$@" $dashmflag | sed 's:^[ ]*[^: ][^:][^:]*\:[ ]*:'"$object"'\: :' > "$tmpdepfile" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" tr ' ' ' ' < "$tmpdepfile" | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; dashXmstdout) # This case only exists to satisfy depend.m4. It is never actually # run, as this mode is specially recognized in the preamble. exit 1 ;; makedepend) "$@" || exit $? # Remove any Libtool call if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # X makedepend shift cleared=no for arg in "$@"; do case $cleared in no) set ""; shift cleared=yes ;; esac case "$arg" in -D*|-I*) set fnord "$@" "$arg"; shift ;; # Strip any option that makedepend may not understand. Remove # the object too, otherwise makedepend will parse it as a source file. -*|$object) ;; *) set fnord "$@" "$arg"; shift ;; esac done obj_suffix="`echo $object | sed 's/^.*\././'`" touch "$tmpdepfile" ${MAKEDEPEND-makedepend} -o"$obj_suffix" -f"$tmpdepfile" "$@" rm -f "$depfile" cat < "$tmpdepfile" > "$depfile" sed '1,2d' "$tmpdepfile" | tr ' ' ' ' | \ ## Some versions of the HPUX 10.20 sed can't process this invocation ## correctly. Breaking it into two sed invocations is a workaround. sed -e 's/^\\$//' -e '/^$/d' -e '/:$/d' | sed -e 's/$/ :/' >> "$depfile" rm -f "$tmpdepfile" "$tmpdepfile".bak ;; cpp) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout. "$@" || exit $? # Remove the call to Libtool. if test "$libtool" = yes; then while test $1 != '--mode=compile'; do shift done shift fi # Remove `-o $object'. IFS=" " for arg do case $arg in -o) shift ;; $object) shift ;; *) set fnord "$@" "$arg" shift # fnord shift # $arg ;; esac done "$@" -E | sed -n '/^# [0-9][0-9]* "\([^"]*\)".*/ s:: \1 \\:p' | sed '$ s: \\$::' > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" cat < "$tmpdepfile" >> "$depfile" sed < "$tmpdepfile" '/^$/d;s/^ //;s/ \\$//;s/$/ :/' >> "$depfile" rm -f "$tmpdepfile" ;; msvisualcpp) # Important note: in order to support this mode, a compiler *must* # always write the proprocessed file to stdout, regardless of -o, # because we must use -o when running libtool. "$@" || exit $? IFS=" " for arg do case "$arg" in "-Gm"|"/Gm"|"-Gi"|"/Gi"|"-ZI"|"/ZI") set fnord "$@" shift shift ;; *) set fnord "$@" "$arg" shift shift ;; esac done "$@" -E | sed -n '/^#line [0-9][0-9]* "\([^"]*\)"/ s::echo "`cygpath -u \\"\1\\"`":p' | sort | uniq > "$tmpdepfile" rm -f "$depfile" echo "$object : \\" > "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s:: \1 \\:p' >> "$depfile" echo " " >> "$depfile" . "$tmpdepfile" | sed 's% %\\ %g' | sed -n '/^\(.*\)$/ s::\1\::p' >> "$depfile" rm -f "$tmpdepfile" ;; none) exec "$@" ;; *) echo "Unknown depmode $depmode" 1>&2 exit 1 ;; esac exit 0 libavg-1.8.2/fixcopyright.py000077500000000000000000000016001236127404500160630ustar00rootroot00000000000000#!/usr/bin/env python import os import re def handleFile(path): lines = file(path).readlines() lineNumber = 0 found = False for i, line in enumerate(lines): match = re.match(r'((//)|(#))\s*Copyright \(C\) 2003-(.*) Ulrich von Zadow\s*', line) # m = re.match(r'#include\s*["<]([\-_a-zA-Z0-9\.\\/]+)[">]\s*', l) if match: if path[-2:] == 'py': lines[i] = "# Copyright (C) 2003-2014 Ulrich von Zadow\n" else: lines[i] = "// Copyright (C) 2003-2014 Ulrich von Zadow\n" found = True if found: outFile = open(path, "w") for line in lines: outFile.write(line) else: print path for ext in ("h", "c", "cpp", "py"): cmd = 'find . -name "*.'+ext+'"' files = os.popen(cmd).readlines() for f in files: handleFile(f.strip()) libavg-1.8.2/install-sh000077500000000000000000000157221236127404500150050ustar00rootroot00000000000000#!/bin/sh # # install - install a program, script, or datafile # # This originates from X11R5 (mit/util/scripts/install.sh), which was # later released in X11R6 (xc/config/util/install.sh) with the # following copyright and license. # # Copyright (C) 1994 X Consortium # # Permission is hereby granted, free of charge, to any person obtaining a copy # of this software and associated documentation files (the "Software"), to # deal in the Software without restriction, including without limitation the # rights to use, copy, modify, merge, publish, distribute, sublicense, and/or # sell copies of the Software, and to permit persons to whom the Software is # furnished to do so, subject to the following conditions: # # The above copyright notice and this permission notice shall be included in # all copies or substantial portions of the Software. # # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE # X CONSORTIUM BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN # AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNEC- # TION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. # # Except as contained in this notice, the name of the X Consortium shall not # be used in advertising or otherwise to promote the sale, use or other deal- # ings in this Software without prior written authorization from the X Consor- # tium. # # # FSF changes to this file are in the public domain. # # Calling this script install-sh is preferred over install.sh, to prevent # `make' implicit rules from creating a file called install from it # when there is no Makefile. # # This script is compatible with the BSD install script, but was written # from scratch. It can only install one file at a time, a restriction # shared with many OS's install programs. # set DOITPROG to echo to test this script # Don't use :- since 4.3BSD and earlier shells don't like it. doit="${DOITPROG-}" # put in absolute paths if you don't have them in your path; or use env. vars. mvprog="${MVPROG-mv}" cpprog="${CPPROG-cp}" chmodprog="${CHMODPROG-chmod}" chownprog="${CHOWNPROG-chown}" chgrpprog="${CHGRPPROG-chgrp}" stripprog="${STRIPPROG-strip}" rmprog="${RMPROG-rm}" mkdirprog="${MKDIRPROG-mkdir}" transformbasename="" transform_arg="" instcmd="$mvprog" chmodcmd="$chmodprog 0755" chowncmd="" chgrpcmd="" stripcmd="" rmcmd="$rmprog -f" mvcmd="$mvprog" src="" dst="" dir_arg="" while [ x"$1" != x ]; do case $1 in -c) instcmd=$cpprog shift continue;; -d) dir_arg=true shift continue;; -m) chmodcmd="$chmodprog $2" shift shift continue;; -o) chowncmd="$chownprog $2" shift shift continue;; -g) chgrpcmd="$chgrpprog $2" shift shift continue;; -s) stripcmd=$stripprog shift continue;; -t=*) transformarg=`echo $1 | sed 's/-t=//'` shift continue;; -b=*) transformbasename=`echo $1 | sed 's/-b=//'` shift continue;; *) if [ x"$src" = x ] then src=$1 else # this colon is to work around a 386BSD /bin/sh bug : dst=$1 fi shift continue;; esac done if [ x"$src" = x ] then echo "$0: no input file specified" >&2 exit 1 else : fi if [ x"$dir_arg" != x ]; then dst=$src src="" if [ -d "$dst" ]; then instcmd=: chmodcmd="" else instcmd=$mkdirprog fi else # Waiting for this to be detected by the "$instcmd $src $dsttmp" command # might cause directories to be created, which would be especially bad # if $src (and thus $dsttmp) contains '*'. if [ -f "$src" ] || [ -d "$src" ] then : else echo "$0: $src does not exist" >&2 exit 1 fi if [ x"$dst" = x ] then echo "$0: no destination specified" >&2 exit 1 else : fi # If destination is a directory, append the input filename; if your system # does not like double slashes in filenames, you may need to add some logic if [ -d "$dst" ] then dst=$dst/`basename "$src"` else : fi fi ## this sed command emulates the dirname command dstdir=`echo "$dst" | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'` # Make sure that the destination directory exists. # this part is taken from Noah Friedman's mkinstalldirs script # Skip lots of stat calls in the usual case. if [ ! -d "$dstdir" ]; then defaultIFS=' ' IFS="${IFS-$defaultIFS}" oIFS=$IFS # Some sh's can't handle IFS=/ for some reason. IFS='%' set - `echo "$dstdir" | sed -e 's@/@%@g' -e 's@^%@/@'` IFS=$oIFS pathcomp='' while [ $# -ne 0 ] ; do pathcomp=$pathcomp$1 shift if [ ! -d "$pathcomp" ] ; then $mkdirprog "$pathcomp" else : fi pathcomp=$pathcomp/ done fi if [ x"$dir_arg" != x ] then $doit $instcmd "$dst" && if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dst"; else : ; fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dst"; else : ; fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dst"; else : ; fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dst"; else : ; fi else # If we're going to rename the final executable, determine the name now. if [ x"$transformarg" = x ] then dstfile=`basename "$dst"` else dstfile=`basename "$dst" $transformbasename | sed $transformarg`$transformbasename fi # don't allow the sed command to completely eliminate the filename if [ x"$dstfile" = x ] then dstfile=`basename "$dst"` else : fi # Make a couple of temp file names in the proper directory. dsttmp=$dstdir/_inst.$$_ rmtmp=$dstdir/_rm.$$_ # Trap to clean up temp files at exit. trap 'status=$?; rm -f "$dsttmp" "$rmtmp" && exit $status' 0 trap '(exit $?); exit' 1 2 13 15 # Move or copy the file name to the temp name $doit $instcmd "$src" "$dsttmp" && # and set any options; do chmod last to preserve setuid bits # If any of these fail, we abort the whole thing. If we want to # ignore errors from any of these, just make sure not to ignore # errors from the above "$doit $instcmd $src $dsttmp" command. if [ x"$chowncmd" != x ]; then $doit $chowncmd "$dsttmp"; else :;fi && if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd "$dsttmp"; else :;fi && if [ x"$stripcmd" != x ]; then $doit $stripcmd "$dsttmp"; else :;fi && if [ x"$chmodcmd" != x ]; then $doit $chmodcmd "$dsttmp"; else :;fi && # Now remove or move aside any old file at destination location. We try this # two ways since rm can't unlink itself on some systems and the destination # file might be busy for other reasons. In this case, the final cleanup # might fail but the new file should still install successfully. { if [ -f "$dstdir/$dstfile" ] then $doit $rmcmd -f "$dstdir/$dstfile" 2>/dev/null || $doit $mvcmd -f "$dstdir/$dstfile" "$rmtmp" 2>/dev/null || { echo "$0: cannot unlink or rename $dstdir/$dstfile" >&2 (exit 1); exit } else : fi } && # Now rename the file to the real destination. $doit $mvcmd "$dsttmp" "$dstdir/$dstfile" fi && # The final little trick to "correctly" pass the exit status to the exit trap. { (exit 0); exit } libavg-1.8.2/m4/000077500000000000000000000000001236127404500133125ustar00rootroot00000000000000libavg-1.8.2/m4/ac_cxx_namespaces.m4000066400000000000000000000013571236127404500172260ustar00rootroot00000000000000dnl @synopsis AC_CXX_NAMESPACES dnl dnl If the compiler can prevent names clashes using namespaces, define dnl HAVE_NAMESPACES. dnl dnl @category Cxx dnl @author Todd Veldhuizen dnl @author Luc Maisonobe dnl @version 2004-02-04 dnl @license AllPermissive AC_DEFUN([AC_CXX_NAMESPACES], [AC_CACHE_CHECK(whether the compiler implements namespaces, ac_cv_cxx_namespaces, [AC_LANG_SAVE AC_LANG_CPLUSPLUS AC_TRY_COMPILE([namespace Outer { namespace Inner { int i = 0; }}], [using namespace Outer::Inner; return i;], ac_cv_cxx_namespaces=yes, ac_cv_cxx_namespaces=no) AC_LANG_RESTORE ]) if test "$ac_cv_cxx_namespaces" = yes; then AC_DEFINE(HAVE_NAMESPACES,,[define if the compiler implements namespaces]) fi ]) libavg-1.8.2/m4/ac_path_generic.m4000066400000000000000000000135411236127404500166530ustar00rootroot00000000000000dnl @synopsis AC_PATH_GENERIC(LIBRARY [, MINIMUM-VERSION [, ACTION-IF-FOUND [, ACTION-IF-NOT-FOUND]]]) dnl dnl Runs a LIBRARY-config script and defines LIBRARY_CFLAGS and dnl LIBRARY_LIBS dnl dnl The script must support `--cflags' and `--libs' args. If dnl MINIMUM-VERSION is specified, the script must also support the dnl `--version' arg. If the `--with-library-[exec-]prefix' arguments to dnl ./configure are given, it must also support `--prefix' and dnl `--exec-prefix'. (In other words, it must be like gtk-config.) dnl dnl For example: dnl dnl AC_PATH_GENERIC(Foo, 1.0.0) dnl dnl would run `foo-config --version' and check that it is at least dnl 1.0.0 dnl dnl If so, the following would then be defined: dnl dnl FOO_CFLAGS to `foo-config --cflags` dnl FOO_LIBS to `foo-config --libs` dnl dnl At present there is no support for additional "MODULES" (see dnl AM_PATH_GTK) (shamelessly stolen from gtk.m4 and then hacked around dnl a fair amount) dnl dnl @category Misc dnl @author Angus Lees dnl @version 2001-03-16 dnl @license GPLWithACException AC_DEFUN([AC_PATH_GENERIC], [dnl dnl we're going to need uppercase, lowercase and user-friendly versions of the dnl string `LIBRARY' pushdef([UP], translit([$1], [a-z], [A-Z]))dnl pushdef([DOWN], translit([$1], [A-Z], [a-z]))dnl dnl dnl Get the cflags and libraries from the LIBRARY-config script dnl AC_ARG_WITH(DOWN-prefix,[ --with-]DOWN[-prefix=PFX Prefix where $1 is installed (optional)], DOWN[]_config_prefix="$withval", DOWN[]_config_prefix="") AC_ARG_WITH(DOWN-exec-prefix,[ --with-]DOWN[-exec-prefix=PFX Exec prefix where $1 is installed (optional)], DOWN[]_config_exec_prefix="$withval", DOWN[]_config_exec_prefix="") if test x$DOWN[]_config_exec_prefix != x ; then DOWN[]_config_args="$DOWN[]_config_args --exec-prefix=$DOWN[]_config_exec_prefix" if test x${UP[]_CONFIG+set} != xset ; then UP[]_CONFIG=$DOWN[]_config_exec_prefix/bin/DOWN-config fi fi if test x$DOWN[]_config_prefix != x ; then DOWN[]_config_args="$DOWN[]_config_args --prefix=$DOWN[]_config_prefix" if test x${UP[]_CONFIG+set} != xset ; then UP[]_CONFIG=$DOWN[]_config_prefix/bin/DOWN-config fi fi AC_PATH_PROG(UP[]_CONFIG, DOWN-config, no) ifelse([$2], , AC_MSG_CHECKING(for $1), AC_MSG_CHECKING(for $1 - version >= $2) ) no_[]DOWN="" if test "$UP[]_CONFIG" = "no" ; then no_[]DOWN=yes else UP[]_CFLAGS="`$UP[]_CONFIG $DOWN[]_config_args --cflags`" UP[]_LIBS="`$UP[]_CONFIG $DOWN[]_config_args --libs`" ifelse([$2], , ,[ DOWN[]_config_major_version=`$UP[]_CONFIG $DOWN[]_config_args \ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\1/'` DOWN[]_config_minor_version=`$UP[]_CONFIG $DOWN[]_config_args \ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\2/'` DOWN[]_config_micro_version=`$UP[]_CONFIG $DOWN[]_config_args \ --version | sed 's/[[^0-9]]*\([[0-9]]*\).\([[0-9]]*\).\([[0-9]]*\)/\3/'` DOWN[]_wanted_major_version="regexp($2, [\<\([0-9]*\)], [\1])" DOWN[]_wanted_minor_version="regexp($2, [\<\([0-9]*\)\.\([0-9]*\)], [\2])" DOWN[]_wanted_micro_version="regexp($2, [\<\([0-9]*\).\([0-9]*\).\([0-9]*\)], [\3])" # Compare wanted version to what config script returned. # If I knew what library was being run, i'd probably also compile # a test program at this point (which also extracted and tested # the version in some library-specific way) if test "$DOWN[]_config_major_version" -lt \ "$DOWN[]_wanted_major_version" \ -o \( "$DOWN[]_config_major_version" -eq \ "$DOWN[]_wanted_major_version" \ -a "$DOWN[]_config_minor_version" -lt \ "$DOWN[]_wanted_minor_version" \) \ -o \( "$DOWN[]_config_major_version" -eq \ "$DOWN[]_wanted_major_version" \ -a "$DOWN[]_config_minor_version" -eq \ "$DOWN[]_wanted_minor_version" \ -a "$DOWN[]_config_micro_version" -lt \ "$DOWN[]_wanted_micro_version" \) ; then # older version found no_[]DOWN=yes echo -n "*** An old version of $1 " echo -n "($DOWN[]_config_major_version" echo -n ".$DOWN[]_config_minor_version" echo ".$DOWN[]_config_micro_version) was found." echo -n "*** You need a version of $1 newer than " echo -n "$DOWN[]_wanted_major_version" echo -n ".$DOWN[]_wanted_minor_version" echo ".$DOWN[]_wanted_micro_version." echo "***" echo "*** If you have already installed a sufficiently new version, this error" echo "*** probably means that the wrong copy of the DOWN-config shell script is" echo "*** being found. The easiest way to fix this is to remove the old version" echo "*** of $1, but you can also set the UP[]_CONFIG environment to point to the" echo "*** correct copy of DOWN-config. (In this case, you will have to" echo "*** modify your LD_LIBRARY_PATH environment variable, or edit /etc/ld.so.conf" echo "*** so that the correct libraries are found at run-time)" fi ]) fi if test "x$no_[]DOWN" = x ; then AC_MSG_RESULT(yes) ifelse([$3], , :, [$3]) else AC_MSG_RESULT(no) if test "$UP[]_CONFIG" = "no" ; then echo "*** The DOWN-config script installed by $1 could not be found" echo "*** If $1 was installed in PREFIX, make sure PREFIX/bin is in" echo "*** your path, or set the UP[]_CONFIG environment variable to the" echo "*** full path to DOWN-config." fi UP[]_CFLAGS="" UP[]_LIBS="" ifelse([$4], , :, [$4]) fi AC_SUBST(UP[]_CFLAGS) AC_SUBST(UP[]_LIBS) popdef([UP]) popdef([DOWN]) ]) libavg-1.8.2/m4/avg_version.m4000066400000000000000000000001401236127404500160710ustar00rootroot00000000000000m4_define([VERSION_MAJOR], [1]) m4_define([VERSION_MINOR], [8]) m4_define([VERSION_MICRO], [2]) libavg-1.8.2/m4/ax_boost_thread.m4000066400000000000000000000052511236127404500167240ustar00rootroot00000000000000dnl @synopsis AX_BOOST_THREAD dnl dnl This macro checks to see if the Boost.Thread library is installed. dnl It also attempts to guess the currect library name using several dnl attempts. It tries to build the library name using a user supplied dnl name or suffix and then just the raw library. dnl dnl If the library is found, HAVE_BOOST_THREAD is defined and dnl BOOST_THREAD_LIBS is set to the name of the library. dnl dnl This macro calls AC_SUBST(BOOST_THREAD_LIBS). dnl dnl @category InstalledPackages dnl @author Michael Tindal dnl @version 2004-09-20 dnl @license GPLWithACException AC_DEFUN([AX_BOOST_THREAD], [AC_REQUIRE([AC_CXX_NAMESPACES])dnl AC_LANG_SAVE AC_LANG_CPLUSPLUS CXXFLAGS_SAVE=$CXXFLAGS LIBS_SAVE=$LIBS dnl FIXME: need to include a generic way to check for the flag dnl to turn on threading support. CXXFLAGS="-pthread $CXXFLAGS" AC_CACHE_CHECK(whether the Boost::Thread library is available, ax_cv_boost_thread, [AC_COMPILE_IFELSE([AC_LANG_PROGRAM([[#include ]], [[boost::thread_group thrds; return 0;]])], ax_cv_boost_thread=yes, ax_cv_boost_thread=no) ]) if test "$ax_cv_boost_thread" = yes; then AC_DEFINE(HAVE_BOOST_THREAD,,[define if the Boost::Thread library is available]) dnl Now determine the appropriate file names AC_ARG_WITH([boost-thread],AS_HELP_STRING([--with-boost-thread], [specify the boost thread library suffix to use]), [if test "x$with_boost_thread" != "xno"; then ax_boost_thread_lib=boost_thread$with_boost_thread fi]) for ax_lib in $ax_boost_thread_lib boost_thread boost_thread-mt; do AC_CHECK_LIB($ax_lib, main, [BOOST_THREAD_LIBS=-l$ax_lib; break]) done # OXullo 2012-07-18: since boost 1.50, boost::thread depends on boost::system AC_CACHE_CHECK(whether Boost::Thread needs Boost::System library, ax_cv_boost_thread_system, [LIBS="$LIBS $BOOST_THREAD_LIBS" AC_LINK_IFELSE([AC_LANG_PROGRAM([[#include ]], [[boost::thread_group thrds; return 0;]])], [ax_cv_boost_thread_system=no], [LIBS="$LIBS $BOOST_THREAD_LIBS -lboost_system$with_boost_thread" AC_LINK_IFELSE([ AC_LANG_PROGRAM([[#include ]], [[boost::thread_group thrds; return 0;]]) ], [BOOST_THREAD_LIBS="$BOOST_THREAD_LIBS -lboost_system$with_boost_thread" ax_cv_boost_thread_system=yes], [AC_ERROR([Cannot use Boost::Thread])] )]) ]) CXXFLAGS=$CXXFLAGS_SAVE LIBS=$LIBS_SAVE AC_LANG_RESTORE AC_SUBST(BOOST_THREAD_LIBS) fi ])dnl libavg-1.8.2/m4/ax_check_define.m4000066400000000000000000000063451236127404500166430ustar00rootroot00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_check_define.html # =========================================================================== # # SYNOPSIS # # AC_CHECK_DEFINE([symbol], [ACTION-IF-FOUND], [ACTION-IF-NOT]) # AX_CHECK_DEFINE([includes],[symbol], [ACTION-IF-FOUND], [ACTION-IF-NOT]) # # DESCRIPTION # # Complements AC_CHECK_FUNC but it does not check for a function but for a # define to exist. Consider a usage like: # # AC_CHECK_DEFINE(__STRICT_ANSI__, CFLAGS="$CFLAGS -D_XOPEN_SOURCE=500") # # LICENSE # # Copyright (c) 2008 Guido U. Draheim # # This program is free software; you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation; either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 7 AC_DEFUN([AC_CHECK_DEFINED],[ AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$1])dnl AC_CACHE_CHECK([for $1 defined], ac_var, AC_TRY_COMPILE(,[ #ifdef $1 int ok; #else choke me #endif ],AS_VAR_SET(ac_var, yes),AS_VAR_SET(ac_var, no))) AS_IF([test AS_VAR_GET(ac_var) != "no"], [$2], [$3])dnl AS_VAR_POPDEF([ac_var])dnl ]) AC_DEFUN([AX_CHECK_DEFINED],[ AS_VAR_PUSHDEF([ac_var],[ac_cv_defined_$2])dnl AC_CACHE_CHECK([for $2 defined], ac_var, AC_TRY_COMPILE([#include "$1"],[ #ifdef $2 int ok; #else choke me #endif ],AS_VAR_SET(ac_var, yes),AS_VAR_SET(ac_var, no))) AS_IF([test AS_VAR_GET(ac_var) != "no"], [$3], [$4])dnl AS_VAR_POPDEF([ac_var])dnl ]) AC_DEFUN([AX_CHECK_FUNC], [AS_VAR_PUSHDEF([ac_var], [ac_cv_func_$2])dnl AC_CACHE_CHECK([for $2], ac_var, dnl AC_LANG_FUNC_LINK_TRY [AC_LINK_IFELSE([AC_LANG_PROGRAM([$1 #undef $2 char $2 ();],[ char (*f) () = $2; return f != $2; ])], [AS_VAR_SET(ac_var, yes)], [AS_VAR_SET(ac_var, no)])]) AS_IF([test AS_VAR_GET(ac_var) = yes], [$3], [$4])dnl AS_VAR_POPDEF([ac_var])dnl ])# AC_CHECK_FUNC libavg-1.8.2/m4/ax_check_gl.m4000066400000000000000000000254141236127404500160110ustar00rootroot00000000000000# Copied from # http://ac-archive.sourceforge.net/ # AC_DEFUN([ACX_PTHREAD], [ AC_REQUIRE([AC_CANONICAL_HOST]) AC_LANG_SAVE AC_LANG_C acx_pthread_ok=no # We used to check for pthread.h first, but this fails if pthread.h # requires special compiler flags (e.g. on True64 or Sequent). # It gets checked for in the link test anyway. # First of all, check if the user has set any of the PTHREAD_LIBS, # etcetera environment variables, and if threads linking works using # them: if test x"$PTHREAD_LIBS$PTHREAD_CFLAGS" != x; then save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" AC_MSG_CHECKING([for pthread_join in LIBS=$PTHREAD_LIBS with CFLAGS=$PTHREAD_CFLAGS]) AC_TRY_LINK_FUNC(pthread_join, acx_pthread_ok=yes) AC_MSG_RESULT($acx_pthread_ok) if test x"$acx_pthread_ok" = xno; then PTHREAD_LIBS="" PTHREAD_CFLAGS="" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" fi # We must check for the threads library under a number of different # names; the ordering is very important because some systems # (e.g. DEC) have both -lpthread and -lpthreads, where one of the # libraries is broken (non-POSIX). # Create a list of thread flags to try. Items starting with a "-" are # C compiler flags, and other items are library names, except for "none" # which indicates that we try without any flags at all, and "pthread-config" # which is a program returning the flags for the Pth emulation library. acx_pthread_flags="pthreads none -Kthread -kthread lthread -pthread -pthreads -mthreads pthread --thread-safe -mt pthread-config" # The ordering *is* (sometimes) important. Some notes on the # individual items follow: # pthreads: AIX (must check this before -lpthread) # none: in case threads are in libc; should be tried before -Kthread and # other compiler flags to prevent continual compiler warnings # -Kthread: Sequent (threads in libc, but -Kthread needed for pthread.h) # -kthread: FreeBSD kernel threads (preferred to -pthread since SMP-able) # lthread: LinuxThreads port on FreeBSD (also preferred to -pthread) # -pthread: Linux/gcc (kernel threads), BSD/gcc (userland threads) # -pthreads: Solaris/gcc # -mthreads: Mingw32/gcc, Lynx/gcc # -mt: Sun Workshop C (may only link SunOS threads [-lthread], but it # doesn't hurt to check since this sometimes defines pthreads too; # also defines -D_REENTRANT) # pthread: Linux, etcetera # --thread-safe: KAI C++ # pthread-config: use pthread-config program (for GNU Pth library) case "${host_cpu}-${host_os}" in *solaris*) # On Solaris (at least, for some versions), libc contains stubbed # (non-functional) versions of the pthreads routines, so link-based # tests will erroneously succeed. (We need to link with -pthread or # -lpthread.) (The stubs are missing pthread_cleanup_push, or rather # a function called by this macro, so we could check for that, but # who knows whether they'll stub that too in a future libc.) So, # we'll just look for -pthreads and -lpthread first: acx_pthread_flags="-pthread -pthreads pthread -mt $acx_pthread_flags" ;; esac if test x"$acx_pthread_ok" = xno; then for flag in $acx_pthread_flags; do case $flag in none) AC_MSG_CHECKING([whether pthreads work without any flags]) ;; -*) AC_MSG_CHECKING([whether pthreads work with $flag]) PTHREAD_CFLAGS="$flag" ;; pthread-config) AC_CHECK_PROG(acx_pthread_config, pthread-config, yes, no) if test x"$acx_pthread_config" = xno; then continue; fi PTHREAD_CFLAGS="`pthread-config --cflags`" PTHREAD_LIBS="`pthread-config --ldflags` `pthread-config --libs`" ;; *) AC_MSG_CHECKING([for the pthreads library -l$flag]) PTHREAD_LIBS="-l$flag" ;; esac save_LIBS="$LIBS" save_CFLAGS="$CFLAGS" LIBS="$PTHREAD_LIBS $LIBS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Check for various functions. We must include pthread.h, # since some functions may be macros. (On the Sequent, we # need a special flag -Kthread to make this header compile.) # We check for pthread_join because it is in -lpthread on IRIX # while pthread_create is in libc. We check for pthread_attr_init # due to DEC craziness with -lpthreads. We check for # pthread_cleanup_push because it is one of the few pthread # functions on Solaris that doesn't have a non-functional libc stub. # We try pthread_create on general principles. AC_TRY_LINK([#include ], [pthread_t th; pthread_join(th, 0); pthread_attr_init(0); pthread_cleanup_push(0, 0); pthread_create(0,0,0,0); pthread_cleanup_pop(0); ], [acx_pthread_ok=yes]) LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" AC_MSG_RESULT($acx_pthread_ok) if test "x$acx_pthread_ok" = xyes; then break; fi PTHREAD_LIBS="" PTHREAD_CFLAGS="" done fi # Various other checks: if test "x$acx_pthread_ok" = xyes; then save_LIBS="$LIBS" LIBS="$PTHREAD_LIBS $LIBS" save_CFLAGS="$CFLAGS" CFLAGS="$CFLAGS $PTHREAD_CFLAGS" # Detect AIX lossage: threads are created detached by default # and the JOINABLE attribute has a nonstandard name (UNDETACHED). AC_MSG_CHECKING([for joinable pthread attribute]) AC_TRY_LINK([#include ], [int attr=PTHREAD_CREATE_JOINABLE;], ok=PTHREAD_CREATE_JOINABLE, ok=unknown) if test x"$ok" = xunknown; then AC_TRY_LINK([#include ], [int attr=PTHREAD_CREATE_UNDETACHED;], ok=PTHREAD_CREATE_UNDETACHED, ok=unknown) fi if test x"$ok" != xPTHREAD_CREATE_JOINABLE; then AC_DEFINE(PTHREAD_CREATE_JOINABLE, $ok, [Define to the necessary symbol if this constant uses a non-standard name on your system.]) fi AC_MSG_RESULT(${ok}) if test x"$ok" = xunknown; then AC_MSG_WARN([we do not know how to create joinable pthreads]) fi AC_MSG_CHECKING([if more special flags are required for pthreads]) flag=no case "${host_cpu}-${host_os}" in *-aix* | *-freebsd*) flag="-D_THREAD_SAFE";; *solaris* | *-osf* | *-hpux*) flag="-D_REENTRANT";; esac AC_MSG_RESULT(${flag}) if test "x$flag" != xno; then PTHREAD_CFLAGS="$flag $PTHREAD_CFLAGS" fi LIBS="$save_LIBS" CFLAGS="$save_CFLAGS" # More AIX lossage: must compile with cc_r AC_CHECK_PROG(PTHREAD_CC, cc_r, cc_r, ${CC}) else PTHREAD_CC="$CC" fi AC_SUBST(PTHREAD_LIBS) AC_SUBST(PTHREAD_CFLAGS) AC_SUBST(PTHREAD_CC) # Finally, execute ACTION-IF-FOUND/ACTION-IF-NOT-FOUND: if test x"$acx_pthread_ok" = xyes; then ifelse([$1],,AC_DEFINE(HAVE_PTHREAD,1,[Define if you have POSIX threads libraries and header files.]),[$1]) : else acx_pthread_ok=no $2 fi AC_LANG_RESTORE ])dnl ACX_PTHREAD AC_DEFUN([AX_CHECK_GL], [AC_REQUIRE([AC_PATH_X])dnl AC_REQUIRE([ACX_PTHREAD])dnl # # There isn't a reliable way to know we should use the Apple OpenGL framework # without a configure option. A Mac OS X user may have installed an # alternative GL implementation (e.g., Mesa), which may or may not depend on X. # libavg change: We just assume that libavg should always run using the mac # OpenGL framework on OS X. # if test $target_vendor = apple; then AC_DEFINE([HAVE_APPLE_OPENGL_FRAMEWORK], [1], [Use the Apple OpenGL framework.]) AC_MSG_NOTICE([Using Apple OpenGL framework]) GL_CFLAGS="" GL_LIBS="-framework OpenGL -framework AGL" else GL_CFLAGS="${PTHREAD_CFLAGS}" GL_LIBS="${PTHREAD_LIBS} -lm" # # Use x_includes and x_libraries if they have been set (presumably by # AC_PATH_X). # if test "X$no_x" != "Xyes"; then if test -n "$x_includes"; then GL_CFLAGS="-I${x_includes} ${GL_CFLAGS}" fi if test -n "$x_libraries"; then GL_LIBS="-L${x_libraries} -lX11 ${GL_LIBS}" fi fi AC_LANG_PUSH(C) AC_CHECK_HEADERS([windows.h]) AC_CACHE_CHECK([for OpenGL library], [ax_cv_check_gl_libgl], [ax_cv_check_gl_libgl="no" ax_save_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" ax_save_LIBS="${LIBS}" LIBS="" ax_check_libs="-lopengl32 -lGL" for ax_lib in ${ax_check_libs}; do if test "X$CC" = "Xcl"; then ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'` else ax_try_lib="${ax_lib}" fi LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" AC_TRY_LINK([ # if HAVE_WINDOWS_H && defined(_WIN32) # include # endif # include ], [glBegin(0)], [ax_cv_check_gl_libgl="${ax_try_lib}"; break]) done LIBS=${ax_save_LIBS} CPPFLAGS=${ax_save_CPPFLAGS}]) if test "X${ax_cv_check_gl_libgl}" = "Xno"; then no_gl="yes" GL_CFLAGS="" GL_LIBS="" else GL_LIBS="${ax_cv_check_gl_libgl} ${GL_LIBS}" fi AC_LANG_POP(C) fi AC_SUBST([GL_CFLAGS]) AC_SUBST([GL_LIBS]) ])dnl AC_DEFUN([AX_CHECK_GLU], [AC_REQUIRE([AX_CHECK_GL])dnl GLU_CFLAGS="${GL_CFLAGS}" if test $target_vendor != apple; then AC_CACHE_CHECK([for OpenGL Utility library], [ax_cv_check_glu_libglu], [ax_cv_check_glu_libglu="no" ax_save_CPPFLAGS="${CPPFLAGS}" CPPFLAGS="${GL_CFLAGS} ${CPPFLAGS}" ax_save_LIBS="${LIBS}" LIBS="" ax_check_libs="-lglu32 -lGLU" for ax_lib in ${ax_check_libs}; do if test "X$CC" = "Xcl"; then ax_try_lib=`echo $ax_lib | sed -e 's/^-l//' -e 's/$/.lib/'` else ax_try_lib="${ax_lib}" fi LIBS="${ax_try_lib} ${GL_LIBS} ${ax_save_LIBS}" # # libGLU typically links with libstdc++ on POSIX platforms. However, # setting the language to C++ means that test program source is named # "conftest.cc"; and Microsoft cl doesn't know what to do with such a # file. # if test "X$CXX" != "Xcl"; then AC_LANG_PUSH([C++]) fi AC_TRY_LINK([ # if HAVE_WINDOWS_H && defined(_WIN32) # include # endif # include ], [gluBeginCurve(0)], [ax_cv_check_glu_libglu="${ax_try_lib}"; break]) if test "X$CXX" != "Xcl"; then AC_LANG_POP([C++]) fi done LIBS=${ax_save_LIBS} CPPFLAGS=${ax_save_CPPFLAGS}]) if test "X${ax_cv_check_glu_libglu}" = "Xno"; then no_gl="yes" GLU_CFLAGS="" GLU_LIBS="" else GLU_LIBS="${ax_cv_check_glu_libglu} ${GL_LIBS}" fi fi AC_SUBST([GLU_CFLAGS]) AC_SUBST([GLU_LIBS]) ]) libavg-1.8.2/m4/ax_python_devel.m4000066400000000000000000000250031236127404500167440ustar00rootroot00000000000000# =========================================================================== # http://www.gnu.org/software/autoconf-archive/ax_python_devel.html # =========================================================================== # # SYNOPSIS # # AX_PYTHON_DEVEL([version]) # # DESCRIPTION # # Note: Defines as a precious variable "PYTHON_VERSION". Don't override it # in your configure.ac. # # This macro checks for Python and tries to get the include path to # 'Python.h'. It provides the $(PYTHON_CPPFLAGS) and $(PYTHON_LDFLAGS) # output variables. It also exports $(PYTHON_EXTRA_LIBS) and # $(PYTHON_EXTRA_LDFLAGS) for embedding Python in your code. # # You can search for some particular version of Python by passing a # parameter to this macro, for example ">= '2.3.1'", or "== '2.4'". Please # note that you *have* to pass also an operator along with the version to # match, and pay special attention to the single quotes surrounding the # version number. Don't use "PYTHON_VERSION" for this: that environment # variable is declared as precious and thus reserved for the end-user. # # This macro should work for all versions of Python >= 2.1.0. As an end # user, you can disable the check for the python version by setting the # PYTHON_NOVERSIONCHECK environment variable to something else than the # empty string. # # If you need to use this macro for an older Python version, please # contact the authors. We're always open for feedback. # # LICENSE # # Copyright (c) 2009 Sebastian Huber # Copyright (c) 2009 Alan W. Irwin # Copyright (c) 2009 Rafael Laboissiere # Copyright (c) 2009 Andrew Collier # Copyright (c) 2009 Matteo Settenvini # Copyright (c) 2009 Horst Knorr # Copyright (c) 2013 Daniel Mullner # # This program is free software: you can redistribute it and/or modify it # under the terms of the GNU General Public License as published by the # Free Software Foundation, either version 3 of the License, or (at your # option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General # Public License for more details. # # You should have received a copy of the GNU General Public License along # with this program. If not, see . # # As a special exception, the respective Autoconf Macro's copyright owner # gives unlimited permission to copy, distribute and modify the configure # scripts that are the output of Autoconf when processing the Macro. You # need not follow the terms of the GNU General Public License when using # or distributing such scripts, even though portions of the text of the # Macro appear in them. The GNU General Public License (GPL) does govern # all other use of the material that constitutes the Autoconf Macro. # # This special exception to the GPL applies to versions of the Autoconf # Macro released by the Autoconf Archive. When you make and distribute a # modified version of the Autoconf Macro, you may extend this special # exception to the GPL to apply to your modified version as well. #serial 16 AU_ALIAS([AC_PYTHON_DEVEL], [AX_PYTHON_DEVEL]) AC_DEFUN([AX_PYTHON_DEVEL],[ # # Allow the use of a (user set) custom python version # AC_ARG_VAR([PYTHON_VERSION],[The installed Python version to use, for example '2.3'. This string will be appended to the Python interpreter canonical name.]) AC_PATH_PROG([PYTHON],[python[$PYTHON_VERSION]]) if test -z "$PYTHON"; then AC_MSG_ERROR([Cannot find python$PYTHON_VERSION in your system path]) PYTHON_VERSION="" fi # # Check for a version of Python >= 2.1.0 # AC_MSG_CHECKING([for a version of Python >= '2.1.0']) ac_supports_python_ver=`$PYTHON -c "import sys; \ ver = sys.version.split ()[[0]]; \ print (ver >= '2.1.0')"` if test "$ac_supports_python_ver" != "True"; then if test -z "$PYTHON_NOVERSIONCHECK"; then AC_MSG_RESULT([no]) AC_MSG_FAILURE([ This version of the AC@&t@_PYTHON_DEVEL macro doesn't work properly with versions of Python before 2.1.0. You may need to re-run configure, setting the variables PYTHON_CPPFLAGS, PYTHON_LDFLAGS, PYTHON_SITE_PKG, PYTHON_EXTRA_LIBS and PYTHON_EXTRA_LDFLAGS by hand. Moreover, to disable this check, set PYTHON_NOVERSIONCHECK to something else than an empty string. ]) else AC_MSG_RESULT([skip at user request]) fi else AC_MSG_RESULT([yes]) fi # # if the macro parameter ``version'' is set, honour it # if test -n "$1"; then AC_MSG_CHECKING([for a version of Python $1]) ac_supports_python_ver=`$PYTHON -c "import sys; \ ver = sys.version.split ()[[0]]; \ print (ver $1)"` if test "$ac_supports_python_ver" = "True"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) AC_MSG_ERROR([this package requires Python $1. If you have it installed, but it isn't the default Python interpreter in your system path, please pass the PYTHON_VERSION variable to configure. See ``configure --help'' for reference. ]) PYTHON_VERSION="" fi fi # # Check if you have distutils, else fail # AC_MSG_CHECKING([for the distutils Python package]) ac_distutils_result=`$PYTHON -c "import distutils" 2>&1` if test -z "$ac_distutils_result"; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) AC_MSG_ERROR([cannot import Python module "distutils". Please check your Python installation. The error was: $ac_distutils_result]) PYTHON_VERSION="" fi # # Check for Python include path # AC_MSG_CHECKING([for Python include path]) if test -z "$PYTHON_CPPFLAGS"; then python_path=`$PYTHON -c "import distutils.sysconfig; \ print (distutils.sysconfig.get_python_inc ());"` plat_python_path=`$PYTHON -c "import distutils.sysconfig; \ print (distutils.sysconfig.get_python_inc (plat_specific=1));"` if test -n "${python_path}"; then if test "${plat_python_path}" != "${python_path}"; then python_path="-I$python_path -I$plat_python_path" else python_path="-I$python_path" fi fi PYTHON_CPPFLAGS=$python_path fi AC_MSG_RESULT([$PYTHON_CPPFLAGS]) AC_SUBST([PYTHON_CPPFLAGS]) # # Check for Python library path # AC_MSG_CHECKING([for Python library path]) if test -z "$PYTHON_LDFLAGS"; then # (makes two attempts to ensure we've got a version number # from the interpreter) ac_python_version=`cat<]], [[Py_Initialize();]]) ],[pythonexists=yes],[pythonexists=no]) AC_LANG_POP([C]) # turn back to default flags CPPFLAGS="$ac_save_CPPFLAGS" LIBS="$ac_save_LIBS" AC_MSG_RESULT([$pythonexists]) if test ! "x$pythonexists" = "xyes"; then AC_MSG_FAILURE([ Could not link test program to Python. Maybe the main Python library has been installed in some non-standard library path. If so, pass it to configure, via the LDFLAGS environment variable. Example: ./configure LDFLAGS="-L/usr/non-standard-path/python/lib" ============================================================================ ERROR! You probably have to install the development version of the Python package for your distribution. The exact name of this package varies among them. ============================================================================ ]) PYTHON_VERSION="" fi # # all done! # ]) libavg-1.8.2/m4/pkg.m4000066400000000000000000000101321236127404500143320ustar00rootroot00000000000000# pkg.m4 - Macros to locate and utilise pkg-config. -*- Autoconf -*- # # Copyright © 2004 Scott James Remnant . # # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2 of the License, or # (at your option) any later version. # # This program is distributed in the hope that it will be useful, but # WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU # General Public License for more details. # # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. # PKG_PROG_PKG_CONFIG([MIN-VERSION]) # ---------------------------------- AC_DEFUN([PKG_PROG_PKG_CONFIG], [m4_pattern_forbid([^_?PKG_[A-Z_]+$]) m4_pattern_allow([^PKG_CONFIG(_PATH)?$]) AC_ARG_VAR([PKG_CONFIG], [path to pkg-config utility])dnl if test "x$ac_cv_env_PKG_CONFIG_set" != "xset"; then AC_PATH_TOOL([PKG_CONFIG], [pkg-config]) fi if test -n "$PKG_CONFIG"; then _pkg_min_version=m4_ifval([$1], [$1], [0.9.0]) AC_MSG_CHECKING([pkg-config is at least version $_pkg_min_version]) if $PKG_CONFIG --atleast-pkgconfig-version $_pkg_min_version; then AC_MSG_RESULT([yes]) else AC_MSG_RESULT([no]) PKG_CONFIG="" fi fi[]dnl ])# PKG_PROG_PKG_CONFIG # _PKG_CONFIG([VARIABLE], [COMMAND], [MODULES]) # --------------------------------------------- m4_define([_PKG_CONFIG], [if test "x$ac_cv_env_[]$1[]_set" = "xset"; then pkg_cv_[]$1=$ac_cv_env_[]$1[]_value elif test -n "$PKG_CONFIG"; then if AC_RUN_LOG([$PKG_CONFIG --exists "$3" >/dev/null 2>&1]); then pkg_cv_[]$1=`$PKG_CONFIG --[]$2 "$3" 2>/dev/null` else pkg_failed=yes fi else pkg_failed=untried fi[]dnl ])# _PKG_CONFIG # PKG_CHECK_MODULES(VARIABLE-PREFIX, MODULES, [ACTION-IF-FOUND], # [ACTION-IF-NOT-FOUND]) # # # Note that if there is a possibility the first call to # PKG_CHECK_MODULES might not happen, you should be sure to include an # explicit call to PKG_PROG_PKG_CONFIG in your configure.in # # # -------------------------------------------------------------- AC_DEFUN([PKG_CHECK_MODULES], [AC_REQUIRE([PKG_PROG_PKG_CONFIG])dnl AC_ARG_VAR([$1][_CFLAGS], [C compiler flags for $1, overriding pkg-config])dnl AC_ARG_VAR([$1][_LIBS], [linker flags for $1, overriding pkg-config])dnl pkg_failed=no AC_CACHE_CHECK([for $1][_CFLAGS], [pkg_cv_][$1][_CFLAGS], [_PKG_CONFIG([$1][_CFLAGS], [cflags], [$2])]) AC_CACHE_CHECK([for $1][_LIBS], [pkg_cv_][$1][_LIBS], [_PKG_CONFIG([$1][_LIBS], [libs], [$2])]) if test $pkg_failed = yes; then $1[]_PKG_ERRORS=`$PKG_CONFIG --errors-to-stdout --print-errors "$2"` # Put the nasty error message in config.log where it belongs echo "$$1[]_PKG_ERRORS" 1>&AS_MESSAGE_LOG_FD ifelse([$4], , [AC_MSG_ERROR(dnl [Package requirements ($2) were not met. Consider adjusting the PKG_CONFIG_PATH environment variable if you installed software in a non-standard prefix. Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables to avoid the need to call pkg-config. See the pkg-config man page for more details.])], [$4]) elif test $pkg_failed = untried; then ifelse([$4], , [AC_MSG_FAILURE(dnl [The pkg-config script could not be found or is too old. Make sure it is in your PATH or set the PKG_CONFIG environment variable to the full path to pkg-config. Alternatively you may set the $1_CFLAGS and $1_LIBS environment variables to avoid the need to call pkg-config. See the pkg-config man page for more details. To get pkg-config, see .])], [$4]) else $1[]_CFLAGS=$pkg_cv_[]$1[]_CFLAGS $1[]_LIBS=$pkg_cv_[]$1[]_LIBS ifelse([$3], , :, [$3]) fi[]dnl ])# PKG_CHECK_MODULES libavg-1.8.2/mac/000077500000000000000000000000001236127404500135325ustar00rootroot00000000000000libavg-1.8.2/mac/MakeDist.sh000077500000000000000000000053001236127404500155700ustar00rootroot00000000000000#!/bin/bash set -e set -x cd .. VERSION_MAJOR=$(grep VERSION_MAJOR m4/avg_version.m4 | sed 's/^.*\[ *\([A-Za-z0-9\.]*\) *\].*$/\1/') VERSION_MINOR=$(grep VERSION_MINOR m4/avg_version.m4 | sed 's/^.*\[ *\([A-Za-z0-9\.]*\) *\].*$/\1/') VERSION_MICRO=$(grep VERSION_MICRO m4/avg_version.m4 | sed 's/^.*\[ *\([A-Za-z0-9\.]*\) *\].*$/\1/') export VERSION=$VERSION_MAJOR.$VERSION_MINOR.$VERSION_MICRO fixLib() { INSTALL_PATH=$3 install_name_tool -change ${AVG_PATH}/lib/$2.dylib $INSTALL_PATH/avg/$2.dylib avg/$1 install_name_tool -id $INSTALL_PATH/avg/$2.dylib avg/$2.dylib } distLib() { INSTALL_PATH=$2 cp -v ../../lib/$1.dylib ./avg install_name_tool -change $AVG_PATH//lib/$1.dylib $INSTALL_PATH/avg/$1.dylib avg.0.so fixLib ../avg.0.so $1 $INSTALL_PATH } makeOneDist() { INSTALL_PATH=$1 PYTHON_VER=$2 # Copy distribution files into staging area. cd $LIBAVGDIR/../dist rm -rf * mkdir libavg cd libavg mkdir avg mkdir avg/test cp -Rv ${BUILDDIR}/site-packages/libavg/ . strip -S avg.0.so cp ../../libavg/src/avgrc avg mkdir etc cp -R /etc/fonts etc/ cd $LIBAVGDIR/src/test cp -Rv *.py *.avg *.svg ${AVG_PATH}/dist/libavg/avg/test mkdir ${AVG_PATH}/dist/libavg/avg/test/baseline cp -v baseline/* ${AVG_PATH}/dist/libavg/avg/test/baseline mkdir ${AVG_PATH}/dist/libavg/avg/test/media cp -Rv media/* ${AVG_PATH}/dist/libavg/avg/test/media mkdir ${AVG_PATH}/dist/libavg/avg/test/testmediadir cp -v testmediadir/* ${AVG_PATH}/dist/libavg/avg/test/testmediadir mkdir ${AVG_PATH}/dist/libavg/avg/test/fonts cp -v fonts/* ${AVG_PATH}/dist/libavg/avg/test/fonts mkdir ${AVG_PATH}/dist/libavg/avg/test/plugin cp -v plugin/.libs/colorplugin.so ${AVG_PATH}/dist/libavg/avg/test/plugin cp -v plugin/.libs/colorplugin.0.so ${AVG_PATH}/dist/libavg/avg/test/plugin mkdir ${AVG_PATH}/dist/libavg/avg/test/extrafonts cp -v extrafonts/testaddfontdir.ttf ${AVG_PATH}/dist/libavg/avg/test/extrafonts cd $LIBAVGDIR/../bindist rm -rf * cp /usr/local/bin/avg_* . } if [[ x"${PKG_CONFIG_PATH}" == "x" ]] then echo Please call 'source mac/avg_env.sh' before calling this script. exit -1 fi LIBAVGDIR=`pwd` DARWINVER=`uname -r` DARWINMAJORVER=${DARWINVER%%.*} PYTHONVERSION=2.7 OSXVERSION=10.6 BUILDDIR=/usr/local/lib/python2.7/ makeOneDist /Library/Python/${PYTHONVERSION}/site-packages/libavg ${PYTHONVERSION} cd $LIBAVGDIR /Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker --doc mac/libavg.10.6.pmdoc -v -o libavg.pkg hdiutil create libavg-mac-${VERSION}.dmg -srcfolder libavg.pkg -ov hdiutil internet-enable -yes libavg-mac-${VERSION}.dmg libavg-1.8.2/mac/PackDeps.sh000077500000000000000000000003351236127404500155640ustar00rootroot00000000000000#!/bin/bash if [[ x"${AVG_PATH}" == "x" ]] then echo Please set AVG_PATH before calling this script. exit -1 fi DEST_PATH=`pwd` cd $AVG_PATH/deps tar cjf $DEST_PATH/macdependencies.tar.bz2 tarballs echo "Done" libavg-1.8.2/mac/UnpackDeps.sh000077500000000000000000000022611236127404500161270ustar00rootroot00000000000000#!/bin/bash if [[ x"${AVG_PATH}" == "x" ]] then echo Please set AVG_PATH before calling this script. exit -1 fi cd $AVG_PATH/deps for file in $(ls tarballs/*.gz) $(ls tarballs/*.bz2); do echo " Unpacking $file." tar xf $file done echo " Applying patches." cd gettext-0.18.1.1 patch -p0 < ../../libavg/mac/stpncpy.patch cd .. cd fontconfig-2.7.0 patch -R Makefile.am <../../libavg/mac/fontconfig-disablecache.patch patch fontconfig.pc.in < ../../libavg/mac/fontconfig.pc.in.patch cd .. cd librsvg-2.34.0 patch Makefile.am < ../../libavg/mac/librsvg_makefile.patch patch configure.in < ../../libavg/mac/librsvg_configure.patch cd .. cd glib-2.29.2/glib patch -R gconvert.c < ../../../libavg/mac/glib.patch cd ../.. cd freetype-2.5.0.1/ patch -p1 -R < ../../libavg/mac/freetype_linespacing.patch cd .. DARWINVER=`uname -r` DARWINMAJORVER=${DARWINVER%%.*} if [[ "${DARWINMAJORVER}" == "13" ]] then cd SDL-1.2.15 patch -p1 < ../../libavg/mac/libsdl_mavericks.patch cd .. fi cd pkg-config-0.20/glib-1.2.8/ patch -p0 -R glib.h ../../../libavg/mac/pkg-config-mavericks.patch cd ../.. cd libdc1394-2.2.1 patch -p1 < ../../libavg/mac/dc1394_mavericks.patch cd .. echo "Done" libavg-1.8.2/mac/avg_env.sh000077500000000000000000000021021236127404500155110ustar00rootroot00000000000000if [[ x"${AVG_PATH}" == x"" ]] then echo Please set AVG_PATH else # Set the debug info flag to use depending on whether clang is used as compiler. # Is there an easier way to do this? if [[ "${CXX}" == "" ]] then CXX=gcc fi IS_CLANG="`${CXX} --version 2> /dev/null | grep clang`" if [[ "${IS_CLANG}" == "" ]] then DEBUGINFOFLAG="-gstabs" else DEBUGINFOFLAG="-g" fi export PATH=${AVG_PATH}/bin:${PATH} export CPPFLAGS="-I${AVG_PATH}/include "$CPPFLAGS export CXXFLAGS="-O3 ${DEBUGINFOFLAG} -Wall -pipe "$CXXFLAGS export CFLAGS="-O3 ${DEBUGINFOFLAG} -Wall -pipe "$CFLAGS export LDFLAGS="-L${AVG_PATH}/lib "$LDFLAGS export PKG_CONFIG_PATH=${PKG_CONFIG_PATH}:${AVG_PATH}/lib/pkgconfig DARWINVER=`uname -r` DARWINMAJORVER=${DARWINVER%%.*} if [[ "${DARWINMAJORVER}" == "10" ]] then export PYTHONPATH=/usr/local/lib/python2.6/site-packages/:$PYTHONPATH else export PYTHONPATH=${AVG_PATH}/lib/python/2.5/site-packages/:$PYTHONPATH fi export AVG_MAC_ENV_SET=1 fi libavg-1.8.2/mac/dc1394_mavericks.patch000066400000000000000000000053321236127404500175310ustar00rootroot00000000000000--- libdc1394-2.2.1/configure 2013-01-28 03:47:43.000000000 +0100 +++ libdc1394-2.2.1-changed/configure 2013-10-29 22:05:59.000000000 +0100 @@ -13609,51 +13609,8 @@ ;; *-*-darwin*) - { $as_echo "$as_me:${as_lineno-$LINENO}: checking for IOMasterPort in -lIOKit" >&5 -$as_echo_n "checking for IOMasterPort in -lIOKit... " >&6; } -if test "${ac_cv_lib_IOKit_IOMasterPort+set}" = set; then : - $as_echo_n "(cached) " >&6 -else - ac_check_lib_save_LIBS=$LIBS -LIBS="-lIOKit $LIBS" -cat confdefs.h - <<_ACEOF >conftest.$ac_ext -/* end confdefs.h. */ - -/* Override any GCC internal prototype to avoid an error. - Use char because int might match the return type of a GCC - builtin and then its argument prototype would still apply. */ -#ifdef __cplusplus -extern "C" -#endif -char IOMasterPort (); -int -main () -{ -return IOMasterPort (); - ; - return 0; -} -_ACEOF -if ac_fn_c_try_link "$LINENO"; then : - ac_cv_lib_IOKit_IOMasterPort=yes -else - ac_cv_lib_IOKit_IOMasterPort=no -fi -rm -f core conftest.err conftest.$ac_objext \ - conftest$ac_exeext conftest.$ac_ext -LIBS=$ac_check_lib_save_LIBS -fi -{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_IOKit_IOMasterPort" >&5 -$as_echo "$ac_cv_lib_IOKit_IOMasterPort" >&6; } -if test "x$ac_cv_lib_IOKit_IOMasterPort" = x""yes; then : - -$as_echo "#define HAVE_MACOSX /**/" >>confdefs.h - have_macosx=true -else - as_fn_error "IOKitLib not found." "$LINENO" 5 -fi - platform_LDFLAGS="-framework CoreServices -framework CoreFoundation -framework Carbon" + platform_LDFLAGS="-framework CoreServices -framework CoreFoundation -framework Carbon -framework IOKit" ;; *-*-cygwin* | *-*-mingw*) --- libdc1394-2.2.1/dc1394/macosx/Makefile.in 2013-01-28 03:47:45.000000000 +0100 +++ libdc1394-2.2.1-changed/dc1394/macosx/Makefile.in 2013-10-29 22:03:29.000000000 +0100 @@ -264,7 +264,7 @@ @HAVE_MACOSX_TRUE@ capture.h AM_CFLAGS = -I.. -libdc1394_macosx_la_LDFLAGS = -framework CoreFoundation -framework Carbon +libdc1394_macosx_la_LDFLAGS = -framework CoreFoundation -framework Carbon -framework IOKit libdc1394_macosx_la_LIBADD = -lIOKit libdc1394_macosx_la_SOURCES = \ control.c \ --- libdc1394-2.2.1/examples/Makefile.in 2013-01-28 03:47:45.000000000 +0100 +++ libdc1394-2.2.1-changed/examples/Makefile.in 2013-10-29 22:03:59.000000000 +0100 @@ -350,7 +350,7 @@ B = dc1394_reset_bus $(am__append_2) @HAVE_LINUX_TRUE@@HAVE_OPENGL_TRUE@GL_LIBS = -lGL @HAVE_OPENGL_TRUE@@HAVE_WINDOWS_TRUE@GL_LIBS = -lopengl32 -@HAVE_MACOSX_TRUE@AM_LDFLAGS = -framework CoreFoundation -framework Carbon +@HAVE_MACOSX_TRUE@AM_LDFLAGS = -framework CoreFoundation -framework Carbon -framework IOKit LDADD = ../dc1394/libdc1394.la helloworld_SOURCES = helloworld.c ladybug_SOURCES = ladybug.c libavg-1.8.2/mac/fontconfig-disablecache.patch000066400000000000000000000002741236127404500212770ustar00rootroot0000000000000057c57 < #if CROSS_COMPILING --- > if CROSS_COMPILING 59,61c59,61 < #else < # RUN_FC_CACHE_TEST=test -z "$(DESTDIR)" < #endif --- > else > RUN_FC_CACHE_TEST=test -z "$(DESTDIR)" > endif libavg-1.8.2/mac/fontconfig.pc.in.patch000066400000000000000000000001221236127404500177100ustar00rootroot000000000000009c9 < Libs: -L${libdir} -lfontconfig --- > Libs: -L${libdir} -lfontconfig -lexpat libavg-1.8.2/mac/freetype_linespacing.patch000066400000000000000000000004471236127404500207570ustar00rootroot00000000000000--- a/src/truetype/ttdriver.c +++ b/src/truetype/ttdriver.c @@ -246,7 +246,10 @@ FT_Request_Metrics( size->face, req ); if ( FT_IS_SCALABLE( size->face ) ) + { error = tt_size_reset( ttsize ); + ttsize->root.metrics = ttsize->metrics; + } return error; } libavg-1.8.2/mac/gcc-fat.sh000077500000000000000000000056151236127404500154040ustar00rootroot00000000000000#!/bin/sh # # Build Universal binaries on Mac OS X, thanks Ryan! # # Usage: ./configure CC="sh gcc-fat.sh" && make && rm -rf ppc x86 # PowerPC compiler flags (10.2 runtime compatibility) PPC_SDK=MacOSX10.3.9.sdk GCC_COMPILE_PPC="gcc-3.3 -arch ppc \ -DMAC_OS_X_VERSION_MIN_REQUIRED=1030 \ -nostdinc \ -F/Developer/SDKs/${PPC_SDK}/System/Library/Frameworks \ -I/Developer/SDKs/${PPC_SDK}/usr/include/gcc/darwin/3.3 \ -isystem /Developer/SDKs/${PPC_SDK}/usr/include" GCC_LINK_PPC="\ -L/Developer/SDKs/${PPC_SDK}/usr/lib/gcc/darwin/3.3 \ -F/Developer/SDKs/${PPC_SDK}/System/Library/Frameworks \ -Wl,-syslibroot,/Developer/SDKs/${PPC_SDK}" # Intel compiler flags (10.4 runtime compatibility) GCC_COMPILE_X86="gcc-4.0 -arch i386 -mmacosx-version-min=10.4 \ -DMAC_OS_X_VERSION_MIN_REQUIRED=1040 \ -nostdinc \ -F/Developer/SDKs/MacOSX10.4u.sdk/System/Library/Frameworks \ -I/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.1/include \ -isystem /Developer/SDKs/MacOSX10.4u.sdk/usr/include" GCC_LINK_X86="\ -L/Developer/SDKs/MacOSX10.4u.sdk/usr/lib/gcc/i686-apple-darwin8/4.0.0 \ -Wl,-syslibroot,/Developer/SDKs/MacOSX10.4u.sdk" # Output both PowerPC and Intel object files args="$*" compile=yes link=yes while test x$1 != x; do case $1 in --version) exec gcc $1;; -v) exec gcc $1;; -V) exec gcc $1;; -print-prog-name=*) exec gcc $1;; -print-search-dirs) exec gcc $1;; -E) GCC_COMPILE_PPC="$GCC_COMPILE_PPC -E" GCC_COMPILE_X86="$GCC_COMPILE_X86 -E" compile=no; link=no;; -c) link=no;; -o) output=$2;; *.c|*.cc|*.cpp|*.S) source=$1;; esac shift done if test x$link = xyes; then GCC_COMPILE_PPC="$GCC_COMPILE_PPC $GCC_LINK_PPC" GCC_COMPILE_X86="$GCC_COMPILE_X86 $GCC_LINK_X86" fi if test x"$output" = x; then if test x$link = xyes; then output=a.out elif test x$compile = xyes; then output=`echo $source | sed -e 's|.*/||' -e 's|\(.*\)\.[^\.]*|\1|'`.o fi fi if test x"$output" != x; then dir=ppc/`dirname $output` if test -d $dir; then : else mkdir -p $dir fi fi set -- $args while test x$1 != x; do if test -f "ppc/$1" && test "$1" != "$output"; then ppc_args="$ppc_args ppc/$1" else ppc_args="$ppc_args $1" fi shift done $GCC_COMPILE_PPC $ppc_args || exit $? if test x"$output" != x; then cp $output ppc/$output fi if test x"$output" != x; then dir=x86/`dirname $output` if test -d $dir; then : else mkdir -p $dir fi fi set -- $args while test x$1 != x; do if test -f "x86/$1" && test "$1" != "$output"; then x86_args="$x86_args x86/$1" else x86_args="$x86_args $1" fi shift done $GCC_COMPILE_X86 $x86_args || exit $? if test x"$output" != x; then cp $output x86/$output fi if test x"$output" != x; then lipo -create -o $output ppc/$output x86/$output fi libavg-1.8.2/mac/glib.patch000066400000000000000000000002541236127404500154710ustar00rootroot0000000000000054c54 < #if !(defined(__APPLE__) && defined(__LP64__)) && !defined(USE_LIBICONV_GNU) && defined (_LIBICONV_H) --- > #if !defined(USE_LIBICONV_GNU) && defined (_LIBICONV_H) libavg-1.8.2/mac/installscripts/000077500000000000000000000000001236127404500166105ustar00rootroot00000000000000libavg-1.8.2/mac/installscripts/background.tif000066400000000000000000002171001236127404500214340ustar00rootroot00000000000000II*M.n/6>(1F2d=RC9x:IH0:is k ' 'Adobe Photoshop CS2 Macintosh2006:10:22 00:59:03 uuid:AF6165DB628911DBB46AFFE045E8B8D6 uuid:5382F50E62FA11DBAD06F18E5B1A7172 2006-10-21T11:31:52+02:00 2006-10-22T00:59:03+02:00 2006-10-22T00:59:03+02:00 Adobe Photoshop CS2 Macintosh image/tiff 3 SyncMaster 1 720000/10000 720000/10000 2 256,257,258,259,262,274,277,284,530,531,282,283,296,301,318,319,529,532,306,270,271,272,305,315,33432;1084D35F80C00B2A778FBF5331654987 333 172 -1 36864,40960,40961,37121,37122,40962,40963,37510,40964,36867,36868,33434,33437,34850,34852,34855,34856,37377,37378,37379,37380,37381,37382,37383,37384,37385,37386,37396,41483,41484,41486,41487,41488,41492,41493,41495,41728,41729,41730,41985,41986,41987,41988,41989,41990,41991,41992,41993,41994,41995,41996,42016,0,2,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,20,22,23,24,25,26,27,28,30;88AF1552FFCCCF188B03E1ABA57D4C7C 8BIM8BIM%F &Vڰw8BIM com.apple.print.PageFormat.PMHorizontalRes com.apple.print.ticket.creator com.apple.printingmanager com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMHorizontalRes 72 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2006-10-21T09:32:11Z com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMOrientation com.apple.print.ticket.creator com.apple.printingmanager com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMOrientation 1 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2006-10-21T09:32:11Z com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMScaling com.apple.print.ticket.creator com.apple.printingmanager com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMScaling 1 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2006-10-21T09:32:11Z com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMVerticalRes com.apple.print.ticket.creator com.apple.printingmanager com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMVerticalRes 72 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2006-10-21T09:32:11Z com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMVerticalScaling com.apple.print.ticket.creator com.apple.printingmanager com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMVerticalScaling 1 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2006-10-21T09:32:11Z com.apple.print.ticket.stateFlag 0 com.apple.print.subTicket.paper_info_ticket com.apple.print.PageFormat.PMAdjustedPageRect com.apple.print.ticket.creator com.apple.printingmanager com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMAdjustedPageRect 0.0 0.0 783 559 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2006-10-21T22:55:35Z com.apple.print.ticket.stateFlag 0 com.apple.print.PageFormat.PMAdjustedPaperRect com.apple.print.ticket.creator com.apple.printingmanager com.apple.print.ticket.itemArray com.apple.print.PageFormat.PMAdjustedPaperRect -18 -18 824 577 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2006-10-21T22:55:35Z com.apple.print.ticket.stateFlag 0 com.apple.print.PaperInfo.PMPaperName com.apple.print.ticket.creator com.apple.print.pm.PostScript com.apple.print.ticket.itemArray com.apple.print.PaperInfo.PMPaperName iso-a4 com.apple.print.ticket.client com.apple.print.pm.PostScript com.apple.print.ticket.modDate 2003-07-01T17:49:36Z com.apple.print.ticket.stateFlag 1 com.apple.print.PaperInfo.PMUnadjustedPageRect com.apple.print.ticket.creator com.apple.print.pm.PostScript com.apple.print.ticket.itemArray com.apple.print.PaperInfo.PMUnadjustedPageRect 0.0 0.0 783 559 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2006-10-21T09:32:11Z com.apple.print.ticket.stateFlag 0 com.apple.print.PaperInfo.PMUnadjustedPaperRect com.apple.print.ticket.creator com.apple.print.pm.PostScript com.apple.print.ticket.itemArray com.apple.print.PaperInfo.PMUnadjustedPaperRect -18 -18 824 577 com.apple.print.ticket.client com.apple.printingmanager com.apple.print.ticket.modDate 2006-10-21T09:32:11Z com.apple.print.ticket.stateFlag 0 com.apple.print.PaperInfo.ppd.PMPaperName com.apple.print.ticket.creator com.apple.print.pm.PostScript com.apple.print.ticket.itemArray com.apple.print.PaperInfo.ppd.PMPaperName A4 com.apple.print.ticket.client com.apple.print.pm.PostScript com.apple.print.ticket.modDate 2003-07-01T17:49:36Z com.apple.print.ticket.stateFlag 1 com.apple.print.ticket.APIVersion 00.20 com.apple.print.ticket.privateLock com.apple.print.ticket.type com.apple.print.PaperInfoTicket com.apple.print.ticket.APIVersion 00.20 com.apple.print.ticket.privateLock com.apple.print.ticket.type com.apple.print.PageFormatTicket 8BIMxHH/8Ag{HH(dh 8BIMHH8BIM&?8BIM Transparenz8BIM Transparenz8BIMd8BIM8BIM 8BIM8BIM 8BIM 8BIM' 8BIMH/fflff/ff2Z5-8BIMp8BIM8BIM8BIM08BIM- 8BIM@@8BIM8BIMIM backgroundMnullboundsObjcRct1Top longLeftlongBtomlongRghtlongMslicesVlLsObjcslicesliceIDlonggroupIDlongoriginenum ESliceOrigin autoGeneratedTypeenum ESliceTypeImg boundsObjcRct1Top longLeftlongBtomlongRghtlongMurlTEXTnullTEXTMsgeTEXTaltTagTEXTcellTextIsHTMLboolcellTextTEXT horzAlignenumESliceHorzAligndefault vertAlignenumESliceVertAligndefault bgColorTypeenumESliceBGColorTypeNone topOutsetlong leftOutsetlong bottomOutsetlong rightOutsetlong8BIM( ?8BIM 8BIM S JFIFHH Adobe_CMAdobed            S" ?   3!1AQa"q2B#$Rb34rC%Scs5&DTdE£t6UeuF'Vfv7GWgw5!1AQaq"2B#R3$brCScs4%&5DTdEU6teuFVfv'7GWgw ?h!sI˵_[QG(NSSemuK$[߹Q/-Ao(jK<44Ylmg?ec8Z6l~?-Co(Ytl{Nh\]Z s~EpD%2?[CJ%A-&g5`Z wgOkn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ĹK 68e |r  `6&Lk ˪FR@fwSv%]LJ_kl͹]/Qa|b3PZ Adq`G Ǝ@'( ֣CXiѦəcv;yvKy+%hE1Ri7I Z/\& t/) `S:QEIzt('0c ^ plj*4_7OEB(Z3*[Ege杗Qx)ָ_驕8 S`.z5,ԫHlQ[Qf NuO uu;]k텱Zk\շuQFXʭVF ,6[KZ Alѩv+upt2)1#\[e=t{9Mlibavg-1.8.2/mac/installscripts/postflight000066400000000000000000000007361236127404500207240ustar00rootroot00000000000000#!/usr/bin/env python2.7 import sys #sys.stdout = open("/Users/uzadow/Desktop/postflight.log", "w") print "Starting postinstall..." from libavg import avg print "Building font cache. This can take a while." Player=avg.Player.get() Player.loadString(""" """) print "Done." sys.exit(0) libavg-1.8.2/mac/libavg.10.6.pmdoc/000077500000000000000000000000001236127404500164625ustar00rootroot00000000000000libavg-1.8.2/mac/libavg.10.6.pmdoc/01dist-contents.xml000066400000000000000000001143021236127404500221440ustar00rootroot00000000000000libavg-1.8.2/mac/libavg.10.6.pmdoc/01dist.xml000066400000000000000000000024121236127404500203070ustar00rootroot00000000000000org.c-base.libavg.dist.pkg1.8.2/Users/uzadow/devel/libavg/dist/Library/Python/2.7/site-packages/scripts.scriptsDirectoryPath.isAbsoluteTypescripts.scriptsDirectoryPath.isRelativeTypescripts.postflight.pathinstallToscripts.postinstall.pathscripts.postinstall.isRelativeTypeversionparentscripts.scriptsDirectoryPath.pathidentifierinstallFrom.pathinstallTo.path/Users/uzadow/libavg/libavg/mac/installscripts/postflight/Users/uzadow/devel/libavg/libavg/mac/installscripts01dist-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$libavg-1.8.2/mac/libavg.10.6.pmdoc/02bindist-contents.xml000066400000000000000000000002041236127404500226310ustar00rootroot00000000000000libavg-1.8.2/mac/libavg.10.6.pmdoc/02bindist.xml000066400000000000000000000013531236127404500210040ustar00rootroot00000000000000org.c-base.libavg.bindist.pkg1.8.2/Users/uzadow/devel/libavg/bindist/usr/bininstallTo.pathinstallFrom.pathparentinstallToversion02bindist-contents.xml/CVS$/\.svn$/\.cvsignore$/\.cvspass$/\.DS_Store$libavg-1.8.2/mac/libavg.10.6.pmdoc/index.xml000066400000000000000000000021301236127404500203070ustar00rootroot00000000000000libavg/Users/coder/Desktop/libavg.pkgorg.c-baseinstallscripts/background.tifwelcome.txtreadme.txt01dist.xml02bindist.xmlproperties.customizeOptiondescriptionlibavg-1.8.2/mac/librsvg_configure.patch000066400000000000000000000011241236127404500202620ustar00rootroot00000000000000101d100 < libxml-2.0 >= $LIBXML_REQUIRED \ 305,315d303 < ################################################## < # Checks for gtk-doc and docbook-tools < ################################################## < < GTK_DOC_CHECK([1.13],[--flavour no-tmpl]) < < AC_SUBST([GLIB_PREFIX],[$($PKG_CONFIG --variable=prefix glib-2.0)]) < AC_SUBST([GDK_PIXBUF_PREFIX],[$($PKG_CONFIG --variable=prefix gdk-pixbuf-2.0)]) < AC_SUBST([GTK_PREFIX],[$($PKG_CONFIG --variable=prefix gdk-pixbuf-2.0)]) < AC_SUBST([CAIRO_PREFIX],[$($PKG_CONFIG --variable=prefix cairo)]) < 365,366d352 < doc/Makefile < doc/version.xml libavg-1.8.2/mac/librsvg_makefile.patch000066400000000000000000000003471236127404500200640ustar00rootroot000000000000001c1 < SUBDIRS = . gdk-pixbuf-loader data tests tools doc --- > SUBDIRS = . gdk-pixbuf-loader data tests tools 200,201c200 < librsvg.def \ < gtk-doc.make --- > librsvg.def 245d243 < DISTCHECK_CONFIGURE_FLAGS = --enable-gtk-doc libavg-1.8.2/mac/libsdl_mavericks.patch000066400000000000000000000013351236127404500200720ustar00rootroot00000000000000--- a/src/video/quartz/SDL_QuartzVideo.h Sat Aug 10 10:54:03 2013 -0700 +++ b/src/video/quartz/SDL_QuartzVideo.h Thu Sep 05 06:38:57 2013 -0700 @@ -91,7 +91,6 @@ CGDirectDisplayID display; /* 0 == main display (only support single display) */ const void *mode; /* current mode of the display */ const void *save_mode; /* original mode of the display */ - CGDirectPaletteRef palette; /* palette of an 8-bit display */ NSOpenGLContext *gl_context; /* OpenGL rendering context */ NSGraphicsContext *nsgfx_context; /* Cocoa graphics context */ Uint32 width, height, bpp; /* frequently used data about the display */ libavg-1.8.2/mac/libtool.m4.patch000066400000000000000000000017551236127404500165460ustar00rootroot00000000000000945c945 < _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress' ;; --- > _lt_dar_allow_undefined='${wl}-undefined ${wl}suppress ${wl}-read_only_relocs ${wl}suppress' ;; 947c947 < _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; --- > _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress ${wl}-read_only_relocs ${wl}suppress' ;; 954c954 < _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; --- > _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup ${wl}-read_only_relocs ${wl}suppress' ;; 956c956 < _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress' ;; --- > _lt_dar_allow_undefined='${wl}-flat_namespace ${wl}-undefined ${wl}suppress ${wl}-read_only_relocs ${wl}suppress' ;; 958c958 < _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup' ;; --- > _lt_dar_allow_undefined='${wl}-undefined ${wl}dynamic_lookup ${wl}-read_only_relocs ${wl}suppress' ;; libavg-1.8.2/mac/pkg-config-mavericks.patch000066400000000000000000000001411236127404500205550ustar00rootroot00000000000000205,207d204 < #if defined (__clang__) < # define G_INLINE_FUNC inline < #else 222d218 < #endif libavg-1.8.2/mac/readme.txt000066400000000000000000000001451236127404500155300ustar00rootroot00000000000000 This will install the libavg library on your computer. Installation can take a while - be patient. libavg-1.8.2/mac/stpncpy.patch000066400000000000000000000010231236127404500162470ustar00rootroot00000000000000diff -Naurp gettext-0.18.1.1.orig/gettext-tools/configure gettext-0.18.1.1/gettext-tools/configure --- gettext-tools/configure 2010-06-06 13:12:20.000000000 -0700 +++ gettext-tools/configure 2010-08-13 23:24:09.000000000 -0700 @@ -40606,7 +40606,9 @@ else #include #include /* for strcpy */ /* The stpncpy prototype is missing in on AIX 4. */ +#ifndef stpncpy extern char *stpncpy (char *dest, const char *src, size_t n); +#endif int main () { const char *src = "Hello"; char dest[10]; libavg-1.8.2/mac/welcome.txt000066400000000000000000000005561236127404500157340ustar00rootroot00000000000000After the installer runs, please make sure that everything works by running the tests. To do this, open a terminal, cd to /Library/Python/2.7/site-packages/libavg/avg/test and call ./Test.py. You should see some test graphics flicker on the screen. The last message in the terminal should read 'OK'. We welcome your feedback. See http://www.libavg.de/ for details. libavg-1.8.2/makedocs.sh000077500000000000000000000002131236127404500151130ustar00rootroot00000000000000#!/bin/bash cd sphinxdoc #sphinx-build -b linkcheck . _build/ sphinx-build -b coverage . _build/ sphinx-build -b html . _build/reference libavg-1.8.2/man/000077500000000000000000000000001236127404500135455ustar00rootroot00000000000000libavg-1.8.2/man/Makefile.am000066400000000000000000000002521236127404500156000ustar00rootroot00000000000000man_MANS = avgrc.5 avg_audioplayer.1 avg_showcamera.1 avg_showfont.1 avg_videoplayer.1 \ avg_chromakey.1 avg_showfile.1 avg_videoinfo.1 EXTRA_DIST = $(man_MANS) libavg-1.8.2/man/avg_audioplayer.1000066400000000000000000000003561236127404500170060ustar00rootroot00000000000000.TH AVG_AUDIPLAYER "1" "March 2011" "libavg 1.5.4" "User Commands" .SH NAME avg_audioplayer \- audio player .SH SYNOPSIS .B avg_audioplayer \fIfile\fR .SH DESCRIPTION Play an audio file. .PP .SH AUTHOR Ulrich von Zadow libavg-1.8.2/man/avg_chromakey.1000066400000000000000000000023101236127404500164420ustar00rootroot00000000000000.TH AVG_CHROMAKEY "1" "March 2011" "libavg 1.5.4" "User Commands" .SH NAME avg_chromakey \- test application for libavg chromakey filter .SH SYNOPSIS .B avg_chromakey \fI\-t DRIVER [OPTION]...\fR .SH DESCRIPTION Stream a live image from a camera and apply a chromakey filter. .PP .SH OPTIONS .TP \fB\-h\fR, \fB\-\-help\fR Show a brief description of the options. .TP \fB\-t\fR, \fB\-\-driver\fR DRIVER One of the camera subsystems supported by libavg (supported: firewire, video4linux, directshow). .TP \fB\-d\fR, \fB\-\-device\fR DEVICE Camera device identifier (depending on the driver, a GUID or device path is expected). .TP \fB\-u\fR, \fB\-\-unit\fR UNIT Unit number. Used for cameras or other capture devices which deliver several images (e.g. stereo cameras or TV capture cards). .TP \fB\-w\fR, \fB\-\-width\fR WIDTH Camera image width. .TP \fB\-e\fR, \fB\-\-height\fR HEIGHT Camera image height. .TP \fB\-p\fR, \fB\-\-pixelformat\fR PIXELFORMAT Camera pixel format (one of: I8, I16, YUV411, YUV422, YUYV422, RGB, BGR, BAYER8). .TP \fB\-f\fR, \fB\-\-framerate\fR FRAMERATE Frames per second. .TP \fB\-8\fR, \fB\-\-fw800\fR Set firewire bus speed to s800 (if supported). .SH AUTHOR Ulrich von Zadow libavg-1.8.2/man/avg_showcamera.1000066400000000000000000000027731236127404500166260ustar00rootroot00000000000000.TH AVG_SHOWCAMERA "1" "March 2011" "libavg 1.5.4" "User Commands" .SH NAME avg_showcamera \- camera discovery and display tool .SH SYNOPSIS .B avg_showcamera \fI\-l\fR .HP .B avg_showcamera \fI\-r\fR .HP .B avg_showcamera \fI\-t DRIVER [OPTION]...\fR .SH DESCRIPTION Query and list attached cameras, reset firewire bus, show video stream. .PP .SH OPTIONS .TP \fB\-h\fR, \fB\-\-help\fR Show a brief description of the options. .TP \fB\-l\fR, \fB\-\-dump\fR Dump a list of available cameras to the console. .TP \fB\-r\fR, \fB\-\-resetbus\fR Reset the firewire bus and free allocated bandwidth. .TP \fB\-t\fR, \fB\-\-driver\fR DRIVER One of the camera subsystems supported by libavg (supported: firewire, video4linux, directshow). .TP \fB\-d\fR, \fB\-\-device\fR DEVICE Camera device identifier (depending on the driver, a GUID or device path is expected). .TP \fB\-u\fR, \fB\-\-unit\fR UNIT Unit number. Used for cameras or other capture devices which deliver several images (e.g. stereo cameras or TV capture cards). .TP \fB\-w\fR, \fB\-\-width\fR WIDTH Camera image width. .TP \fB\-e\fR, \fB\-\-height\fR HEIGHT Camera image height. .TP \fB\-p\fR, \fB\-\-pixelformat\fR PIXELFORMAT Camera pixel format (one of: I8, I16, YUV411, YUV422, YUYV422, RGB, BGR, BAYER8). .TP \fB\-f\fR, \fB\-\-framerate\fR FRAMERATE Frames per second. .TP \fB\-8\fR, \fB\-\-fw800\fR Set firewire bus speed to s800 (if supported). .TP \fB\-s\fR, \fB\-\-noinfo\fR Don't show any info overlayed on the screen. .SH AUTHOR Ulrich von Zadow libavg-1.8.2/man/avg_showfile.1000066400000000000000000000003661236127404500163110ustar00rootroot00000000000000.TH AVG_SHOWFILE "1" "March 2011" "libavg 1.5.4" "User Commands" .SH NAME avg_showfile \- display an avg file .SH SYNOPSIS .B avg_showfile \fIfile\fR .SH DESCRIPTION Open and render an avg file. .PP .SH AUTHOR Ulrich von Zadow libavg-1.8.2/man/avg_showfont.1000066400000000000000000000013711236127404500163350ustar00rootroot00000000000000.TH AVG_SHOWFONT "1" "March 2011" "libavg 1.5.4" "User Commands" .SH NAME avg_showfont \- font enumeration and preview tool .SH SYNOPSIS .B avg_showfont [\fIfontname\fR] [\fItext\fR] .SH DESCRIPTION List available font faces and generate preview of their variants. .PP If invoked without arguments, avg_showfont generates a list of font family names and prints them on the console. Fontconfig is used for font discovery. Fonts are searched for in the system font path and in $PWD/fonts. .PP If \fBfontname\fR is specified, the chosen font is displayed in a window, with one line for each available variant. .PP If supplied, the optional \fBtext\fR argument is used instead of the variant name in the sample text. .SH AUTHOR Ulrich von Zadow libavg-1.8.2/man/avg_videoinfo.1000066400000000000000000000014151236127404500164470ustar00rootroot00000000000000.TH AVG_VIDEOINFO "1" "March 2011" "libavg 1.5.4" "User Commands" .SH NAME avg_videoinfo \- video inspection tool .SH SYNOPSIS .B avg_videoinfo \fIfile(s)\fR \fI[OPTION]\fR .SH DESCRIPTION Dump video file format information to the console .PP Inspects the given file(s) and dumps information about duration, bitrate, video/audio codec, video frame size and pixel format, video fps, audio sample rate and number of channels for each file given. .PP The default output format is text. .PP XML and CSV formats can be chosen with the appropriate options. .PP .SH OPTIONS .TP \fB\-h\fR, \fB\-\-help\fR Show a brief description of the options. .TP \fB\-x\fR, \fB\-\-xml\fR XML output format. .TP \fB\-c\fR, \fB\-\-csv\fR CSV output format. .SH AUTHOR Ulrich von Zadow libavg-1.8.2/man/avg_videoplayer.1000066400000000000000000000003731236127404500170120ustar00rootroot00000000000000.TH AVG_VIDEOPLAYER "1" "March 2011" "libavg 1.5.4" "User Commands" .SH NAME avg_videoplayer \- video player .SH SYNOPSIS .B avg_videoplayer \fIfile\fR .SH DESCRIPTION Play a video file using libavg. .PP .SH AUTHOR Ulrich von Zadow libavg-1.8.2/man/avgrc.5000077500000000000000000000012321236127404500147360ustar00rootroot00000000000000.ad 1 .nh .hlm 0 .TH avgrc 5 "13 January 2005" "avg" .SH NAME avgrc \- avg configuration file .SH DESCRIPTION .I avgrc contains configuration information for the .B avg player, including display data and font directory information. .B avg looks for a system-wide file in .I /etc/ and a user-specific file in .I $HOME. The file is xml-based. There is an example avgrc.default in the avg source directory. The available options are described in the .B avg (1) man page. .SH FILES .PD 0 /etc/avgrc - System-wide configuration file. .P $HOME/avgrc - User-specific configuration file. .PD .SH SEE ALSO .B avg (1) .SH AUTHORS Ulrich von Zadow (coder@c-base.org) libavg-1.8.2/missing000077500000000000000000000240361236127404500143760ustar00rootroot00000000000000#! /bin/sh # Common stub for a few missing GNU programs while installing. # Copyright (C) 1996, 1997, 1999, 2000, 2002 Free Software Foundation, Inc. # Originally by Fran,cois Pinard , 1996. # This program is free software; you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by # the Free Software Foundation; either version 2, or (at your option) # any later version. # This program is distributed in the hope that it will be useful, # but WITHOUT ANY WARRANTY; without even the implied warranty of # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the # GNU General Public License for more details. # You should have received a copy of the GNU General Public License # along with this program; if not, write to the Free Software # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA # 02111-1307, USA. # As a special exception to the GNU General Public License, if you # distribute this file as part of a program that contains a # configuration script generated by Autoconf, you may include it under # the same distribution terms that you use for the rest of that program. if test $# -eq 0; then echo 1>&2 "Try \`$0 --help' for more information" exit 1 fi run=: # In the cases where this matters, `missing' is being run in the # srcdir already. if test -f configure.ac; then configure_ac=configure.ac else configure_ac=configure.in fi case "$1" in --run) # Try to run requested program, and just exit if it succeeds. run= shift "$@" && exit 0 ;; esac # If it does not exist, or fails to run (possibly an outdated version), # try to emulate it. case "$1" in -h|--h|--he|--hel|--help) echo "\ $0 [OPTION]... PROGRAM [ARGUMENT]... Handle \`PROGRAM [ARGUMENT]...' for when PROGRAM is missing, or return an error status if there is no known handling for PROGRAM. Options: -h, --help display this help and exit -v, --version output version information and exit --run try to run the given command, and emulate it if it fails Supported PROGRAM values: aclocal touch file \`aclocal.m4' autoconf touch file \`configure' autoheader touch file \`config.h.in' automake touch all \`Makefile.in' files bison create \`y.tab.[ch]', if possible, from existing .[ch] flex create \`lex.yy.c', if possible, from existing .c help2man touch the output file lex create \`lex.yy.c', if possible, from existing .c makeinfo touch the output file tar try tar, gnutar, gtar, then tar without non-portable flags yacc create \`y.tab.[ch]', if possible, from existing .[ch]" ;; -v|--v|--ve|--ver|--vers|--versi|--versio|--version) echo "missing 0.4 - GNU automake" ;; -*) echo 1>&2 "$0: Unknown \`$1' option" echo 1>&2 "Try \`$0 --help' for more information" exit 1 ;; aclocal*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." touch aclocal.m4 ;; autoconf) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." touch configure ;; autoheader) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`acconfig.h' or \`${configure_ac}'. You might want to install the \`Autoconf' and \`GNU m4' packages. Grab them from any GNU archive site." files=`sed -n 's/^[ ]*A[CM]_CONFIG_HEADER(\([^)]*\)).*/\1/p' ${configure_ac}` test -z "$files" && files="config.h" touch_files= for f in $files; do case "$f" in *:*) touch_files="$touch_files "`echo "$f" | sed -e 's/^[^:]*://' -e 's/:.*//'`;; *) touch_files="$touch_files $f.in";; esac done touch $touch_files ;; automake*) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified \`Makefile.am', \`acinclude.m4' or \`${configure_ac}'. You might want to install the \`Automake' and \`Perl' packages. Grab them from any GNU archive site." find . -type f -name Makefile.am -print | sed 's/\.am$/.in/' | while read f; do touch "$f"; done ;; autom4te) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. You can get \`$1Help2man' as part of \`Autoconf' from any GNU archive site." file=`echo "$*" | sed -n 's/.*--output[ =]*\([^ ]*\).*/\1/p'` test -z "$file" && file=`echo "$*" | sed -n 's/.*-o[ ]*\([^ ]*\).*/\1/p'` if test -f "$file"; then touch $file else test -z "$file" || exec >$file echo "#! /bin/sh" echo "# Created by GNU Automake missing as a replacement of" echo "# $ $@" echo "exit 0" chmod +x $file exit 1 fi ;; bison|yacc) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.y' file. You may need the \`Bison' package in order for those modifications to take effect. You can get \`Bison' from any GNU archive site." rm -f y.tab.c y.tab.h if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.y) SRCFILE=`echo "$LASTARG" | sed 's/y$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.c fi SRCFILE=`echo "$LASTARG" | sed 's/y$/h/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" y.tab.h fi ;; esac fi if [ ! -f y.tab.h ]; then echo >y.tab.h fi if [ ! -f y.tab.c ]; then echo 'main() { return 0; }' >y.tab.c fi ;; lex|flex) echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.l' file. You may need the \`Flex' package in order for those modifications to take effect. You can get \`Flex' from any GNU archive site." rm -f lex.yy.c if [ $# -ne 1 ]; then eval LASTARG="\${$#}" case "$LASTARG" in *.l) SRCFILE=`echo "$LASTARG" | sed 's/l$/c/'` if [ -f "$SRCFILE" ]; then cp "$SRCFILE" lex.yy.c fi ;; esac fi if [ ! -f lex.yy.c ]; then echo 'main() { return 0; }' >lex.yy.c fi ;; help2man) if test -z "$run" && ($1 --version) > /dev/null 2>&1; then # We have it, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a dependency of a manual page. You may need the \`Help2man' package in order for those modifications to take effect. You can get \`Help2man' from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed -n 's/.*--output=\([^ ]*\).*/\1/p'` fi if [ -f "$file" ]; then touch $file else test -z "$file" || exec >$file echo ".ab help2man is required to generate this page" exit 1 fi ;; makeinfo) if test -z "$run" && (makeinfo --version) > /dev/null 2>&1; then # We have makeinfo, but it failed. exit 1 fi echo 1>&2 "\ WARNING: \`$1' is missing on your system. You should only need it if you modified a \`.texi' or \`.texinfo' file, or any other file indirectly affecting the aspect of the manual. The spurious call might also be the consequence of using a buggy \`make' (AIX, DU, IRIX). You might want to install the \`Texinfo' package or the \`GNU make' package. Grab either from any GNU archive site." file=`echo "$*" | sed -n 's/.*-o \([^ ]*\).*/\1/p'` if test -z "$file"; then file=`echo "$*" | sed 's/.* \([^ ]*\) *$/\1/'` file=`sed -n '/^@setfilename/ { s/.* \([^ ]*\) *$/\1/; p; q; }' $file` fi touch $file ;; tar) shift if test -n "$run"; then echo 1>&2 "ERROR: \`tar' requires --run" exit 1 fi # We have already tried tar in the generic part. # Look for gnutar/gtar before invocation to avoid ugly error # messages. if (gnutar --version > /dev/null 2>&1); then gnutar "$@" && exit 0 fi if (gtar --version > /dev/null 2>&1); then gtar "$@" && exit 0 fi firstarg="$1" if shift; then case "$firstarg" in *o*) firstarg=`echo "$firstarg" | sed s/o//` tar "$firstarg" "$@" && exit 0 ;; esac case "$firstarg" in *h*) firstarg=`echo "$firstarg" | sed s/h//` tar "$firstarg" "$@" && exit 0 ;; esac fi echo 1>&2 "\ WARNING: I can't seem to be able to run \`tar' with the given arguments. You may want to install GNU tar or Free paxutils, or check the command line arguments." exit 1 ;; *) echo 1>&2 "\ WARNING: \`$1' is needed, and you do not seem to have it handy on your system. You might have modified some files without having the proper tools for further handling them. Check the \`README' file, it often tells you about the needed prerequirements for installing this package. You may also peek at any GNU archive site, in case some other package would contain this missing \`$1' program." exit 1 ;; esac exit 0 libavg-1.8.2/mkinstalldirs000077500000000000000000000037041236127404500156040ustar00rootroot00000000000000#! /bin/sh # mkinstalldirs --- make directory hierarchy # Author: Noah Friedman # Created: 1993-05-16 # Public domain errstatus=0 dirmode="" usage="\ Usage: mkinstalldirs [-h] [--help] [-m mode] dir ..." # process command line arguments while test $# -gt 0 ; do case $1 in -h | --help | --h*) # -h for help echo "$usage" 1>&2 exit 0 ;; -m) # -m PERM arg shift test $# -eq 0 && { echo "$usage" 1>&2; exit 1; } dirmode=$1 shift ;; --) # stop option processing shift break ;; -*) # unknown option echo "$usage" 1>&2 exit 1 ;; *) # first non-opt arg break ;; esac done for file do if test -d "$file"; then shift else break fi done case $# in 0) exit 0 ;; esac case $dirmode in '') if mkdir -p -- . 2>/dev/null; then echo "mkdir -p -- $*" exec mkdir -p -- "$@" fi ;; *) if mkdir -m "$dirmode" -p -- . 2>/dev/null; then echo "mkdir -m $dirmode -p -- $*" exec mkdir -m "$dirmode" -p -- "$@" fi ;; esac for file do set fnord `echo ":$file" | sed -ne 's/^:\//#/;s/^://;s/\// /g;s/^#/\//;p'` shift pathcomp= for d do pathcomp="$pathcomp$d" case $pathcomp in -*) pathcomp=./$pathcomp ;; esac if test ! -d "$pathcomp"; then echo "mkdir $pathcomp" mkdir "$pathcomp" || lasterr=$? if test ! -d "$pathcomp"; then errstatus=$lasterr else if test ! -z "$dirmode"; then echo "chmod $dirmode $pathcomp" lasterr="" chmod "$dirmode" "$pathcomp" || lasterr=$? if test ! -z "$lasterr"; then errstatus=$lasterr fi fi fi fi pathcomp="$pathcomp/" done done exit $errstatus # Local Variables: # mode: shell-script # sh-indentation: 2 # End: # mkinstalldirs ends here libavg-1.8.2/sphinxdoc/000077500000000000000000000000001236127404500147715ustar00rootroot00000000000000libavg-1.8.2/sphinxdoc/ButtonStates.png000066400000000000000000000335611236127404500201460ustar00rootroot00000000000000PNG  IHDR=M# IDATxwXTGm4)R4El X vc4蛨%Mł%jE_R "R]v?xuw,؝uy sfsfs3BEp@h>TtlmmѶm[p`jj$&&"** ˗/5mC 3ŒB݄CԪkL<;wχD"^ձ#G"&&&&&T7VGO>xaf~>E|>QQQPD S+T*c;uiڴ)^xAc*Azz /_DzzQ䡦V7 =&jjAM"&zFqAp\ 2Dc B ]ОZI˗. #Gd[|9= MS N< z췧RC=*ҦMܸqÆ Z]ulذaqK]Or 5Zx X~=]x"trpvv5ٙeE J(Z55E렦huPSSjjAMM:)Z55E렦huPSSjjAMM:)Z55E렦huPSSjjAMM:)Z55E렦huPSSjjAIFFΝ X,+KJJxzzV\ GGzרPSIrryk#)) uR55^km"--Q:fرc߻;رcQ=5#޻˃TO(OOOp8c,@M͐cV˥Cdgge˖x2r8<{ ͛7gIB{j4oݻw뭹\.wN `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ϟ?G-SȈukUD `۶mx@II >|;;;*8p,+=u#@7774|ZEB!M@P(TZERSSe)RXXxjj888(CՎr*˗/- >>hݺ\95*~ BHHB95}F[ݻ/bȑ ǨUD__~),˖-3pZ ̙2,[m):IUE)EٳqeDҥ 6mgVZMR)틌 \~]֏R|駈Í7жmjᇚp\B*(..f[ֳdlڴ g@S$0%554k֌BSTcᐘ֥#vvvёn aHXXxdӦMJ$00`%5z8@ZjElllٳgnGMA***ڵk !?f[VB$]v.]d$//OG+W?˗/ P(PC~~>huPSSjjȎ6ئIENDB`libavg-1.8.2/sphinxdoc/Recognizer.graffle000066400000000000000000001766021236127404500204440ustar00rootroot00000000000000 ActiveLayerIndex 0 ApplicationVersion com.omnigroup.OmniGraffle 138.28.0.154505 AutoAdjust BackgroundGraphic Bounds {{0, 0}, {559, 783}} Class SolidGraphic ID 2 Style shadow Draws NO stroke Draws NO CanvasOrigin {0, 0} ColumnAlign 1 ColumnSpacing 36 CreationDate 2011-09-09 17:11:41 +0200 Creator Ulrich von Zadow DisplayScale 1.000 cm = 1.000 cm GraphDocumentVersion 6 GraphicsList Bounds {{256, 142.5}, {57, 21}} Class ShapedGraphic FitText YES Flow Resize FontInfo Font HelveticaNeue Size 9 ID 28 Shape Rectangle Style fill Draws NO shadow Draws NO stroke CornerRadius 7 Draws NO Text Align 0 Text {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural \f0\fs18 \cf0 onDetected} Wrap NO Class LineGraphic FontInfo Font HelveticaNeue Size 8 Head ID 13 ID 27 Points {369.222, 223.693} {317, 183} {318, 122.5} {369.337, 82.3082} Style stroke CornerRadius 5 HeadArrow 0 HeadScale 3 HopLines HopType 1 LineType 1 TailArrow FilledArrow TailScale 3 Width 0.25 Tail ID 21 Bounds {{480, 142.5}, {37, 21}} Class ShapedGraphic FitText YES Flow Resize FontInfo Font HelveticaNeue Size 9 ID 25 Shape Rectangle Style fill Draws NO shadow Draws NO stroke CornerRadius 7 Draws NO Text Align 0 Text {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural \f0\fs18 \cf0 onEnd} Wrap NO Class LineGraphic FontInfo Font HelveticaNeue Size 8 Head ID 13 ID 24 Points {417.773, 223.685} {474, 178} {473, 125} {418.603, 82.3087} Style stroke CornerRadius 5 HeadArrow FilledArrow HeadScale 3 HopLines HopType 1 LineType 1 TailArrow 0 Width 0.25 Tail ID 21 Bounds {{340, 183.5}, {57, 21}} Class ShapedGraphic FitText YES Flow Resize FontInfo Font HelveticaNeue Size 9 ID 23 Shape Rectangle Style fill Draws NO shadow Draws NO stroke CornerRadius 7 Draws NO Text Align 0 Text {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural \f0\fs18 \cf0 onDetected} Wrap NO Class LineGraphic FontInfo Font HelveticaNeue Size 8 Head ID 21 ID 22 Points {394, 172.5} {394, 223.5} Style stroke CornerRadius 5 HeadArrow FilledArrow HeadScale 3 HopLines HopType 1 LineType 1 TailArrow 0 Width 0.25 Tail ID 14 Bounds {{351.5, 224}, {85, 38}} Class ShapedGraphic ID 21 Shape Rectangle Style fill Draws NO Text Text {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural \f0\fs18 \cf0 RUNNING} Bounds {{323, 277.914}, {142, 25}} Class ShapedGraphic FitText YES Flow Resize FontInfo Font HelveticaNeue Size 12 ID 20 Shape Rectangle Style fill Draws NO shadow Draws NO stroke CornerRadius 7 Draws NO Text Text {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural \f0\fs24 \cf0 Continuous Recognizers} Wrap NO Bounds {{409, 97.086}, {35, 21}} Class ShapedGraphic FitText YES Flow Resize FontInfo Font HelveticaNeue Size 9 ID 19 Shape Rectangle Style fill Draws NO shadow Draws NO stroke CornerRadius 7 Draws NO Text Align 0 Text {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural \f0\fs18 \cf0 onFail} Wrap NO Class LineGraphic FontInfo Font HelveticaNeue Size 8 Head ID 13 ID 17 Points {400.639, 133.527} {409, 109} {400.351, 82.4754} Style stroke CornerRadius 5 HeadArrow FilledArrow HeadScale 3 HopLines HopType 1 LineType 1 TailArrow 0 Width 0.25 Tail ID 14 Bounds {{342, 97.086}, {55, 21}} Class ShapedGraphic FitText YES Flow Resize FontInfo Font HelveticaNeue Size 9 ID 16 Shape Rectangle Style fill Draws NO shadow Draws NO stroke CornerRadius 7 Draws NO Text Align 0 Text {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\ql\qnatural\pardirnatural \f0\fs18 \cf0 onPossible} Wrap NO Class LineGraphic FontInfo Font HelveticaNeue Size 8 Head ID 14 ID 15 Points {394, 82.5} {394, 133.5} Style stroke CornerRadius 5 HeadArrow FilledArrow HeadScale 3 HopLines HopType 1 LineType 1 TailArrow 0 Width 0.25 Tail ID 13 Bounds {{351.5, 134}, {85, 38}} Class ShapedGraphic ID 14 Shape Rectangle Style fill Draws NO Text Text {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural \f0\fs18 \cf0 POSSIBLE} Bounds {{351.5, 44}, {85, 38}} Class ShapedGraphic ID 13 Shape Rectangle Style fill Draws NO Text Text {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural \f0\fs18 \cf0 IDLE} Bounds {{61.5, 277.914}, {124, 25}} Class ShapedGraphic FitText YES Flow Resize FontInfo Font HelveticaNeue Size 12 ID 12 Shape Rectangle Style fill Draws NO shadow Draws NO stroke CornerRadius 7 Draws NO Text Text {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural \f0\fs24 \cf0 Discrete Recognizers} Wrap NO Bounds {{151.5, 149}, {35, 21}} Class ShapedGraphic FitText YES Flow Resize FontInfo Font HelveticaNeue Size 9 ID 11 Shape Rectangle Style fill Draws NO shadow Draws NO stroke CornerRadius 7 Draws NO Text Align 0 Text {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural \f0\fs18 \cf0 onFail} Wrap NO Bounds {{151.5, 135}, {57, 21}} Class ShapedGraphic FitText YES Flow Resize FontInfo Font HelveticaNeue Size 9 ID 10 Shape Rectangle Style fill Draws NO shadow Draws NO stroke CornerRadius 7 Draws NO Text Align 0 Text {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural \f0\fs18 \cf0 onDetected} Wrap NO Class LineGraphic FontInfo Font HelveticaNeue Size 8 Head ID 4 ID 8 Points {136.972, 178.574} {151.5, 155} {135.958, 127.436} Style stroke CornerRadius 5 HeadArrow FilledArrow HeadScale 3 HopLines HopType 1 LineType 1 TailArrow 0 Width 0.25 Tail ID 5 Bounds {{38.5, 142.5}, {55, 21}} Class ShapedGraphic FitText YES Flow Resize FontInfo Font HelveticaNeue Size 9 ID 7 Shape Rectangle Style fill Draws NO shadow Draws NO stroke CornerRadius 7 Draws NO Text Align 0 Text {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\pardirnatural \f0\fs18 \cf0 onPossible} Wrap NO Class LineGraphic FontInfo Font HelveticaNeue Size 8 Head ID 5 ID 6 Points {111.842, 127.414} {94.5, 153} {111.842, 178.586} Style stroke CornerRadius 5 HeadArrow FilledArrow HeadScale 3 HopLines HopType 1 LineType 1 TailArrow 0 Width 0.25 Tail ID 4 Bounds {{82.5, 179}, {85, 38}} Class ShapedGraphic ID 5 Shape Rectangle Style fill Draws NO Text Text {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural \f0\fs18 \cf0 POSSIBLE} Bounds {{82.5, 89}, {85, 38}} Class ShapedGraphic ID 4 Shape Rectangle Style fill Draws NO Text Text {\rtf1\ansi\ansicpg1252\cocoartf1038\cocoasubrtf360 {\fonttbl\f0\fnil\fcharset0 HelveticaNeue;} {\colortbl;\red255\green255\blue255;} \pard\tx560\tx1120\tx1680\tx2240\tx2800\tx3360\tx3920\tx4480\tx5040\tx5600\tx6160\tx6720\qc\pardirnatural \f0\fs18 \cf0 IDLE} GridInfo GuidesLocked NO GuidesVisible YES HPages 1 ImageCounter 1 KeepToScale Layers Lock NO Name Layer 1 Print YES View YES LayoutInfo Animate NO circoMinDist 18 circoSeparation 0.0 layoutEngine dot neatoSeparation 0.0 twopiSeparation 0.0 LinksVisible NO MagnetsVisible NO MasterSheets ModificationDate 2011-09-09 17:25:00 +0200 Modifier Ulrich von Zadow NotesVisible NO Orientation 2 OriginVisible NO PageBreaks YES PrintInfo NSBottomMargin float 41 NSLeftMargin float 18 NSPaperSize coded BAtzdHJlYW10eXBlZIHoA4QBQISEhAdOU1ZhbHVlAISECE5TT2JqZWN0AIWEASqEhAx7X05TU2l6ZT1mZn2WgVMCgUoDhg== NSRightMargin float 18 NSTopMargin float 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7/l7TG KLEAAAz4jIYOXEwAEbjOAAE3FhDFhOqUCezCDvSCTSP3f5ops32q8xxh0i7s3a4IlVb8 mFJUsSgrnbACSMrkY+ycXZLVqSTAhR5j0iqSXzPoaVkwl+T8vF9L/AydDWlDSxyRYlMb ZSVWCRaBiR02ZtwZlaXzGeX87NdiQa2TrFLUm1G5M825uSDsnAWhc/YNdEFbK6lw4mgJ umhzrnfSREpN56NfmtIFX69H8y6QV2NjwAaElVo2VkG9IX30nqkiMy4G5TkdNM/eqCDK xTS39jmotH501lqrXj3SrjP2AjHK1wEo0BBZPfBKYNO692Y84/Z0UubDu9fhn+FlXa72 btnbRFtI7b29t+hWTSE5iIO4ZCGoktSxlSxxn9iUuM/sEmlLV1z9kHjHtKw2YlY6iI5h NUKoykPpS1qLJHAQADK4RZh4LzDOpjLTMc5E1iVYZsu+StzixoKoVAlrJCBgPgAhyNOg dBY+aGQzVYv9BAK6cjbGfgzlUOOvIMD3mmHNVYpj9KrMpRiOZI1csZNNPho9Dr8/4g+S gAYmHKQjUDsc/AABh1EAEdB1gACL1cqG3ddEEHV10npP9wY+yQeamRzSAgAOAQAAAwAA AAEATgAAAQEAAwAAAAEAKwAAAQIAAwAAAAQAAAkEAQMAAwAAAAEABQAAAQYAAwAAAAEA AgAAAREABAAAAAEAAAAIARIAAwAAAAEAAQAAARUAAwAAAAEABAAAARYAAwAAAAEAKwAA ARcABAAAAAEAAAhOARwAAwAAAAEAAQAAAT0AAwAAAAEAAgAAAVIAAwAAAAEAAQAAAVMA AwAAAAQAAAkMAAAAAAAIAAgACAAIAAEAAQABAAE= ReadOnly NO RowAlign 1 RowSpacing 36 SheetTitle Canvas 1 SmartAlignmentGuidesActive YES SmartDistanceGuidesActive YES UniqueID 1 UseEntirePage VPages 1 WindowInfo CurrentSheet 0 ExpandedCanvases name Canvas 1 Frame {{476, 121}, {693, 937}} ListView OutlineWidth 142 RightSidebar ShowRuler Sidebar SidebarWidth 120 VisibleRegion {{0, 0}, {558, 783}}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~gxZE 0|nwwC Ixs.lHk l6xc7S|QOfawu9o]Ϟ=oNE]4m'&_Uh#eG 6 D=n *fm޲Wmn뭷k9&ǜtR`7ߺ,!aN*(Q[hphH}uy!K/ s:٣:mql0UiΩ&T|x}^dcI&7-M9^ydc̿ͬ}6wb"O+5A4TZ*oK~i~OJcRYim9텩͝p=mban -;y䑠n'Y  8=#@ȼqhعY&8,~KAG3hH㸐! oAOn8|뭷%>ܙm5X#͡?ޒ-w}v%}syCK?ᆣ ʉWOG+Mh: Jh;x1glxy2 wP^<X_myFA˳תs-ds)8Q\9'oMO nXsl\GǤYim.z4w *Q7{!*G}P56G`vR8.b]8< 3kskd~ʵL$fGRi{g6aB6=[* {93W'b\'r"kcR;?a*l#@ X:u߄l^- e0'guVE]<:` ,q_tPkAc4 3˜P. ;+-MT\͝*P:x :L:M=ܐҜƵܚp'Wd@ĎYima YgIer@]v}ᡋh0l;Ûı opbgG00070$?o։qu;UkNcl[KA?3kC=V n Q9cyСh8ؒry !!nNaZ1z?cqG *g{'D1#qS <<ޮ2Lw! 8Gj7/(kfs#rcw -B~2 ^( kiw1ܙ`~4w4AQ0#ݰ[a;p`{DZfzvbw}T)CK;4Ñ ;O+1VG]‰-׏l%3_"Юts 6?* -Zl渮v\1m>(R~WjysN5\8E엘 a]iڢ#P8w|hɆJ1Q^{ሐU2d;(O^TGJC@ƴ=bW/cȎ(O gxkoؤSVvt5 T]M\t;]C" " " E' @$PՌP" " " 5@U3B " " "PtL@UU@ H*/" " "P3 T5#T" " " E' @$PՌP" " " 5@U3B " " "PtL@UU@ H*/" " "P3 T5#T" " " E'[~tIENDB`libavg-1.8.2/sphinxdoc/ToggleButtonStates.png000066400000000000000000001240501236127404500213020ustar00rootroot00000000000000PNG  IHDRœ IDATxw\S?WBPYUpTq" jնZpTu}'"V(Ņ( +!?54.!>ιs1B!*! B!!DLL RSSQR%4iFFF|E)`B4L&áCg\rRTa˖-www%!tum;QQQd'///L:$ 0!ѣ=z4򐗗y&LΝ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{Aii)R) *"??HJJBrr21w\DEEѓF 01Z8<Ν;Trߟ y'233WWWL4 >>>СOB!<!P&Bx@B`B!T !>:MIENDB`libavg-1.8.2/sphinxdoc/animation.rst000066400000000000000000000214251236127404500175060ustar00rootroot00000000000000Animation ========= .. automodule:: libavg.avg :no-members: .. inheritance-diagram:: AnimState ContinuousAnim EaseInOutAnim LinearAnim ParallelAnim StateAnim WaitAnim :parts: 1 .. autoclass:: Anim Base class for all animations. .. py:method:: setStartCallback(pyfunc) Sets a python callable to be invoked when the animation starts. Corresponds to the constructor parameter startCallback. .. py:method:: setStopCallback(pyfunc) Sets a python callable to invoke when the animation has finished running. Corresponds to the constructor parameter stopCallback. .. py:method:: abort Stops the animation. .. py:method:: start(keepAttr) Starts the animation. :param keepAttr: If this parameter is set to :py:const:`True`, the animation doesn't set the attribute value when starting. Instead, it calculates a virtual start time from the current attribute value and proceeds from there. .. py:method:: isRunning Returns :py:const:`True` if the animation is currently executing. .. autoclass:: AnimState(name, anim, nextName="") One state of a :py:class:`StateAnim`. :param name: The name of the state. Used in :py:meth:`StateAnim.setState` and :py:meth:`StateAnim.getState()`. :param anim: The child animation to run when this state is active. :param nextName: The name of the state to enter when this state is done. .. autoclass:: AttrAnim .. autoclass:: ContinuousAnim(node, attrName, startValue, speed, [useInt=False, startCallback=None, stopCallback=None]) Class that animates an attribute of a libavg node continuously and linearly. The animation will not stop until the :py:meth:`abort()` method is called. A possible use case is the continuous rotation of an object. :param node: The libavg node object to animate. :param attrName: The name of the attribute to change. :param startValue: Initial value of the attribute. :param speed: Attribute change per second. :param useInt: If :py:const:`True`, the attribute is always set to an integer value. :param startCallback: Python callable to invoke when the animation starts. :param stopCallback: Python callable to invoke when the animation has finished running, either because abort was called or because another animation for the same attribute was started. .. autoclass:: EaseInOutAnim(node, attrName, duration, startValue, endValue, easeInDuration, easeOutDuration, [useInt=False, startCallback=None, stopCallback=None]) Class that animates an attribute of a libavg node. The animation proceeds in three phases: ease-in, linear and ease-out. Start and end speed are zero. Ease-in and ease-out phases have the shape of one quadrant of the sine curve. :param node: The libavg node object to animate. :param attrName: The name of the attribute to change. :param duration: The length of the animation in milliseconds. :param startValue: Initial value of the attribute. :param endValue: Value of the attribute after duration has elapsed. :param easeInDuration: The duration of the ease-in phase in milliseconds. :param easeOutDuration: The duration of the ease-out phase in milliseconds. :param useInt: If :py:const:`True`, the attribute is always set to an integer value. :param startCallback: Python callable to invoke when the animation starts. :param stopCallback: Python callable to invoke when the animation has finished running, either because it has run the allotted time, because abort was called or because another animation for the same attribute was started. .. autoclass:: LinearAnim(node, attrName, duration, startValue, endValue, [useInt=False, startCallback=None, stopCallback=None]) Class that animates an attribute of a libavg node by interpolating linearly between start and end values. :param node: The libavg node object to animate. :param attrName: The name of the attribute to change. :param duration: The length of the animation in milliseconds. :param startValue: Initial value of the attribute. :param endValue: Value of the attribute after duration has elapsed. :param useInt: If :py:const:`True`, the attribute is always set to an integer value. :param startCallback: Python callable to invoke when the animation starts. :param stopCallback: Python callable to invoke when the animation has finished running, either because it has run the allotted time, because abort was called or because another animation for the same attribute was started. .. autoclass:: ParallelAnim(anims, [startCallback, stopCallback, maxAge]) Animation that executes several child animations at the same time. The duration of the ParallelAnim is the maximum of the child's durations or maxAge, whatever is shorter. :param anims: A list of child animations. :param startCallback: Python callable to invoke when the animation starts. :param stopCallback: Python callable to invoke when the animation has finished running, either because it has run the allotted time or because abort was called. :param maxAge: The maximum duration of the animation in milliseconds. .. py:method:: start(keepAttr) Starts the animation by calling :py:meth:`start` for each of the child animations. :param keepAttr: This parameter is passed to the child animations. .. autoclass:: SimpleAnim Base class for animations that change libavg node attributes by interpolating over a set amount of time. If :py:meth:`Anim.abort()` isn't needed, there is no need to hold on to the animation object after calling :py:meth:`Anim.start` - it will exist exactly as long as the animation lasts and then disappear. The animation framework makes sure that only one animation per attribute of a node runs at any given time. If a second one is started, the first one is aborted. .. autoclass:: StateAnim(states) Animation that executes one of several child animations depending on its current state. The state can be None, in which case no animation is executed. None is the initial state. Note that changing the state of an animation during a start or stop callback of a child animation is not possible. An attempt to do so is silently ignored. :param states: A list of AnimState objects. .. py:method:: getState .. py:method:: setDebug(debug) Setting this to :py:const:`True` causes all state changes to be printed on the console. .. py:method:: setState .. autoclass:: WaitAnim([duration=-1, startCallback, stopCallback]) Animation that simply does nothing for a specified duration. Useful in the context of StateAnims. :param duration: The length of the animation in milliseconds. :param startCallback: Python callable to invoke when the animation starts. :param stopCallback: Python callable to invoke when the animation has finished running, either because it has run the allotted time or because abort was called. .. py:method:: start .. autofunction:: fadeIn(node, duration, [max=1.0, stopCallback]) Fades the opacity of a node. :param node: The node to fade. :param duration: Length of the fade in milliseconds. :param max: The opacity of the node at the end of the fade. :param stopCallback: Function to call when the fade is over. .. autofunction:: fadeOut(node, duration, [stopCallback]) Fades the opacity of a node to zero. :param node: The node to fade. :param duration: Length of the fade in milliseconds. :param stopCallback: Function to call when the fade is over. .. autofunction:: getNumRunningAnims() -> int Returns the total number of running attribute-based animations (this includes LinearAnim, EaseInOutAnim and ContinuousAnim). Useful for debugging memory leaks. libavg-1.8.2/sphinxdoc/app.rst000066400000000000000000000204431236127404500163060ustar00rootroot00000000000000app module ========== .. automodule:: libavg.app .. note:: The app package is experimental. Functionality and interface are still in flux and subject to change. .. autoclass:: App This class handles global application affairs. Among these are setting up a root node along with window size (and possibly screen resolution) and screen rotation, and creating an environment for the user's :py:class:`MainDiv`. Global user interface items such as a debug panel and keyboard manager are also set up. Additionally, :py:class:`App` handles configuration settings and command line argument support. :py:class:`App` usually does not need to be subclassed. Instead, subclass :py:class:`MainDiv` and pass an instance of the derived class to :py:meth:`run()`. .. py:attribute:: debugPanel An instance of debugpanel.DebugPanel. .. py:attribute:: mainDiv The instance passed as first argument of the :py:meth:`run()` method. .. py:attribute:: overlayPanel DivNode that stands always on top of the MainDiv. .. py:attribute:: settings An instance of settings.Settings. .. py:method:: dumpTextObjectCount() Dumps on the console the current number of initialized objects. Normally bound to the keypress :kbd:`CTRL-b`. .. py:method:: onBeforeLaunch() Called just before starting the main loop (:samp:`Player.play()`). Useful only for subclassing. The display hasn't been initialized at this point. .. py:method:: run(mainDiv, **kargs) Starts the application using the provided :py:attr:`mainDiv` (an instance of :py:class:`MainDiv`). The optional additional kargs are used to set default settings - see :py:class:`settings.Settings`. .. py:method:: takeScreenshot(targetFolder='.') Takes a screenshot of what is currently visible on the screen. Normally bound to the keypress :kbd:`CTRL-p`. Screenshots are saved to the disk under the name 'App-nnn.png', where nnn is a sequence number. .. autoclass:: MainDiv This abstract class must be subclassed to write a libavg application. It is the main application entry point and should be the parent node for all application-created nodes. All the public methods are empty and don't do anything if not overridden. .. py:attribute:: VERSION A version string. This is shown using the :option:`-v` or :option:`--version` command-line option. .. py:method:: onArgvParsed(options, args, parser) This method is called after command-line arguments have been parsed and should be used to retrieve any application-specific options. The arguments :py:attr:`options` and :py:attr:`args` are the result of calling :samp:`options, args = parser.parse_args()`, where parser is an instance of :py:class:`optparse.OptionParser` configured by calling :py:meth:`onArgvParserCreated`. .. py:method:: onArgvParserCreated(parser) Called with an empty :py:class:`optparse.OptionParser` instance. Allows the application to add additional command line options. :py:class:`App` adds it's own parameters as well. If this is overridden, :py:meth:`onArgvParsed()` should probably be overridden as well. .. py:method:: onExit() Called after the main loop exits. Release resources and run cleanups here. .. note:: onExit() doesn't get called if an exception is raised on the main thread. .. py:method:: onFrame() Called every frame. .. py:method:: onInit() Called by a libavg timer as soon as the main loop starts. At this point in time, the window has been created and all render functions are available. Build the application node tree here. .. py:method:: onStartup() Called before libavg has been setup, just after the :samp:`App().run()` call. The window has not been created at this time. keyboardmanager Module ---------------------- .. automodule:: libavg.app.keyboardmanager :no-members: This module makes it possible to attach event handlers to individual keypresses. Keys that are bound through the keyboard manager are also be shown in the debug panel via the keyboard bindings widget along with their help string. :py:class:`libavg.app.App` defines a range of keyboard bindings by default. The keyboardmanager is usually set up by :py:class:`libavg.app.App`. :py:class:`libavg.app.App` also reserves all keys modified by :kbd:`CTRL`. For all the binding methods, keystring can be a python string or a unicode object. Plain strings are matched to :py:attr:`libavg.avg.KeyEvent.keystring`, while unicode objects are matched to :py:attr:`libavg.avg.KeyEvent.unicode`. The modifiers are described under :py:attr:`libavg.avg.KeyEvent.modifiers`, with the additional modifiers :py:const:`KEYMOD_SHIFT`, :py:const:`KEYMOD_CTRL` and :py:const:`KEYMOD_ALT` available to simplify checking for left and right modifier keys at one time. .. py:function:: bindKeyDown(keystring, handler, help, modifiers=avg.KEYMOD_NONE) Sets up a key handler so that :py:attr:`handler` is called whenever :py:attr:`keystring` is pressed. .. py:function:: bindKeyUp(keystring, handler, help, modifiers=avg.KEYMOD_NONE) Sets up a key handler so that :py:attr:`handler` is called whenever :py:attr:`keystring` is released. .. py:function:: disable() Companion to :py:meth:`enable()`, disables all handlers. .. py:function:: enable() Companion to :py:meth:`disable()`, enables all handlers. .. py:function:: getCurrentBindings() Returns the currently assigned bindings as a list of named tuples. .. py:function:: init() Called by :py:class:`App`. Should not be called by user programs. .. py:function:: pop() Companion to :py:meth:`push()`, restores the non-modified key bindings previously pushed onto the stack via :py:meth:`push()`. .. py:function:: push() Pushes all the non-modified key bindings onto a stack and clears them all. Useful when the application flow branches to a state where a different key bindings set is needed. The bindings can be then restored with :py:meth:`pop()`. .. py:function:: unbindAll() Removes all the defined key bindings at once. .. py:function:: unbindKeyDown(keystring, modifiers=avg.KEYMOD_NONE) Removes a previously defined key binding for a KEY_DOWN event. .. py:function:: unbindKeyDown(keystring, modifiers=avg.KEYMOD_NONE) Removes a previously defined key binding for a KEY_UP event. flashmessage Module ------------------- .. automodule:: libavg.app.flashmessage :no-members: .. autoclass:: FlashMessage(text, timeout=DEFAULT_TIMEOUT, parent=None, isError=False, acknowledge=False) A :py:class:`FlashMessage` is an easy way to show debug notification and similar text in the libavg window. The message can have an optional timeout or stay visible until clicked on by the user. It inserts itself into node tree at the top. Multiple :py:class:`FlashMessage` instances are shown in the order they get created. :param timeout: The time in milliseconds the message should persist on screen before it gets removed. Only valid if :py:attr:`acknowledge` is :py:const:`False`. :param parent: When specified, the parent node the message should be appending itself to. :param isError: A boolean flag to mark the message as error. Error-flagged messages are shown in a different color and are routed to the logger as well. :param acknowledge: A flag to indicate whether the message should remove itself automatically (after timeout has elapsed) or needs to be acknowledged by the user (by clicking / touching on it). libavg-1.8.2/sphinxdoc/areanodes.rst000066400000000000000000000774051236127404500175010ustar00rootroot00000000000000Area Nodes ========== .. automodule:: libavg.avg :no-members: .. inheritance-diagram:: AVGNode AreaNode CameraNode CanvasNode DivNode ImageNode Node RasterNode SoundNode VideoNode WordsNode :parts: 1 .. autoclass:: AreaNode([x, y, pos, width, height, size, angle, pivot]) Base class for elements in the avg tree that define an area on the screen. Responsible for coordinate transformations and event handling. See http://www.libavg.de/wiki/ProgrammersGuide/CoordinateSystems for an explanation of coordinate systems and reference points. .. py:method:: getMediaSize() -> avg.Point2D Returns the size in pixels of the media in the node. Image nodes return the bitmap size, Camera nodes the size of a camera frame and Words nodes the amount of space the text takes. Video nodes return the video size if decoding has started or (0,0) if not. Decoding starts after :py:func:`play` or :py:func:`pause` is called and the node can be rendered. .. py:attribute:: x This is the horizontal position of the node's reference point relative to its parent node. .. py:attribute:: y This is the vertical position of the node's reference point relative to its parent node. .. py:attribute:: pos This is the position of the node's reference point relative to its parent node. .. py:attribute:: width .. py:attribute:: height .. py:attribute:: angle The angle that the node is rotated to in radians. 0 is unchanged, 3.14 is upside-down. .. py:attribute:: size The size that the node takes on the canvas. Node types usually have sensible defaults for the size. For media nodes, this is generally the size of the media (so :samp:`size == getMediaSize()`). For DivNodes, the default size is infinite. .. py:attribute:: pivot The position of the point that the node is rotated around. Default is the center of the node. .. autoclass:: AVGNode() Root node of an onscreen avg tree. Defines the properties of the display and handles key press events. The AVGNode's width and height define the coordinate system for the display and are the default for the window size used (i.e. by default, the coordinate system is pixel-based). .. autoclass:: CameraControl Camera controls are camera configuration parameters like brightness and white balance. A CameraControl object contains information about the supported maximum and minimum values as well as defaults for a specific control. .. py:attribute:: controlName String which tells which control is meant. Read-only. .. py:attribute:: default .. py:attribute:: max .. py:attribute:: min .. autoclass:: CameraImageFormat CameraImageFormat objects contain information about a supported image format of a camera. .. py:attribute:: framerates List of supported frame rates in images per second for that image format as floats. Read-only. .. py:attribute:: pixelFormat String which tells about the pixel format (see :py:class:`Bitmap`). Read-only. .. py:attribute:: size A point which represents the resolution in width and height. Read-only. .. autoclass:: CameraInfo CameraInfo objects contain data about camera capabilities. The data can be used to create create objects of class :py:class:`CameraNode`. The unique value to identify the camera is stored in :py:attr:`device`, whereas :py:attr:`driver` tells which driver is used to call the camera itself. Information about supported camera :py:attr:`controls` or :py:attr:`imageFormats` are stored in two separate lists. .. py:attribute:: controls List of :py:class:`CameraControl` objects with all possible controls for that camera. Read-only. .. py:attribute:: device String which contains the unique id of the camera. Read-only. .. py:attribute:: driver String which contains the name of the driver. Read-only. .. py:attribute:: imageFormats List of :py:class:`CameraImageFormat` objects with all possible image formats for that camera. Read-only. .. autoclass:: CameraNode([driver='firewire', device="", unit=-1, fw800=False, framerate=15, capturewidth=640, captureheight=480, pixelformat="RGB", brightness, exposure, sharpness, saturation, camgamma, shutter, gain, strobeduration]) A node that displays the image of a camera. The attributes correspond to the camera properties in .avgtrackerrc and are explained under http://www.libavg.de/wiki/ProgrammersGuide/Tracker. An easy way to find the appropriate parameters for your camera is to use :command:`avg_showcamera.py`. CameraNodes open the camera device on construction and set the chosen camera parameters immediately. .. py:attribute:: brightness .. py:attribute:: camgamma .. py:attribute:: device Read-only. .. py:attribute:: driver Read-only. .. py:attribute:: framenum The number of frames the camera has read since playback started. Read-only. .. py:attribute:: framerate Read-only. .. py:attribute:: gain .. py:attribute:: saturation .. py:attribute:: sharpness .. py:attribute:: shutter .. py:attribute:: strobeduration .. py:method:: doOneShotWhitebalance() .. py:method:: getBitmap() -> Bitmap Returns a copy of the last camera frame. .. py:method:: getWhitebalanceU() -> int .. py:method:: getWhitebalanceV() -> int .. py:method:: isAvailable() -> bool Returns :py:const:`True` if there is a working device that can deliver images attached to the CameraNode. .. py:method:: play() Starts reading images from the camera device and displays them. Note that the camera device is opened on construction of the CameraNode. .. py:method:: setWhitebalance(u, v) .. py:method:: stop() Stops camera playback. .. py:classmethod:: getCamerasInfos() Returns a list of :py:class:`CameraInfo` objects, one for for each connected camera. .. py:classmethod:: resetFirewireBus() Frees all allocated bandwidth and devices on the firewire bus. Helpful if a program using a firewire device has crashed leaving resources allocated. Note that all firewire devices (including for instance external hard drives) are affected. .. autoclass:: CanvasNode Root node of a scene graph. .. autoclass:: DivNode([crop=False, elementoutlinecolor, mediadir]) A div node is a node that groups other nodes logically and visually. Its position is used as point of origin for the coordinates of its child nodes. Its extents can be used to clip the children if crop is set to :py:const:`True`. Its opacity is used as base opacity for the child nodes' opacities. The children of a div node are drawn in the order they are found in the avg file, so the first one is below all others in z-order. .. py:attribute:: crop Boolean that turns clipping on or off. .. py:attribute:: elementoutlinecolor Allows debugging of div node nesting by rendering the outlines of this div and all its div children in the specified color (given in html hex format). Turn off by setting the color to the empty string. .. py:attribute:: mediadir .. deprecated:: 1.7 Seldom used, error-prone and slow. The directory that the media files for the children of this node are in. Relative mediadirs are taken to mean subdirectories of the parent node's mediadir. .. py:method:: getNumChildren() -> int Returns the number of immediate children that this div contains. .. py:method:: getChild(i) -> Node Returns the child at index :py:attr:`i`. .. py:method:: appendChild(node) Adds a new child to the container behind the last existing child. .. py:method:: insertChildBefore(newNode, oldChild) Adds a new child to the container before the existing node :py:attr:`oldChild`. In z-order, the new child ist behind the old one. .. py:method:: insertChildAfter(newNode, oldChild) Adds a new child to the container after the existing node :py:attr:`oldChild`. In z-order, the new child ist in front of the old one. .. py:method:: insertChild(node, i) Adds a new child to the container at index :py:attr:`i`. .. py:method:: removeChild(node) Removes the child given by :py:attr:`node` from the div. Note that as long as other references to the node exist, the node is not deleted. .. py:method:: removeChild(i) Removes the child at index :py:attr:`i` from the div. Note that as long a` other references to the node exist, the node is not deleted. .. py:method:: reorderChild(oldIndex, newIndex) Moves the child at :py:attr:`oldIndex` so it is at :py:attr:`newIndex`. This function can be used to change the order in which the children are drawn. .. py:method:: reorderChild(node, newPos) Moves the child :py:attr:`node` so it is at index :py:attr:`newPos`. This function can be used to change the order in which the children are drawn. .. py:method:: indexOf(node) Returns the index of the node given. Throws an exception if :py:attr:`node` isn't a child of the :py:class:`DivNode`. .. py:method:: getEffectiveMediaDir() -> string Returns the node's effective mediadir by traversing the node hierarchy up to the root node. .. autoclass:: ImageNode([href, compression]) A static raster image on the screen. The content of an ImageNode can be loaded from a file. It can also come from a :py:class:`Bitmap` object or from an :py:class:`OffscreenCanvas`. Alpha channels of the image files are used as transparency information. .. py:attribute:: compression The texture compression used for this image. Currently, :py:const:`none` and :py:const:`B5G6R5` are supported. :py:const:`B5G6R5` causes the bitmap to be compressed to 16 bit per pixel on load and is only valid if the source is a filename. Read-only. .. py:attribute:: href In the standard case, this is the source filename of the image. To use a bitmap as source, call setBitmap(). To use an offscreen canvas as source, use the :samp:`canvas:` protocol: :samp:`href="canvas:{id}"`. .. py:method:: getBitmap() -> Bitmap Returns a copy of the bitmap that the node contains. .. py:method:: setBitmap(bitmap) Sets a bitmap to use as content for the ImageNode. Sets href to an empty string. .. autoclass:: RasterNode([maxtilewidth, maxtileheight, blendmode, mipmap, maskhref, maskpos, masksize, gamma, contrast, intensity]) Base class for all nodes that have a direct 2D raster representation. This includes Image, Word, Camera, and Video nodes. The base class implements color controls (:py:attr:`contrast`, :py:attr:`intensity`, :py:attr:`gamma`), alpha masks (:py:attr:`maskhref`, :py:attr:`maskpos`, :py:attr:`masksize`), several blend modes that define how compositing is done and mipmapping support. Any Raster Node can have a GPU-based effect added to it by using :py:meth:`setEffect`. In addition, RasterNodes can be warped. By default, a RasterNode is rectangular. However, it can be subdivided into a grid of reference points using :py:attr:`maxtilewidth` and :py:attr:`maxtileheight`. The position of each of these points can be changed with :py:meth:`getOrigVertexCoords`, :py:meth:`getWarpedVertexCoords` and :py:meth:`setWarpedVertexCoords`, yielding arbitrary shapes. .. py:attribute:: blendmode .. deprecated:: 1.7 The min and max blend modes will be removed. The method of compositing the node with the nodes under it. Valid values are :py:const:`blend`, :py:const:`add`, :py:const:`min` and :py:const:`max`. For :py:const:`min` and :py:const:`max` blend modes, opacity is ignored. .. py:attribute:: contrast A control for the color contrast of the node. contrast is a triple that contains separate float values for red, green, and blue. A contrast value of 1.0 in all channels leaves the image unchanged. .. py:attribute:: gamma Allows node-specific gamma correction. gamma is a triple that contains separate float values for red, green, and blue. A gamma value of 1.0 in all channels leaves the image unchanged. Higher gamma values increase, lower values decrease the brightness. In all cases, black and white pixels are not affected by gamma. See also http://en.wikipedia.org/wiki/Gamma_correction. .. py:attribute:: intensity A control for the brightness of the node. intensity is a triple that contains separate float values for red, green, and blue. An intensity value of 1.0 in all channels leaves the image unchanged. This value corresponds to the photoshop brightness value. .. py:attribute:: maskhref The source filename for a mask image to be used as alpha channel. Where this file is white, the node is shown. Where it is black, the node is transparent. If the node is an image with an alpha channel, the alpha channel is replaced by the mask. .. py:attribute:: maskpos An offset for the mask image. For images and videos, the offset is given in image or video pixels, respectively. For words nodes, the offset is given in screen pixels. If portions of the node extend outside the mask, the border pixels of the mask are taken. Note that the maskpos is an offset from the top left of the node, even for :py:class:`WordsNode` objects that have :py:attr:`alignment` :py:const:`Center` or :py:const:`Right`. .. py:attribute:: masksize The size of the mask image. For images and videos, the size is given in image or video pixels, respectively. For words nodes, the size is given in screen pixels. If portions of the node extend outside the mask, the border pixels of the mask are taken. .. py:attribute:: maxtileheight The maximum height of the tiles used for warping. The effective tile size is also dependent on hardware and driver limits. Read-only. .. py:attribute:: maxtilewidth The maximum width of the tiles used for warping. The effective tile size is also dependent on hardware and driver limits. Read-only. .. py:attribute:: mipmap Determines whether mipmaps (http://en.wikipedia.org/wiki/Mipmap) are generated for this node. Setting this to :py:const:`True` improves the quality of minified nodes. Depending on the graphics card in use, turning on mipmaps may cause an extreme performance hit for every image change or have no performance cost at all. Read-only. .. py:method:: getOrigVertexCoords() -> list Returns the unwarped coordinate of all vertices as a list of lists. .. py:method:: getWarpedVertexCoords() -> list Returnes the current coordinate of all vertices as a list of lists. .. py:method:: setEffect(FXNode) Attaches an :py:class:`FXNode` to the node that modifies how it looks. .. py:method:: setWarpedVertexCoords(grid) Changes the current coordinates of all vertices. :py:attr:`grid` is a list of lists of coordinate tuples. :py:meth:`setWarpedVertexCoords` can only be called if the node is in a renderable state. This means that :py:meth:`Player.play()` must have been called and the node must be inserted in a Canvas. There must also be something to render (for instance, :py:meth:`play()` must be called before :py:meth:`setWarpedVertexCoords` in the case of a :py:class:`CameraNode`). The grid submitted is lost if the node loses renderable status. .. autoclass:: SoundNode([href, loop=False, volume=1.0]) A sound played from a file. **Messages:** To get this message, call :py:meth:`Publisher.subscribe`. .. py:method:: Node.END_OF_FILE() Emitted when the end of the audio stream has been reached. .. py:attribute:: duration The duration of the sound file in milliseconds. Some file formats don't store valid durations; in this case, 0 is returned. Read-only. .. py:attribute:: href The source filename of the sound. .. py:attribute:: loop Whether to start the sound again when it has ended. Read-only. .. py:attribute:: volume Audio playback volume for this sound. 0 is silence, 1 passes media file volume through unchanged. Values higher than 1 can be used to amplify sound if the sound file doesn't use the complete dynamic range. .. py:method:: getAudioCodec() -> string Returns the codec used as a string such as :samp:`"mp2"`. .. py:method:: getAudioSampleRate() -> int Returns the sample rate in samples per second (for example, 44100). .. py:method:: getCurTime() -> time Returns milliseconds of playback time since audio start. .. py:method:: getNumAudioChannels() -> int Returns the number of channels. 2 for stereo, etc. .. py:method:: pause() Stops audio playback but doesn't close the object. The playback cursor stays at the same position. .. py:method:: play() Starts audio playback. .. py:method:: seekToTime(time) Moves the playback cursor to the time given in milliseconds. .. py:method:: setEOFCallback(pyfunc) .. deprecated:: 1.8 Use the message interface instead. Sets a python callable to be invoked when the audio reaches end of file. .. py:method:: stop() Stops audio playback. Closes the object and 'rewinds' the playback cursor. .. autoclass:: VideoNode([href, loop=False, threaded=True, fps, queuelength=8, volume=1.0, accelerated=True, enablesound=True]) Video nodes display a video file. Video formats and codecs supported are all formats that ffmpeg/libavcodec supports. Usage is described thoroughly in the libavg wiki: https://www.libavg.de/wiki/ProgrammersGuide/VideoNode. **Messages:** To get this message, call :py:meth:`Publisher.subscribe`. .. py:method:: Node.END_OF_FILE() Emitted when the end of the video stream has been reached. .. py:attribute:: accelerated On construction, set to :py:const:`True` if hardware acceleration should be used to decode this video. Later queries of the attribute return :py:const:`True` if acceleration is actually being used. Read-only. .. py:attribute:: enablesound On construction, set to :py:const:`True` if any audio present in the video file should be played back as well. A value of :py:const:`False` ignores audio and just plays a silent video. .. py:attribute:: fps The nominal frames per second the object should display at. Read-only. .. py:attribute:: href The source filename of the video. .. py:attribute:: loop Whether to start the video again when it has ended. Read-only. .. py:attribute:: queuelength The length of the decoder queue in video frames. This is the number of frames that can be decoded before the first one is displayed. A higher number increases memory consumption but also resilience against data source latency (i.e. hiccups during disk reads). Can only be set at node construction. Can't be set if :samp:`threaded=False`, since there is no queue in that case. .. py:attribute:: threaded Whether to use separate threads to decode the video. The default is :py:const:`True`. Setting this attribute to :py:const:`False` makes seeking much quicker. On the other hand, it also disables audio and prevents libavg from distributing the CPU load over several cores of a multi-core computer. .. py:attribute:: volume Audio playback volume for this video. 0 is silence, 1 passes media file volume through unchanged. Values higher than 1 can be used to amplify sound if the sound file doesn't use the complete dynamic range. If there is no audio track, volume is ignored. .. py:method:: getAudioCodec() -> string Returns the audio codec used as a string such as :samp:`mp2`. .. py:method:: getAudioSampleRate() -> int Returns the sample rate in samples per second (for example, 44100). .. py:method:: getBitrate() -> int Returns the number of bits in the file per second. .. py:method:: getContainerFormat() -> string Returns the video file format. This is a string such as :samp:`avi` or :samp:`mpeg`. .. py:method:: getCurFrame() -> int Returns the index of the video frame currently playing. .. py:method:: getCurTime() Returns milliseconds of playback time since video start. .. py:method:: getDuration() -> int Returns the duration of the video in milliseconds. Some file formats don't store valid durations; in this case, 0 is returned. Read-only. .. py:method:: getNumFrames() -> int Returns the number of frames in the video. .. py:method:: getNumAudioChannels() -> int Returns the number of audio channels. 2 for stereo, etc. .. py:method:: getNumFramesQueued() -> int Returns the number of frames already decoded and waiting for playback. .. py:method:: getStreamPixelFormat() -> string Returns the pixel format of the video file as a string. Possible pixel formats are described in http://ffmpeg.mplayerhq.hu/doxygen/trunk/pixfmt_8h.html#60883d4958a60b91661e97027a85072a .. py:method:: getVideoCodec() -> string Returns the video codec used as a string such as :samp:`mpeg4`. .. py:method:: hasAlpha() -> bool Returns :py:const:`True` if the video contains an alpha (transparency) channel. Throws an exception if the video has not been opened yet. .. py:method:: hasAudio() -> bool Returns :py:const:`True` if the video contains an audio stream. Throws an exception if the video has not been opened yet. .. py:method:: pause() Stops video playback but doesn't close the object. The playback cursor stays at the same position and the decoder queues remain full. .. py:method:: play() Starts video playback. .. py:method:: seekToFrame(num) Moves the playback cursor to the frame given. .. py:method:: seekToTime(millisecs) Moves the playback cursor to the time given. .. py:method:: setEOFCallback(pyfunc) .. deprecated:: 1.8 Use the message interface instead. Sets a python callable to be invoked when the video reaches end of file. .. py:method:: stop() Stops video playback. Closes the file, 'rewinds' the playback cursor and clears the decoder queues. .. py:classmethod:: getVideoAccelConfig() -> enum Returns either :py:const:`NO_ACCELERATION` if the current configuration does not support hardware-accelerated video decoding or :py:const:`VDPAU` if VDPAU can be used to decode videos. .. autoclass:: WordsNode([fontstyle=None, font="sans", variant="", text="", color="FFFFFF", fontsize=15, indent=0, linespacing=-1, alignment="left", wrapmode="word", justify=False, rawtextmode=False, letterspacing=0, aagamma=1, hint=True]) A words node displays formatted text. All properties are set in pixels. International and multi-byte character sets are fully supported. Words nodes use UTF-8 to encode international characters (use python unicode strings for this). The pos attribute of a words node is the logical top left of the first character for left-aligned text. For centered and right-aligned text, it is the top center and right of the first line, respectively. For latin text, the logical top usually corresponds to the height of the ascender. There may be cases where portions of the text are rendered to the left of or above the logical position, for instance when italics are used. Words nodes are rendered using pango internally. .. py:attribute:: alignment The paragraph alignment. Possible values are :py:const:`left`, :py:const:`center` and :py:const:`right`. .. py:attribute:: aagamma Defines a gamma-correction value for the alpha (transparency) of the text rendered. Using this attibute, it is possible to fine-tune the text antialiasing and make sure rendering is smooth. .. py:attribute:: color The color of the text in standard html color notation: FF0000 is red, 00FF00 green, etc. .. py:attribute:: font The family name of the truetype font to use. Font files can either be installed in the system, be in a :file:`fonts/` subdirectory of the current directory, or be in a directory specified using :py:meth:`addFontDir`. To figure out which fonts and variants are available, use the :command:`avg_showfonts.py` utility. .. py:attribute:: fontsize The font size in pixels. Fractional sizes are supported. .. py:attribute:: fontstyle A :py:class:`FontStyle` object that encapsulates all font attributes of the node. As a constructor parameter, this attribute sets the default attributes and other constructor arguments can override these. If set during :py:class:`WordsNode` use, all relevant attributes are set to the new values. .. py:attribute:: hint Whether or not hinting (http://en.wikipedia.org/wiki/Font_hinting) should be used when rendering the text. Unfortunately, this setting does not override the fontconfig settings in :file:`/etc/fonts/conf.d/*-hinting.conf` or other fontconfig configuration files. .. py:attribute:: indent The indentation of the first line of the text. .. py:attribute:: justify Whether each complete line should be stretched to fill the entire width of the layout. Default is false. .. py:attribute:: letterspacing The amount of space between the idividual glyphs of the text in pixels, with 0 being standard spacing and negative values indicating packed text (less letter spacing than normal). Only active when text attribute markup is not being used. .. py:attribute:: linespacing The number of pixels between different lines of a paragraph. Setting this to :samp:`-1` results in default line spacing. .. py:attribute:: rawtextmode Sets whether the text should be parsed to apply markup (:py:const:`False`, default) or interpreted as raw string (:py:const:`True`). .. py:attribute:: text The string to display. If the node is created using xml, this is either the text attribute of the words node or the content of the words node itself. In the second case, the string can be formatted using the pango text attribute markup language described at http://developer.gnome.org/pango/unstable/PangoMarkupFormat.html. Markup can also be used if the text is set using the python attribute. Markup parsing can be turned on or off with :py:attr:`rawtextmode` attribute. .. py:attribute:: variant The variant (:samp:`bold`, :samp:`italic`, etc.) of the font to use. .. py:attribute:: wrapmode Controls at which points text can wrap to the next line. Possible values are :py:const:`word` (split lines at the nearest whitespace, default), :py:const:`char` (split at any position, ignoring word breaks) and :py:const:`wordchar` (split at word boundaries but fall back to char mode if there is no free space for a full word). .. py:method:: getCharIndexFromPos(pos) -> int Returns the index of the character at the coordinates :py:attr:`pos`, or :py:const:`None` if there is no character at that position. :py:attr:`pos` is relative to the node position. Formatting markup such as or is treated as zero chars,
is treated as one char. To get the text matched to this use :py:meth:`getTextAsDisplayed`. .. py:method:: getGlyphPos(i) -> Point2D Returns the position of the glyph at character index :py:attr:`i` in the layout. The position is in pixels relative to the words node. Formatting markup such as or is treated as zero chars,
is treated as one char. .. py:method:: getGlyphSize(i) -> Point2D Returns the size in pixels of the glyph at character index :py:attr:`i` in the layout. Formatting markup such as or is treated as zero chars,
is treated as one char. .. py:method:: getLineExtents(line) -> Point2D Returns the width and height of the specified line in pixels. .. py:method:: getNumLines() -> int Returns the number of lines in the layout. .. py:method:: getTextAsDisplayed Returns the text without text attribute markup language.
is replaced by \\n. .. py:classmethod:: addFontDir Adds a directory to be searched for fonts. May only be called before :py:meth:`Player.play`. .. py:classmethod:: getFontFamilies() -> list Returns a list of strings containing all font names available. .. py:classmethod:: getFontVariants(fontname) -> list Returns a list of available variants (:samp:`Regular`, :samp:`Bold`, etc.) of a font. libavg-1.8.2/sphinxdoc/basenodes.rst000066400000000000000000000413611236127404500174730ustar00rootroot00000000000000Base Node Classes ================= This section describes the base classes for all node classes that libavg provides. .. automodule:: libavg.avg :no-members: .. inheritance-diagram:: Node :parts: 1 To be rendered, a :py:class:`Node` must be part of a scene graph. Scene graphs are trees of :py:class:`Node` objects associated with a :py:class:`Canvas`. A :py:class:`CanvasNode` is at the root of each scene graph. Scene graphs are pure tree structures, so each :py:class:`Node` only has one parent node. Nodes that are not linked to a canvas are not rendered. Any media that these nodes need are loaded from disk, however. libavg :py:class:`Node` classes make heavy use of inheritance. Concepts like :py:attr:`id`, :py:attr:`position` and :py:attr:`opacity` are defined in base classes and can be used in any of the subclasses. .. note:: To reduce redundancy in the reference, inherited methods and attributes are not mentioned in the derived class documentation - follow the link to the base class to access them. This also applies to constructor parameters: When constructing an object of a derived class, constructor parameters of the base classes are also accepted. There are several ways of constructing a node. The reference documentation follows the python constructor syntax. The parameters remain the same in all syntactic variations, however. The options for construction are as follows: **Use the standard python constructor**: Nodes can be created using a standard python constructor. As an example:: node = ImageNode(id="background", href="sunset.png", pos=(0,0), parent=rootNode) Parameters to a node constructor are always named parameters. Nodes never have positional constructor parameters. **Use** :py:meth:`Player.createNode`: There are two ways to create a node using createNode:: node = player.createNode("image", {"id":"background", "href":"sunset.png", "pos":(0,0), "parent":rootNode}) and:: node = player.createNode( """""") Using the second option, complete trees of nodes can be constructed in one statement. **Load it from an avg file**: Complete scene graphs for onscreen display can be loaded from disk using :py:meth:`Player.loadFile`:: root = player.loadFile("scene.avg") **Create a complete scene graph using inline xml**: :py:meth:`Player.loadString` allows using an avg-formatted xml string to create a scene graph of nodes:: root = player.loadString(""" """) The methods :py:meth:`Player.loadFile` and :py:meth:`Player.loadString` create onscreen scene graphs. :py:meth:`Player.loadCanvasFile` and :py:meth:`Player.loadCanvasString` are the equivalent methods for offscreen canvases. .. autoclass:: Node([id: string="", parent: DivNode=None, active=True, sensitive=True, opacity=1.0, style=None]) Base class for everything that can be put into an avg tree. This is an abstract class. **Messages:** All cursor and hover messages are emitted only if the cursor is above the :py:class:`Node` and :py:attr:`active` as well as :py:attr:`sensitive` are True. The message parameters are of type :py:class:`CursorEvent`. The CURSOR messages are emitted for mouse and touch events. The HOVER events are emitted for touch devices which can sense hands approaching the surface before the actual touch. To get these messages, call :py:meth:`Publisher.subscribe`. .. py:method:: CURSOR_DOWN(cursorevent) Emitted whenever a mouse button is pressed or a new touch is registered. .. py:method:: CURSOR_MOTION(cursorevent) Emitted whenever a mouse or a touch moves. .. py:method:: CURSOR_UP(cursorevent) Emitted whenever a mouse button is released or a touch leaves the surface. .. py:method:: CURSOR_OVER(cursorevent) Emitted whenever a mouse or a touch enters the :py:class:`Node`'s area. .. py:method:: CURSOR_OUT(cursorevent) Emitted whenever a mouse or a touch leaves the :py:class:`Node`'s area. .. py:method:: HOVER_DOWN(cursorevent) Emitted whenever a new hover cursor is registered. .. py:method:: HOVER_MOTION(cursorevent) Emitted whenever a hover cursor moves. .. py:method:: HOVER_UP(cursorevent) Emitted whenever a hover cursor disappears. .. py:method:: HOVER_OVER(cursorevent) Emitted whenever a hover cursor enters the :py:class:`Node`'s area. .. py:method:: HOVER_OUT(cursorevent) Emitted whenever a hover cursor leaves the :py:class:`Node`'s area. .. py:method:: SIZE_CHANGED(newSize) Emitted whenever the size of the node changes. This includes any python calls that change the size. In addition, image loading (for :py:class:`ImageNode`), opening of video files (for :py:class:`VideoNode`) and changes in the text displayed (in the case of :py:class:`WordsNode`) can trigger :py:meth:`SIZE_CHANGED` messages. Note that changing the size of a node inside a :py:meth:`SIZE_CHANGED` handler will lead to an additional recursive invocation of :py:meth:`SIZE_CHANGED`. :py:class:`RectNode` and all classes derived from :py:class:`AreaNode` support this message. .. py:attribute:: id A unique identifier that can be used to reference the node, for instance using :py:meth:`Player.getElementByID`. Read-only. .. py:attribute:: parent A :py:class:`DivNode` that the node will become a child of. When used as a constructor parameter, this is equivalent to calling :py:meth:`DivNode.appendChild` directly after construction. Read-only. .. py:attribute:: active If this attribute is true, the node behaves as usual. If not, it is neither drawn nor does it react to events. .. py:attribute:: opacity A measure of the node's transparency. 0.0 is completely transparent, 1.0 is completely opaque. Opacity is relative to the parent node's opacity. .. py:attribute:: sensitive A node only reacts to events if sensitive is true. .. py:method:: connectEventHandler(type, source, pyobj, pyfunc) .. deprecated:: 1.8 Use the message interface instead. Sets a callback function that is invoked whenever an event of the specified type from the specified source occurs. Unlike :py:meth:`setEventHandler`, this method allows several handlers for one type/source-combination. To remove a handler installed using :py:meth:`connectEventHandler`, call :py:meth:`disconnectEventHandler`. :param type: One of the event types :py:const:`KEYUP`, :py:const:`KEYDOWN`, :py:const:`CURSORMOTION`, :py:const:`CURSORUP`, :py:const:`CURSORDOWN`, :py:const:`CURSOROVER` or :py:const:`CURSOROUT`. :param source: :py:const:`MOUSE` for mouse events, :py:const:`TOUCH` for multitouch touch events, :py:const:`TRACK` for multitouch track events or other tracking, :py:const:`NONE` for keyboard events. Sources can be or'ed together to set a handler for several sources at once. :param pyobj: The python object that hosts the callback. This parameter is only needed so that :py:meth:`disconnectEventHandler` can be called to remove all handlers hosted by one object in one call. :param pyfunc: The python callable to invoke. This callable must take the event to process as a parameter. In contrast to callbacks set up using :py:meth:`setEventHandler`, it should not return anything. If :py:meth:`connectEventHandler` is used, all events bubble up the tree. pyfunc may not be :py:const:`None`. .. py:method:: disconnectEventHandler(pyobj, [pyfunc]) .. deprecated:: 1.8 Use the message interface instead. Removes one or more event handlers from the node's table of event handlers. If several event handlers conform to the parameters given, all are removed. It is an error if no matching event handler exists. :param pyobj: The python object that hosts the event handler. :param pyfunc: The python callable that should not be called anymore. If pyfunc is absent, all callbacks hosted by :py:attr:`pyobj` are removed. .. py:method:: getAbsPos(relpos) -> Point2D Transforms a position in coordinates relative to the node to a position in window coordinates. .. py:method:: getElementByPos(pos) -> Node Returns the topmost child node that is at the position given. :py:attr:`pos` is in coordinates relative to the called node. The algorithm used is the same as the cursor hit test algorithm used for events. .. py:method:: getParent() -> Node .. deprecated:: 1.8 Use :attr:`parent` instead. Returns the container (:py:class:`AVGNode` or :py:class:`DivNode`) the node is in. For the root node (or if the node is not connected), returns :py:const:`None`. .. py:method:: getRelPos(abspos) -> Point2D Transforms a position in window coordinates to a position in coordinates relative to the node. .. py:method:: registerInstance(self, parent) Needs to be called when deriving from a Node class in python in the derived classes :py:meth:`__init__` method. .. py:method:: releaseEventCapture([cursorid]) Restores normal cursor event handling after a call to :py:meth:`setEventCapture()`. :py:attr:`cursorid` is the id of the cursor to release. If :py:attr:`cursorid` is not given, the mouse cursor is used. .. py:method:: setEventCapture([cursorid]) Sets up event capturing so that cursor events are sent to this node regardless of the cursor position. cursorid is optional; if left out, the mouse cursor is captured. If not, events from a specific tracker cursor are captured. The event propagates to the capturing node's parent normally. This function is useful for the implementation of user interface elements such as scroll bars. Only one node can capture a cursor at any one time. Normal operation can be restored by calling :py:meth:`releaseEventCapture()`. .. py:method:: setEventHandler(type, source, pyfunc) .. deprecated:: 1.7 Use the message interface instead. Sets a callback function that is invoked whenever an event of the specified type from the specified source occurs. This method removes all other event handlers from this type/source-combination. :param type: One of the event types :py:const:`KEYUP`, :py:const:`KEYDOWN`, :py:const:`CURSORMOTION`, :py:const:`CURSORUP`, :py:const:`CURSORDOWN`, :py:const:`CURSOROVER` or :py:const:`CURSOROUT`. :param source: :py:const:`MOUSE` for mouse events, :py:const:`TOUCH` for multitouch touch events, :py:const:`TRACK` for multitouch track events or other tracking, :py:const:`NONE` for keyboard events. Sources can be or'ed together to set a handler for several sources at once. :param pyfunc: The python callable to invoke. This callable must take the event to process as a parameter. If pyfunc returns :py:const:`None` or :py:const:`False`, the event bubbles up the node tree. If it is :py:const:`True`, bubbling is suppressed. If pyfunc is :py:const:`None`, the previous handler is removed. .. py:method:: unlink([kill=False]) Removes a node from its parent container and optionally deletes all resources the node holds. In the default case, :py:meth:`unlink` is equivalent to :samp:`node.getParent().removeChild(node.getParent().indexOf(node))`, except that if the node has no parent, unlink does nothing. Also in the default case, textures are moved back to the CPU and event handlers are preserved. If :samp:`kill=True`, textures are not moved back. Event handlers for events routed to this node are reset, all textures are deleted and the href is reset to empty in this case, saving some time and making sure there are no references to the node left on the libavg side. :py:attr:`kill` should always be set to :py:const:`True` if the node will not be used after the unlink. .. autoclass:: Publisher() libavg supports event handling and callbacks through a publish/subscribe interface. :py:class:`Publisher` is the base class for all classes that send messages. Derived classes can send messages of arbitrary types. The base class takes care of managing a list of subscribers for each message type and sending the message to each subscriber. Many libavg classes, including :py:class:`Node`, :py:class:`Player`, :py:class:`Contact` and the :py:class:`Recognizer` classes derive from publisher. In addition, it is possible to derive from :py:class:`Publisher` in client code by calling the methods in the protected interface. .. py:method:: subscribe(messageID, callable) -> int Registers a subscriber for the given :py:attr:`messageID`. The :py:attr:`callable` for all subscribers is invoked whenever the publisher sends out the message with this ID. :py:meth:`subscribe` returns a :py:attr:`subscriberID` that can be used to unsubscribe if this becomes necessary. The subscription is also terminated if either the publisher or the subscriber is deleted. The :py:class:`Publisher` class works with weak references to subscribers when possible, so this should happen automatically in most cases. The exception is when :py:attr:`callable` is an anonymous function (a lambda expression). In this case, the :py:class:`Publisher` needs to hold a reference to the callable to keep it from being deleted immediately and :py:meth:`unsubscribe` needs to be called manually. .. py:method:: unsubscribe(messageID, subscriberID) unsubscribe(messageID, callable) Removes a subscriber from the list of subscribers for :py:attr:`messageID`. The subscriber is either determined by the :py:attr:`subscriberID` returned from :py:meth:`subscribe` or by the :py:attr:`callable` attached to the subscription. **Protected Interface:** To be called from derived classes. .. py:method:: publish(messageID) Registers a :py:attr:`messageID` so that interested parties can subscribe to this message. .. py:method:: notifySubscribers(messageID, argsList) Invokes all callables registered for this :py:attr:`messageID` using the list of args passed. Subscribers are called synchronously; the order of invokation is undefined. libavg-1.8.2/sphinxdoc/conf.py000066400000000000000000000162411236127404500162740ustar00rootroot00000000000000# -*- coding: utf-8 -*- # # libavg documentation build configuration file, created by # sphinx-quickstart on Sun Nov 14 22:21:44 2010. # # This file is execfile()d with the current directory set to its containing dir. # # Note that not all possible configuration values are present in this # autogenerated file. # # All configuration values have a default; values that are commented out # serve to show the default. import sys # If extensions (or modules to document with autodoc) are in another directory, # add these directories to sys.path here. If the directory is relative to the # documentation root, use os.path.abspath to make it absolute, like shown here. #sys.path.insert(0, os.path.abspath('.')) # -- General configuration ----------------------------------------------------- # If your documentation needs a minimal Sphinx version, state it here. #needs_sphinx = '1.0' # Add any Sphinx extension module names here, as strings. They can be extensions # coming with Sphinx (named 'sphinx.ext.*') or your custom ones. extensions = ['sphinx.ext.autodoc', 'sphinx.ext.pngmath', 'sphinx.ext.coverage', 'sphinx.ext.graphviz', 'sphinx.ext.inheritance_diagram'] # Add any paths that contain templates here, relative to this directory. templates_path = ['_templates'] # The suffix of source filenames. source_suffix = '.rst' # The encoding of source files. #source_encoding = 'utf-8-sig' # The master toctree document. master_doc = 'index' # General information about the project. project = u'libavg' copyright = u'2010, Ulrich von Zadow' # The version info for the project you're documenting, acts as replacement for # |version| and |release|, also used in various other places throughout the # built documents. # # The short X.Y version. version = '1.7' # The full version, including alpha/beta/rc tags. release = '1.7.svn' # The language for content autogenerated by Sphinx. Refer to documentation # for a list of supported languages. #language = None # There are two options for replacing |today|: either, you set today to some # non-false value, then it is used: #today = '' # Else, today_fmt is used as the format for a strftime call. #today_fmt = '%B %d, %Y' # List of patterns, relative to source directory, that match files and # directories to ignore when looking for source files. exclude_patterns = ['_build'] # The reST default role (used for this markup: `text`) to use for all documents. #default_role = None # If true, '()' will be appended to :func: etc. cross-reference text. #add_function_parentheses = True # If true, the current module name will be prepended to all description # unit titles (such as .. function::). #add_module_names = True # If true, sectionauthor and moduleauthor directives will be shown in the # output. They are ignored by default. #show_authors = False # The name of the Pygments (syntax highlighting) style to use. pygments_style = 'sphinx' # A list of ignored prefixes for module index sorting. #modindex_common_prefix = [] # -- Autodoc options ----------------------------------------------------------- autodoc_member_order = 'groupwise' autodoc_default_flags = ['members', 'show-inheritance'] # -- Options for HTML output --------------------------------------------------- # The theme to use for HTML and HTML Help pages. See the documentation for # a list of builtin themes. html_theme = 'sphinxdoc' # Theme options are theme-specific and customize the look and feel of a theme # further. For a list of options available for each theme, see the # documentation. #html_theme_options = {} # Add any paths that contain custom themes here, relative to this directory. #html_theme_path = [] # The name for this set of Sphinx documents. If None, it defaults to # " v documentation". #html_title = None # A shorter title for the navigation bar. Default is the same as html_title. #html_short_title = None # The name of an image file (relative to this directory) to place at the top # of the sidebar. #html_logo = None # The name of an image file (within the static path) to use as favicon of the # docs. This file should be a Windows icon file (.ico) being 16x16 or 32x32 # pixels large. #html_favicon = None # Add any paths that contain custom static files (such as style sheets) here, # relative to this directory. They are copied after the builtin static files, # so a file named "default.css" will overwrite the builtin "default.css". html_static_path = ['_static'] # If not '', a 'Last updated on:' timestamp is inserted at every page bottom, # using the given strftime format. #html_last_updated_fmt = '%b %d, %Y' # If true, SmartyPants will be used to convert quotes and dashes to # typographically correct entities. #html_use_smartypants = True # Custom sidebar templates, maps document names to template names. #html_sidebars = {} # Additional templates that should be rendered to pages, maps page names to # template names. #html_additional_pages = {} # If false, no module index is generated. #html_domain_indices = True # If false, no index is generated. #html_use_index = True # If true, the index is split into individual pages for each letter. #html_split_index = False # If true, links to the reST sources are added to the pages. #html_show_sourcelink = True # If true, "Created using Sphinx" is shown in the HTML footer. Default is True. #html_show_sphinx = True # If true, "(C) Copyright ..." is shown in the HTML footer. Default is True. #html_show_copyright = True # If true, an OpenSearch description file will be output, and all pages will # contain a tag referring to it. The value of this option must be the # base URL from which the finished HTML is served. #html_use_opensearch = '' # This is the file name suffix for HTML files (e.g. ".xhtml"). #html_file_suffix = None # Output file base name for HTML help builder. htmlhelp_basename = 'libavgdoc' # -- Options for LaTeX output -------------------------------------------------- # The paper size ('letter' or 'a4'). #latex_paper_size = 'letter' # The font size ('10pt', '11pt' or '12pt'). #latex_font_size = '10pt' # Grouping the document tree into LaTeX files. List of tuples # (source start file, target name, title, author, documentclass [howto/manual]). latex_documents = [ ('index', 'libavg.tex', u'libavg Documentation', u'Ulrich von Zadow', 'manual'), ] # The name of an image file (relative to this directory) to place at the top of # the title page. #latex_logo = None # For "manual" documents, if this is true, then toplevel headings are parts, # not chapters. #latex_use_parts = False # If true, show page references after internal links. #latex_show_pagerefs = False # If true, show URL addresses after external links. #latex_show_urls = False # Additional stuff for the LaTeX preamble. #latex_preamble = '' # Documents to append as an appendix to all manuals. #latex_appendices = [] # If false, no module index is generated. #latex_domain_indices = True # -- Options for manual page output -------------------------------------------- # One entry per manual page. List of tuples # (source start file, name, description, authors, manual section). man_pages = [ ('index', 'libavg', u'libavg Documentation', [u'Ulrich von Zadow'], 1) ] inheritance_graph_attrs = dict(rankdir="TB") libavg-1.8.2/sphinxdoc/events.rst000066400000000000000000000366541236127404500170450ustar00rootroot00000000000000Input Handling ============== .. automodule:: libavg.avg :no-members: .. inheritance-diagram:: Event CursorEvent MouseEvent TouchEvent KeyEvent :parts: 1 .. inheritance-diagram:: Contact :parts: 1 .. inheritance-diagram:: InputDevice :parts: 1 .. autoclass:: Contact A Contact encapsulates the information of one touch on an input device from the down event to an up event. It exposes some aggregate information about the touch - distance and direction travelled etc. - and supports event handlers that are only called for this single contact. For compatibility reasons, a mouse device also produces contacts. A mouse contact exists from the press of a button to its release. If multiple buttons are pressed without a complete release (e.g. LEFTDOWN-RIGHTDOWN-LEFTUP-RIGHTUP), the mouse contact exists for the complete sequence. **Messages:** All message parameters are of type :py:class:`CursorEvent`. To get these messages, call :py:meth:`Publisher.subscribe`. All subscribers are unsubscribed automatically after the up event. .. py:method:: CURSOR_MOTION(cursorevent) Emitted whenever the contact moves. .. py:method:: CURSOR_UP(cursorevent) Emitted when the mouse button is released or the touch leaves the surface. .. py:attribute:: age Time that has passed since the down event in milliseconds. Read-only. .. py:attribute:: distancefromstart Distance of the current position from the initial position in pixels. Read-only. .. py:attribute:: distancetravelled The total distance travelled since the initial down event. Read-only. .. py:attribute:: events An array containing all events that this contact has generated in the past. Read-only. .. py:attribute:: id A numerical id for this contact. This corresponds to the :py:attr:`CursorEvent.cursorid` field. Contacts for touch events have unique ids, while contacts for mouse events always have the :py:attr:`id` :py:const:`-1`. ids are not reused. Read-only. .. py:attribute:: motionangle Angle of the current position from the initial position in radians. Like all angles in libavg, :py:attr:`motionangle` is 0 on the positive x axis and increases clockwise. Read-only. .. py:attribute:: motionvec The difference of the current position and the initial position as a :py:class:`Point2D`. Read-only. .. py:method:: connectListener(motionCallback, upCallback) -> id .. deprecated:: 1.8 Use the message interface instead. Registers event handlers that get called when CURSORMOTION and CURSORUP events for this :py:class:`Contact` occur. Event handlers can be unregistered using :py:meth:`disconnectListener`. They are automatically unregistered after the up event. The :py:attr:`id` returned is unique for this contact. .. py:method:: disconnectListener(id) .. deprecated:: 1.8 Use the message interface instead. Unregisters an event handler. The parameter is the :py:attr:`id` returned in :py:meth:`connectListener`. It is an error to call :py:meth:`disconnectListener` with an invalid id. .. autoclass:: CursorEvent Base class for all events which contain a position in the global coordinate system. .. py:attribute:: contact The :py:class:`Contact` that the event belongs to, if there is one. Read-only. .. py:attribute:: cursorid A numerical identifier for the current cursor. .. py:attribute:: node The :py:class:`Node` that the event occured in. If this is :py:const:`None`, the event happened outside of the application window and the cursor was captured by the application. Read-only. .. py:attribute:: pos Position in the global coordinate system. Read-only. .. py:attribute:: source The type of the device that emitted the event. See :py:attr:`Event.source`. Read-only. .. py:attribute:: x x position in the global coordinate system. Read-only. .. py:attribute:: y y position in the global coordinate system. Read-only. .. autoclass:: Event(type, source, [when]) Base class for user input events. :param type type: The type of the event. See :py:attr:`Event.type`. :param source source: The source of the event. See :py:attr:`Event.source`. :param Integer when: The time the event occured .. py:attribute:: inputdevice The address of the device that emitted the event. Read-only .. py:attribute:: inputdevicename The name of the device that emitted the event. Read-only. .. py:attribute:: source One of :py:const:`MOUSE`, :py:const:`TOUCH`, :py:const:`TRACK`, :py:const:`CUSTOM` or :py:const:`NONE`. Read-only .. py:attribute:: type One of :py:const:`KEYUP`, :py:const:`KEYDOWN`, :py:const:`CURSORMOTION`, :py:const:`CURSORUP`, :py:const:`CURSORDOWN`, :py:const:`CURSOROVER` or :py:const:`CURSOROUT`. Read-only. .. py:attribute:: when The time when the event occured in milliseconds since program start. Read-only. .. autoclass:: InputDevice(name, [eventReceiverNode]) Base class for input devices which feed events to the system. Derived classes can be either user-defined or one of the predefined libavg input devices. User-defined InputDevice objects are registered with the system by calling :py:meth:`Player.addInputDevice`. After this, the emitted events are processed like any other events. .. py:attribute:: eventreceivernode The :py:class:`DivNode` that the input device will deliver events to. By default, this is the libavg root node. Useful for restricting events to a part of the total canvas or for sending events directly to an offscreen canvas. Event bubbling starts at this node and proceeds down the tree from there. Read-only. .. py:attribute:: name The name of the device. Read-only. .. py:method:: pollEvents() -> list Abstract method which returns a list of pending events. Override this method in your derived input device class. After registering the input device, this method gets called on every frame. .. py:method:: start() Initializes the input device if needed. By default this is an empty method. .. autoclass:: KeyEvent Generated when a key is pressed or released. .. py:attribute:: keycode The keycode of the key according to US keyboard layout. Read-only. .. py:attribute:: keystring A character or word describing the key pressed. Read-only. .. py:attribute:: modifiers Any modifier keys pressed, or'ed together. Possible Modifiers are :py:const:`KEYMOD_NONE`, :py:const:`KEYMOD_LSHIFT`, :py:const:`KEYMOD_RSHIFT`, :py:const:`KEYMOD_LCTRL`, :py:const:`KEYMOD_RCTRL`, :py:const:`KEYMOD_LALT`, :py:const:`KEYMOD_RALT`, :py:const:`KEYMOD_LMETA`, :py:const:`KEYMOD_RMETA`, :py:const:`KEYMOD_NUM`, :py:const:`KEYMOD_CAPS`, :py:const:`KEYMOD_MODE`. Read-only. .. py:attribute:: scancode The untranslated (hardware-dependent) scancode of the key pressed. Read-only. .. py:attribute:: unicode Unicode index of the character. Takes into account the current keyboard layout and any modifiers pressed. This attribute is only filled in the :py:const:`KEYDOWN` event. Read-only. .. autoclass:: MouseEvent(type, leftButtonState, middleButtonState, rightButtonState, pos, button, [speed, when]) Generated when a mouse-related event occurs. .. py:attribute:: button The button that caused the event. Read-only. .. py:attribute:: cursorid Always :samp:`-1` for mouse events, but can be used to handle mouse and tracking events in one handler. Read-only. .. py:attribute:: leftbuttonstate :py:const:`True` if the left mouse button is currently pressed. Read-only. .. py:attribute:: middlebuttonstate :py:const:`True` if the middle mouse button is currently pressed. Read-only. .. py:attribute:: rightbuttonstate :py:const:`True` if the right mouse button is currently pressed. Read-only. .. py:attribute:: source Always :py:const:`MOUSE`. Read-only .. py:attribute:: speed Current speed of the mouse in pixels per millisecond as a :py:class:`Point2D`. Read-only. .. autoclass:: TouchEvent(id, type, pos, source, [speed]) Generated when a touch or other tracking event occurs. Touch events happen only when a multi-touch sensitive surface or other camera tracker is active. .. py:attribute:: area Size of the blob found in pixels. Read-only. .. py:attribute:: center Position as :py:class:`Point2D`, with sub-pixel accuracy. Used for calibration. Read-only. .. py:attribute:: cursorid An identifier for the current touch. A single touch will generate a down, zero or more motion and a single up event in its lifetime, all with the same :py:attr:`cursorid`. .. py:attribute:: eccentricity .. py:attribute:: handorientation The angle of the hand relative to the finger. :py:attr:`handorientation` is only defined for events with :py:attr:`source`=:py:const:`TOUCH`. If the tracker has detected a hovering hand attached to the finger, this is the actual hand-finger angle. If no hand was detected, the angle is approximated using the position of the touch on the surface. :py:attr:`handorientation` ranges from :py:const:`-pi` to :py:const:`pi`, with 0 being the positive x axis. Angles increase in a clockwise fashion. For :py:const:`CURSORUP` events, the angle is always approximated. .. py:attribute:: majoraxis Major axis of an ellipse that is similar to the blob. Read-only. .. py:attribute:: minoraxis Minor axis of an ellipse that is similar to the blob. Read-only. .. py:attribute:: orientation Angle of the blob in radians. For hovering hands, this is roughly the direction of the hand, modulo 180 degrees. Read-only. .. py:attribute:: source :py:attr:`source` can be either :py:const:`TRACK` or :py:const:`TOUCH`. In most cases, actual touches will generate :py:const:`TOUCH` events. When used with a DI device, the internal tracker also generates :py:const:`TRACK` events for hands above the surface. When used with an FTIR device, the internal tracker generates :py:const:`TRACK` events for the actual touches. Read-only. .. py:attribute:: speed Current speed of the touch in pixels per millisecond as a :py:class:`Point2D`. Read-only. .. py:method:: getContour() -> list Returns the contour of the blob as a list of points if supported by the tracker being used. .. py:method:: getRelatedEvents() -> events Only for DI devices and the internal tracker: Returns a python tuple containing the events 'related' to this one. For :py:const:`TOUCH` events (fingers), the tuple contains one element: the corresponding :py:const:`TRACK` event (hand). For :py:const:`TRACK` events, the tuple contains all :py:const:`TOUCH` events that belong to the same hand. .. autoclass:: Tracker A class that uses a camera to track moving objects and delivers the movements as avg events. Create a tracker by using :py:meth:`Player.enableMultitouch()` with :samp:`AVG_MULTITOUCH_DRIVER=TRACKER`. The properties of this class are explained under https://www.libavg.de/wiki/ProgrammersGuide/Tracker. .. py:method:: abortCalibration() Aborts coordinate calibration session and restores the previous coordinate transformer. .. py:method:: endCalibration() Ends coordinate calibration session and activates the coordinate transformer generated. .. py:method:: getDisplayROIPos() .. py:method:: getDisplayROISize() .. py:method:: getImage(imageid) -> Bitmap Returns one of the intermediate images necessary for tracking. These images are only available if setDebugImages was called before with appropriate parameters. Possible :py:attr:`imageid` values are :py:const:`IMG_CAMERA`, :py:const:`IMG_DISTORTED`, :py:const:`IMG_NOHISTORY`, :py:const:`IMG_HISTOGRAM`, :py:const:`IMG_FINGERS` or :py:const:`IMG_HIGHPASS`. .. py:method:: getParam(element) -> value Returns a tracker configuration parameter. .. py:method:: resetHistory() Throws away the current history image and generates a new one from the next second of images. .. py:method:: saveConfig() Saves the current tracker configuration to the default config file. .. py:method:: setDebugImages(img, finger) Controls whether debug images of intermediate tracking results and detected finger positions are generated and exported to python. Generating the debug images takes a moderate amount of time, so it is turned off by default. :param img: Whether to generate intermediate result images. :param finger: Whether to generate the :py:const:`IMG_FINGERS` result image. .. py:method:: setParam(element, value) Sets one of the tracker configuration parameters. .. py:method:: startCalibration(displayextents) -> TrackerCalibrator Starts coordinate calibration session. The returned :py:class:`TrackerCalibrator` exists until :py:meth:`endCalibration` or :py:meth:`abortCalibration` is called. :param displayextents: The width and height of the display area. .. autoclass:: TrackerCalibrator Generates a mapping of display points to camera points using a set of reference points. Python code should display reference points that the user must touch to establish a mapping. Created by :py:meth:`Tracker.startCalibration`. .. py:method:: getDisplayPoint() -> Point2D .. py:method:: nextPoint() -> bool Advances to the next point. Returns :py:const:`False` and ends calibration if all points have been set. .. py:method:: setCamPoint(pos) libavg-1.8.2/sphinxdoc/fx.rst000066400000000000000000000120571236127404500161450ustar00rootroot00000000000000Effect Nodes ============ .. automodule:: libavg.avg :no-members: .. inheritance-diagram:: BlurFXNode ChromaKeyFXNode HueSatFXNode InvertFXNode NullFXNode ShadowFXNode :parts: 1 .. autoclass:: BlurFXNode(radius=1.0) Blurs the node it is applied to. Corresponds to the Gaussian Blur effect in Photoshop. Not supported under minimal shaders. Programs can call :py:meth:`Player.areFullShadersSupported` to ensure support. .. py:attribute:: radius The width of the blur. This corresponds to the radius parameter of photoshop. .. autoclass:: ChromaKeyFXNode Chroma keying is the process of removing a uniformly colored background from an image. The background is then replaced with a different image or video. Actors are filmed in front of a blue- or green-colored background and chroma keying is used to insert a different background. The :py:class:`ChromaKeyFXNode` implements a high-quality realtime chroma key (greenscreen or bluescreen) effect. It replaces all pixels that are similar to a configured key color with transparency and can account for noise in the background area as well as remove color spill from the background to the foreground. All of the parameters can be manipulated for test purposes using the :program:`avg_chromakey.py` script. The effect is carried out in the HSL colorspace (http://en.wikipedia.org/wiki/HSL_and_HSV). Not supported under minimal shaders. Programs can call :py:meth:`Player.areFullShadersSupported` to ensure support. .. py:attribute:: color The color to key out. Pixels of this and similar colors are made transparent. .. py:attribute:: erosion Removes single non-keyed-out pixels in larger transparent areas. Values > 1 remove larger areas. Useful for removing camera noise. .. py:attribute:: htolerance Hue tolerance for the key color. .. py:attribute:: ltolerance Lightness tolerance for the key color. .. py:attribute:: softness :py:attr:`softness` > 0 causes pixels with a color close to the keyed-out colors to become partially transparent. Greater values increase this effect. .. py:attribute:: spillthreshold Often, people in greenscreen studios aquire a greenish tint. Spill removal works against this by desaturating pixels that are close to the key color. Larger values cause more desaturation. .. py:attribute:: stolerance Saturation tolerance for the key color. .. autoclass:: FXNode Base class for GPU-based effects. These effects can be added to any :py:class:`RasterNode` by calling :py:meth:`RasterNode.setEffect`. .. autoclass:: HueSatFXNode(hue=0.0, saturation=0.0, lightness=0.0, colorize=False) Color correction filter that works by converting pixels to the hsl color space (http://en.wikipedia.org/wiki/HSL_and_HSV), changing the values there and converting back to rgb. Can be used to change hue, saturation and lightness of a node. Corresponds to the Photoshop Hue/Saturation dialog. .. py:attribute:: colorize If :py:attr:`colorize` is :py:const:`True`, all colors will be tinted according to the current :py:attr:`hue` value. Otherwise, :py:attr:`hue` is treated as a difference value. .. py:attribute:: hue Used to get/set the color angle in degrees. Effective values are 0..360 or -180..180, depending on the :py:attr:`colorize` value. .. py:attribute:: lightness Set :py:attr:`lightness` offset. Adds a per pixel offset in brightness. Values range from -100 to 100, with -100 being very dark and 100 very bright. .. py:attribute:: saturation Set :py:attr:`saturation` of Node. In :py:attr:`colorize` mode, this is the overall image saturation in the range 0..100, with 0 being greyscale and 100 very oversaturated. If :py:attr:`colorize` is false, the attribute is an offset from -100 to 100. .. autoclass:: InvertFXNode Color Invert Effect. Inverts the brightness of nodes that it is attached to. .. autoclass:: NullFXNode Do-nothing effect. Exists primarily as aid in debugging libavg. .. autoclass:: ShadowFXNode(offset=(0,0), radius=1.0, opacity=1.0, color="FFFFFF") Adds a shadow behind the node. Not supported under minimal shaders. Programs can call :py:meth:`Player.areFullShadersSupported` to ensure support. .. py:attribute:: offset An adjustment to the shadow's position behind the node in pixels. .. py:attribute:: radius The blur radius of the shadow. .. py:attribute:: opacity The opacity of the shadow. .. py:attribute:: color The shadow color. libavg-1.8.2/sphinxdoc/gesture.rst000066400000000000000000000327021236127404500172050ustar00rootroot00000000000000Gesture Support =============== The namespace libavg.gesture exposes a group of configurable gesture recognizers. .. automodule:: libavg.gesture :no-members: .. inheritance-diagram:: DragRecognizer SwipeRecognizer TapRecognizer TransformRecognizer DoubletapRecognizer HoldRecognizer :parts: 1 .. inheritance-diagram:: Transform :parts: 1 .. autoclass:: DoubletapRecognizer(node, [maxTime=MAX_DOUBLETAP_TIME, maxDist=MAX_TAP_DIST, initialEvent=None, possibleHandler=None, failHandler=None, detectedHandler=None]) A :py:class:`DoubletapRecognizer` detects doubletaps: Two short touches in quick succession without a large change of the cursor position. :param maxTime: The maximum time that each phase of the tap may take. :param maxDist: The maximum distance the contact may move in millimeters. .. autoclass:: DragRecognizer(eventNode, [coordSysNode=None, initialEvent=None, direction=ANY_DIRECTION, directionTolerance=DIRECTION_TOLERANCE, friction=-1, minDragDist=None, possibleHandler=None, failHandler=None, detectedHandler=None, moveHandler=None, upHandler=None, endHandler=None]) A :py:class:`DragRecognizer` attaches itself to a node's cursor events and delivers higher-level callbacks that can be used to implement dragging or drag-like functionality. :py:class:`DragRecognizer` supports inertia after the node is released. :param avg.Node coordSysNode: Used to determine the coordinate system for the offsets returned by the callbacks. If :py:attr:`coordSysNode` is not given, :py:attr:`eventNode` is used as default. The :py:class:`DragRecognizer` never modifies any nodes itself. :py:attr:`coordSysNode` can be used to separate the node that is the 'handle' for the events from the node that is being moved - for instance, to allow moving a window by dragging the title bar. :param direction: Can be used to constrain the recognizer to :py:const:`VERTICAL` or :py:const:`HORIZONTAL` drags only. If one of these constants is passed as :py:attr:`direction`, the recognizer invokes :py:meth:`onPossible` when the down event arrives, then determines whether the drag is a predominantly horizontal or vertical drag and invokes either :py:meth:`onDetected` or :py:meth:`onFail` depending on the result. :param float directionTolerance: A tolerance angle in radians for the detection of horizontal and vertical drags. :param avg.Node eventNode: The node to attach to. The :py:class:`DragRecognizer` registers an event handler to react to any contacts for this node. :param float friction: If set, this parameter enables inertia processing. It describes how quickly the drag comes to a stop after the cursor is released. :param float minDragDist: Minimum distance in mm that the cursor must move for the recognizer to switch from :py:const:`POSSIBLE` to :py:const:`DETECTED`. Default is either 0 (for :py:const:`ANY_DIRECTION` recognizers) or :py:const:`MIN_DRAG_DIST` (for constrained recognizers). :param moveHandler: A shortcut for :samp:`Recognizer.subscribe(Recognizer.MOTION, moveHandler)`. :param upHandler: A shortcut for :samp:`Recognizer.subscribe(Recognizer.UP, upHandler)`. **Messages:** To get these messages, call :py:meth:`Publisher.subscribe`. .. py:method:: Recognizer.MOTION(offset) Emitted when the drag should cause a position change. This usually happens in response to a :py:const:`CURSORMOTION` event, but may also happen because of inertia. :param avg.Point2D offset: The current offset from the start of the drag in coordinates relative to the :py:attr:`coordSysNode`'s parent. .. py:method:: Recognizer.UP(offset) Emitted when the cursor is released. If inertia is enabled, there may be move events after the up event. :param avg.Point2D offset: The current offset from the start of the drag in coordinates relative to the :py:class:`coordSysNode`'s parent. .. py:method:: abort() Aborts the present recognized gesture and sliding caused by inertia .. autoclass:: HoldRecognizer(node, [delay=HOLD_DELAY, maxDist=MAX_TAP_DIST, initialEvent=None, possibleHandler=None, failHandler=None, detectedHandler=None, stopHandler=None]) A :py:class:`HoldRecognizer` detects if a touch is held for a certain amount of time. Holds are continuous events: the :py:meth:`stopHandler` is called when the contact up event arrives. :param delay: The amount of time that has to pass before the hold is recognized. :param maxDist: The maximum distance the contact may move in millimeters. .. autoclass:: Recognizer(node, isContinuous, maxContacts, initialEvent[, possibleHandler=None, failHandler=None, detectedHandler=None, endHandler=None]) Base class for gesture recognizers that attach to a node's cursor events and emit higher-level events. Gesture recognizers have a standard set of states and callbacks, but derived classes may add their own callbacks and do not need to invoke all base class callbacks. The possible states vary depending on the value of :py:attr:`isContinuous`: .. image:: Recognizer.png A usage example for the recognizers can be found under :samp:`src/samples/gestures.py`. Many of the recognizers have default timeouts and distance limits which can be changed by modifying :file:`avgrc`. The sample file under :file:`src/avgrc` contains explanations. :param Node node: Node to attach to. :param bool isContinuous: :py:const:`True` if the gesture stays active after it has been detected. :param maxContacts: The maximum number of contacts that the recognizer should handle. :py:const:`None` if there is no maximum. :param initialEvent: A cursordown event to pass to the recognizer immediately. :param possibleHandler: A shortcut for :samp:`Recognizer.subscribe(Recognizer.POSSIBLE, possibleHandler)`. :param failHandler: A shortcut for :samp:`Recognizer.subscribe(Recognizer.FAIL, failHandler)`. :param detectedHandler: A shortcut for :samp:`Recognizer.subscribe(Recognizer.DETECTED, detectedHandler)`. :param endHandler: A shortcut for :samp:`Recognizer.subscribe(Recognizer.END, endHandler)`. **Messages:** Gesture recognizers emit messages whenever they change state - see the state diagrams above. The messages have a parameter of type :py:class:`CursorEvent`. To get these messages, call :py:meth:`Publisher.subscribe`. .. py:method:: POSSIBLE() Emit when gesture recognition begins - usually after a cursordown event. Some continuous gestures (such as unconstrained drags) never emit :py:meth:`POSSIBLE` but emit :py:meth:`DETECTED` immediately. .. py:method:: FAILED() Emitted when gesture recognition is rejected. For instance, in the case of a :py:class:`DoubleTapRecognizer`, a :py:meth:`FAILED` message is emitted if the touch stays on the surface for too long. .. py:method:: DETECTED() Emitted when the gesture is recognized. For discrete gestures, this signifies the end of gesture processing. .. py:method:: END() Emitted when a continuous gesture ends. This is often a result of an up event, but e.g. in the case of inertia, :py:meth:`END` is emitted when movement stops. .. py:attribute:: contacts List of all contacts detected by the :py:class:`Recognizer`. .. py:method:: abort() Aborts the present recognized gesture. .. py:method:: enable(isEnabled) Enables or disables the :py:class:`Recognizer`. .. py:method:: getState() -> String Returns the state ("IDLE", "POSSIBLE" or "RUNNING") of the recognizer. .. autoclass:: SwipeRecognizer(node, direction, [numContacts=1, directionTolerance=SWIPE_DIRECTION_TOLERANCE, minDist=MIN_SWIPE_DIST, maxContactDist=MAX_SWIPE_CONTACT_DIST, initialEvent=None, possibleHandler=None, failHandler=None, detectedHandler=None]) A :py:class:`SwipeRecognizer` detects movement of one or more contacts in a specified direction and with a minimal distance. Whether the gesture is recognized is determined when an up event occurs. :param direction: One of :py:const:`SwipeRecognizer.UP`, :py:const:`DOWN`, :py:const:`LEFT` or :py:const:`RIGHT`. :param numContacts: The minimum number of contacts for the swipe. :param directionTolerance: Maximum deviation from the ideal direction that the touch(es) may have in radians. :param minDist: Minimum distance between start position and end position of each contact in millimeters. :param maxInterContactDist: Maximum distance between the start positions of the different contacts. .. autoclass:: TapRecognizer(node, [maxTime=MAX_TAP_TIME, maxDist=MAX_TAP_DIST, initialEvent=None, possibleHandler=None, failHandler=None, detectedHandler=None]) A :py:class:`TapRecognizer` detects short touches without a large change of the cursor position. :param maxTime: The maximum time that the tap may take in milliseconds. :param maxDist: The maximum distance the contact may move in millimeters. .. autoclass:: Transform(trans, [rot=0, scale=1, pivot=(0,0)]) Encapsulates a coordinate transformation and can be used to change the position, rotation and scale of a node. .. py:attribute:: pivot The point around which rot and scale are applied. .. py:attribute:: rot Rotation in radians. .. py:attribute:: scale Multiplies the size of the node. .. py:attribute:: trans The translation. .. py:method:: moveNode(node) Changes a :py:attr:`node`'s pos, angle and size by applying the transform. .. autoclass:: TransformRecognizer(eventNode, [coordSysNode=None, initialEvent=None, friction=-1, detectedHandler=None, moveHandler=None, upHandler=None, endHandler=None]) A :py:class:`TransformRecognizer` is used to support drag/zoom/rotate functionality. From any number of touches on a node, it calculates an aggregate transform that can be used to change the position, size and angle of a node. The class supports intertia after the node is released. :param avg.Node eventNode: The node to attach to. The :py:class:`TransformRecognizer` registers an event handler to react to any contacts for this node. :param avg.Node coordSysNode: Used to determine the coordinate system for the transforms returned by the callbacks. If :py:attr:`coordSysNode` is not given, :py:attr:`eventNode` is used as default. The :py:class:`TransformRecognizer` never modifies any nodes itself. :py:attr:`coordSysNode` can be used to separate the node that is the 'handle' for the events from the node that is being moved - for instance, to allow moving and rotating a window by dragging the title bar. :param float friction: If set, this parameter enables inertia processing. It describes how quickly the transform comes to a stop after the cursor is released. :param moveHandler: A shortcut for :samp:`Recognizer.subscribe(Recognizer.MOTION, moveHandler)`. :param upHandler: A shortcut for :samp:`Recognizer.subscribe(Recognizer.UP, upHandler)`. **Messages:** To get these messages, call :py:meth:`Publisher.subscribe`. .. py:method:: Recognizer.MOTION(transform) Emitted whenever the transform changes. This usually happens in response to one or more :py:const:`CURSORMOTION` events, but may also happen because of inertia. :param Transform transform: The change in transformation since the last call of move or up. .. py:method:: Recognizer.UP(transform) Called when the last touch is released. If inertia is enabled, there may be move events after the up event. :param Transform transform: The change in transformation since the last call of move. .. py:method:: abort() Aborts the present recognized gesture and sliding caused by inertia. libavg-1.8.2/sphinxdoc/index.rst000066400000000000000000000011371236127404500166340ustar00rootroot00000000000000libavg Reference ================ Welcome to the libavg reference documentation. This documentation describes the syntax and semantics of the library. As a reference, it aims to be exact and complete. It is not intended to be an informal introduction to libavg - for this, have a look at http://www.libavg.de/wiki/ProgrammersGuide. .. toctree:: :maxdepth: 1 player app basenodes areanodes vectornodes events animation fx gesture widget misc Indexes and tables ================== * :ref:`genindex` * :ref:`modindex` * :ref:`search` Generated |today|. libavg-1.8.2/sphinxdoc/misc.rst000066400000000000000000000651001236127404500164600ustar00rootroot00000000000000Misc. Classes ============= .. automodule:: libavg.avg :no-members: .. autoclass:: Bitmap Class representing a rectangular set of pixels in CPU memory. Bitmaps can be obtained from any :py:class:`RasterNode` or loaded from disk. For nodes of type :py:class:`ImageNode`, the current bitmap can be set as well. In general, huge Bitmaps (e.g. width>65536) are supported as long as they fit into memory. The layout of the pixels in the bitmap is described by its pixel format. The names for pixel format constants are confusing. They try to follow logic, but it's a bit elusive: In many cases, each component is described by a single letter indicating the component's role in the pixel and a number indicating the number of bits used for this component. Components are named in the order they appear in memory. In the cases where the name doesn't follow this logic, reasons for the name are usually historical or by convention. You can receive a complete list of all supported pixel formats by calling :py:func:`avg.getSupportedPixelFormats()`. The pixel formats are: * :py:const:`B5G6R5`: 16 bits per pixel blue, green, red components. * :py:const:`B8G8R8`: 24 bits per pixel blue, green, red components. * :py:const:`B8G8R8A8`: 32 bits per pixel: blue, green, red and an alpha (opacity) component. * :py:const:`B8G8R8X8`: 32 bits per pixel, with the last byte unused. * :py:const:`A8B8G8R8` * :py:const:`X8B8G8R8` * :py:const:`R5G6B5` * :py:const:`R8G8B8` * :py:const:`R8G8B8A8` * :py:const:`R8G8B8X8` * :py:const:`A8R8G8B8` * :py:const:`X8R8G8B8` * :py:const:`I8`: 8 bits of greyscale intensity. * :py:const:`I16`: 16 bits of greyscale intensity. * :py:const:`A8`: 8 bits of transparency information. * :py:const:`YCbCr411`: Interleaved YCbCr: Y Y Cb Y Y Cr. Effectively 12 bits per pixel. Output format of some cameras. * :py:const:`YCbCr422`: Interleaved YCbCr: Cb Y Cr Y. Effectively 16 bits per pixel. Output format of some cameras. * :py:const:`YUYV422`: Like YCbCr422, but grey values come first, so the order is Y Cb Y Cr. * :py:const:`YCbCr420p`: Not a valid pixel format for a single bitmap, but still a description of planar bitmap coding. Signifies separate bitmaps for Y, Cb and Cr components, with Cb and Cr half as big in both x and y dimensions. This is mpeg YCbCr, where the color components have values from 16...235. Used by many video formats, including mpeg. * :py:const:`YCbCrJ420p`: Same as YCbCr420p, but this is the jpeg version with component values in the range 0...255. Used in video as well, for instance in motion jpeg encoding. * :py:const:`YCbCrA420p`: YCbCr420p with an additional alpha (transparency) bitmap at full resolution. Used in flash video with transparency. * :py:const:`BAYER8`: Bayer pattern. This is raw camera sensor data with an unspecified pixel order. The other :py:const:`BAYER_XXX` constants specify differing camera sensor arrangements. * :py:const:`BAYER8_RGGB` * :py:const:`BAYER8_GBRG` * :py:const:`BAYER8_GRBG` * :py:const:`BAYER8_BGGR` * :py:const:`R32G32B32A32F`: 32 bits per channel float RGBA. * :py:const:`I32F`: 32 bits per channel greyscale intensity. .. py:method:: __init__(size, pixelFormat, name) Creates an uninitialized bitmap of the given size and pixel format. :py:attr:`name` is a name to be used in debug output. .. py:method:: __init__(bitmap) Creates a copy of an already existing bitmap. .. py:method:: __init__(bitmap, tlPos, brPos) Returns a rectangle inside an existing bitmap as a new bitmap. Note that the pixels are not copied and write operations will therefore effect the original bitmap as well. .. py:method:: __init__(fileName) Loads an image file from disk and returns it as bitmap object. .. py:method:: blt(srcBmp, pos) Copies the pixels of srcBmp into the current bitmap at pos. .. py:method:: getAvg() -> float Returns the average of all bitmap pixels. .. py:method:: getChannelAvg(channel) -> float Returns the average of one of the bitmap color channels (red, green or blue). Used for automatic tests. .. py:method:: getFormat() Returns the bitmap's pixel format. .. py:method:: getName() -> string .. py:method:: getPixel(pos) -> (r,g,b,a) Returns one image pixel as a color tuple. This should only be used for single pixels, as it is very slow. .. py:method:: getPixels() -> string Returns the raw pixel data in the bitmap as a python string. This method can be used to interface to the python imaging library PIL (http://www.pythonware.com/products/pil/). .. py:method:: getResized(newSize) -> Bitmap Returns a new bitmap that is a resized version of the original. .. py:method:: getSize() -> Point2D Returns the size of the image in pixels. .. py:method:: getStdDev() -> float Returns the standard deviation of all bitmap pixels. .. py:method:: save(filename) Writes the image to a file. File format is determined using the extension. Supported file types are those supported by gdk-pixbuf. This includes at least png, jpeg, gif, tiff and xpixmaps. .. py:method:: setPixels(pixels) Changes the raw pixel data in the bitmap. Doesn't change dimensions or pixel format. Can be used to interface to the python imaging library PIL (http://www.pythonware.com/products/pil/). :param string pixels: Image data. .. py:method:: subtract(otherbitmap) -> bmp Subtracts two bitmaps and returns the result. Used mainly to compare test images with the intended results (along with :py:meth:`getAvg` and :py:meth:`getStdDev`). .. autoclass:: BitmapManager (EXPERIMENTAL) Singleton class that allow an asynchronous load of bitmaps. The instance is accessed by :py:meth:`get`. .. py:method:: loadBitmap(fileName, callback, pixelformat=NO_PIXELFORMAT) Asynchronously loads a file into a Bitmap. The provided callback is invoked with a Bitmap instance as argument in case of a successful load or with a RuntimeError exception instance in case of failure. The optional parameter :py:attr:`pixelformat` can be used to convert the bitmap to a specific format asynchronously as well. .. py:classmethod:: get() -> BitmapManager This method gives access to the BitmapManager instance. .. py:method:: setNumThreads(numThreads) Sets the number of threads used to load bitmaps. The default is a single thread. This should generally be less than the number of logical cores available. .. autoclass:: CubicSpline(controlpoints) Class that generates a smooth curve between control points using cubic spline-based interpolation. For an introduction on spline interpolation, see http://en.wikipedia.org/wiki/Spline_interpolation. :param controlpoints: A list of 2D coordinates. The x coordinates must be in increasing order. .. py:method:: interpolate(x) -> y Takes an x coordinate and delivers a corresponding y coordinate. .. autoclass:: FontStyle(font="sans", variant="", color="FFFFFF", fontsize=15, indent=0, linespacing=-1, alignment="left", wrapmode="word", justify=False, letterspacing=0, aagamma=1, hint=True) A :py:class:`FontStyle` object encapsulates all configurable font attributes in a :py:class:`WordsNode`. It provides a way to set all relevant attributes (:py:attr:`font`, :py:attr:`fontsize`, etc.) in one line of code. The attributes correspond to the :py:class:`WordsNode` attributes; refer to the :py:class:`WordsNode` reference for descriptions. .. autoclass:: Logger An python interface to libavg's logger. It can be accessed as follows: .. code-block:: python import libavg libavg.logger **Logging** .. py:method:: log(message, category, severity) Logs a message if category is active or severity is at least :py:const:`ERROR`. :param category: One of the categories listed or a custom category. Defaults to :py:const:`Logger.Category.APP`. :param severity: One of the severities listed. Defaults to :py:const:`Logger.Severity.INFO`. :param message: The log message string. .. py:method:: critical(msg, category) Shortcut to :py:meth:`log` with **severity=** :py:const:`Logger.Severity.CRIT`. .. py:method:: error(msg, category) Shortcut to :py:meth:`log` with **severity=** :py:const:`Logger.Severity.ERR`. .. py:method:: warning(msg, category) Shortcut to :py:meth:`log` with **severity=** :py:const:`Logger.Severity.WARN`. .. py:method:: info(msg, category) Shortcut to :py:meth:`log` with **severity=** :py:const:`Logger.Severity.INFO`. .. py:method:: debug(msg, category) Shortcut to :py:meth:`log` with **severity=** :py:const:`Logger.Severity.DBG`. **Configuration** .. py:method:: addSink(logger) Add a python logger object to libavg's logging handlers. The python logger gets the key `category` as an "extra" kwarg, useful for formatting the output. .. py:method:: removeSink(logger) Remove a previously added logger. It will not receive any messages dispatched by the logger annymore. It's safe to call the function even if the logger is not present. .. py:method:: removeStdLogSink() Remove libavg console printing sink. Setting :envvar:`AVG_LOG_OMIT_STDERR` as EnvironmentVar has the same effect. .. py:method:: configureCategory(category, severity) Assign a severity to a given category. category is either a custom string or a :py:const:`Logger.Category` severity has to be one of :py:const:`Logger.Severity`, or it will default to :py:const:`Logger.Severity.None` .. py:method:: getCategories() Returns a dict with **category** as key and **severity** as value The Logger can also be configured using :envvar:`AVG_LOG_CATEGORIES` with the format: .. code-block:: bash CATEGORY[:SEVERITY] [CATEGORY[:SEVERITY]]... Thus it is possible to set a severity level for every category. If no severity is given, the default severity is used. (refer to: :py:meth:`setDefaultSeverity`) If the category does not exist, it will be created. .. code-block:: bash export AVG_LOG_CATEGORIES="CONFIG:INFO APP:DBG PROFILE:DBG MEMORY" Default categories are :py:const:`NONE`, :py:const:`APP` and :py:const:`DEPREC`. They are set to the defaultSeverity. **Categories:** :py:const:`APP` Reserved for application-level messages issued by python code. :py:const:`CONFIG` Outputs configuration data. :py:const:`DEPREC` Deprecation Messages that warn of functionality that will be removed from libavg in the future. :py:const:`EVENTS` Outputs basic event data. :py:const:`MEMORY` Outputs open/close information whenever a media file is accessed. :py:const:`NONE` Outputs everything that has not been categorized. :py:const:`PROFILE` Outputs performance statistics on player termination. :py:const:`PROFILE_V` Outputs performance statistics for video decoding. :py:const:`PLUGIN` Messages generated by loading plugins. :py:const:`PLAYER` General libavg playback messages. :py:const:`SHADER` Shader compiler messages. **Severities** :py:const:`CRIT` Critical :py:const:`ERR` Error :py:const:`WARN` Warning :py:const:`INFO` Info :py:const:`DBG` Debug :py:const:`NONE` None .. autoclass:: Point2D([x,y=(0,0)]) A point in 2D space. Supports most arithmetic operations on vectors. The operators :py:attr:`+`, :py:attr:`-`, :py:attr:`==` and :py:attr:`\!=` are defined for two :py:class:`Point2D` parameters. Unary :py:attr:`-` (negation) is defined as well. :py:class:`Point2D` objects can also be multiplied and divided by a scalar. :py:class:`Point2D` implicitly converts from and to 2-element float tuples and lists, so in most cases you can use one of these types whenever a point is needed. .. py:attribute:: x .. py:attribute:: y .. py:method:: getAngle() -> float Returns the direction of the vector as an angle between pi and -pi, with 0 being the positive x axis. Angles run clockwise. .. py:method:: getNorm() -> float Returns the euclidian norm of the point, that is sqrt(x*x+y*y). .. py:method:: getNormalized() -> Point2D Returns a normalized version of the point with the same angle but a norm of one. Throws an exception if called on Point2D(0,0). .. py:method:: getRotated(angle) -> Point2D Return the position of point rotated around the origin. .. py:method:: getRotated(angle, pivot) -> Point2D Return the position of point rotated around :py:attr:`pivot`. .. py:classmethod:: fromPolar(angle, radius) -> Point2D Converts polar to cartesian coordinates. :py:attr:`angle` is in radians with 0 being the positive x axis. Angle is clockwise (assuming that y points downward). .. autoclass:: SVG(filename, [unescapeIllustratorIDs=False]) :py:class:`SVG` objects load and parse an svg file and render images from it. svg (*Scalable Vector Graphics*, see http://en.wikipedia.org/wiki/Svg) files are xml-based and contain two-dimensional vector graphics. They can be created with editors such as Adobe Illustrator and Inkscape. :py:class:`SVG` objects can render elements in the file to bitmaps and create image nodes from elements in the file. Since the files contain vector graphics, the elements can be scaled to any size when rendering without loss of resolution. :param filename: The name of the file to load. :param unescapeIllustratorIDs: If this is :py:const:`True`, the file is assumed to be generated by Adobe Illustrator. Illustrator mangles element names to create IDs in the svg file. Setting this parameter to :py:const:`True` allows these element names to be passed as IDs. .. py:method:: renderElement(elementID, [size | scale=1]) -> Bitmap Renders an element to a :py:class:`Bitmap`. Either :py:attr:`scale` or :py:attr:`size` may be given. :py:attr:`size` is the size of the bitmap. :py:attr:`scale` is a factor to scale the native bitmap size with. .. py:method:: createImageNode(elementID, nodeAttrs, [size | scale=1]) -> Node Convenience method that calls :py:meth:`renderElement` to render a bitmap and then creates an image node that displays that bitmap. :py:attr:`nodeAttrs` is a dictionary containing constructor parameters for the node. .. py:method:: getElementPos(elementID) -> Point2D Returns the position of an element. .. py:method:: getElementSize(elementID) -> Point2D Returns the original size of an element. .. autoclass:: TestHelper Miscellaneous routines used by tests. Not intended for normal application usage. .. autoclass:: VersionInfo Exposes version data, including the specs of the builder. .. py:attribute:: full Full string containing a compact form of branch and revision number (if the build doesn't come from an exported tree) .. py:attribute:: release String representation in the form `major.minor.micro` .. py:attribute:: major Integer component of the release version (major) .. py:attribute:: minor Integer component of the release version (minor) .. py:attribute:: micro Integer component of the release version (micro) .. py:attribute:: revision Revision number, if applicable, or 0 .. py:attribute:: branchurl Full URL path that represents the branch root, if applicable, or empty string .. py:attribute:: builder String representation in the form of `user@hostname machinespecs` .. py:attribute:: buildtime ISO timestamp representation of the build .. autoclass:: VideoWriter(canvas, filename, [framerate=30, qmin=3, qmax=5, synctoplayback=True]) Class that writes the contents of a canvas to disk as a video file. The videos are written as motion jpeg-encoded mov files. Writing commences immediately upon object construction and continues until :py:meth:`stop` is called. :py:meth:`pause` and :py:meth:`play` can be used to pause and resume writing. The VideoWriter is built for high performance: Opening, writing and closing the video file is asynchronous to normal playback. Writing full HD videos of offscreen canvasses to disk should cost virtually no time on the main thread of execution for an Intel Core-class processor with a graphics card that supports shaders. :param canvas: A libavg canvas used as source of the video. .. py:attribute:: filename The name of the file to write to. Read-only. .. py:attribute:: framerate The speed of the encoded video in frames per second. This is used for two purposes. First, it determines the nominal playback speed of the video that is encoded in the file. Second, if :py:attr:`synctoplayback` is :py:const:`False`, the :py:class:`VideoWriter` will also use the :py:attr:`framerate` value as the actual number of frames per second to write. Read-only. .. py:attribute:: qmin .. py:attribute:: qmax :py:attr:`qmin` and :py:attr:`qmax` specify the minimum and maximum encoding quality to use. :samp:`qmin = qmax = 1` give maximum quality at maximum file size. :samp:`qmin=3` and :samp:`qmax=5` (the default) give a good quality and a smaller file. Read-only. .. py:attribute:: synctoplayback If :py:attr:`synctoplayback` is :py:const:`True` (the default), each frame played back in the canvas will be written to disk. This makes a lot of sense in combination with :py:meth:`Canvas.registerCameraNode()`. If not, :py:attr:`framerate` is used to determine which frames to write to disk. For instance, if :py:attr:`synctoplayback` is :py:const:`False`, :py:attr:`framerate` is 25 and the player is running at 60 fps, one movie frame will be written for each 2.5 frames of playback. The actual, not the nominal playback speed is used in this case. Read-only. .. py:method:: pause() Temporarily stops recording. .. py:method:: play() Resumes recording after a call to :py:meth:`pause`. :py:meth:`play` doesn't need to be called after construction of the :py:class:`VideoWriter` - writing commences immediately. .. py:method:: stop() Ends the recording and writes the rest of the file to disk. Note that this is asynchronous to normal playback. If you need to immediately re-open the video file (e.g. for playback in a video node), destroy the python object first. This waits for sync. .. autofunction:: getMemoryUsage() -> int Returns the amount of memory used by the application in bytes. More precisely, this function returns the resident set size of the process in bytes. This does not include shared libraries or memory paged out to disk. .. autofunction:: pointInPolygon(point, poly) -> bool Checks if a point is inside a polygon. :param Point2D point: Point to check. :param poly: List of points which constitute a polygon to check against. :returns: :py:const:`True` if point is inside, :py:const:`False` otherwise. .. autofunction:: validateXml(xmlString, schemaString, xmlName, schemaName) Validates an xml string using a schema. Throws an exception if the xml doesn't conform to the schema. .. automodule:: libavg.statemachine :no-members: .. autoclass:: StateMachine(name, startState) A generic state machine, useful for user interface and other states. Consists of a set of states (represented by strings) and possible transitions between the states. The :py:class:`StateMachine` can be configured to invoke callbacks at specific transitions and when entering or leaving a state. All callbacks are optional. State changes can be logged for debugging purposes. State machines are initialized by calling :py:meth:`addState` for each possible state after constructing it. :param String name: A name for the state machine to be used in debugging output. :param String startState: .. py:attribute:: state The current state the :py:class:`StateMachine` is in. States are strings. .. py:method:: addState(state, transitions, [enterFunc=None, leaveFunc=None]) Adds a state to the :py:class:`StateMachine`. Must be called before the first changeState. :param String state: The name of the state to add. :param transitions: This parameter can be either a list of destination states or a dict of destinationState: callable pairs. The callables are invoked whenever the corresponding state change happens. If :py:meth:`transitions` is a list, no state change callbacks are registered. :param enterFunc: A callable to invoke whenever the state is entered. :param leaveFunc: A callable to invoke whenever the state is left. .. py:method:: changeState(newState) Changes the state. This includes calling the leave callback for the current state, actually changing the state, calling the transition callback and calling the enter callback for the new state. Raises a :py:class:`RuntimeError` if :py:attr:`newState` is not a valid state or if there is no transition defined from the current state to :py:attr:`newState`. .. py:method:: dump() Prints all states and transitions to the console. .. py:method:: makeDiagram(imageFName, [showMethods=False]) Dumps a graph of the state machine to an image file using dot. graphviz must be installed and in the path for this to work. Very useful for debugging. If :py:attr:`showMethods` is true, names of enter, leave and transition methods are included in the diagram. .. py:method:: traceChanges(trace) If :py:attr:`trace` is set to :py:const:`True`, all state changes are dumped to the console. .. automodule:: libavg.persist :no-members: .. autoclass:: Persist(storeFile, initialData[, validator=lambda v: True, autoCommit=False]) A general purpose persistent object. Its state is defined in the :py:attr:`data` attribute and pickled from/to a store file. :param string storeFile: Full path of the store file that is used to store and retrieve a serialized version of the data. :param initialData: A pickle-able object that is assigned to the :py:attr:`data` attribute when no file store exists or when the store file is corrupted. :param callable validator: An optional callable that receives the object state as soon it's de-pickled from the store file. If the validator call doesn't return True, the object state is restored to the provided `initialData`. :param bool autoCommit: If True, the :py:attr:`commit` method is registered as an `atexit` function. .. py:attribute:: data State of the persistent object. .. py:attribute:: storeFile Returns the full path of the store file. .. py:method:: commit() Dumps the contents of the :py:attr:`data` attribute to the store file. .. autoclass:: UserPersistentData(appName, fileName, initialData[, validator=lambda v: True, autoCommit=False]) A :py:class:`Persist` subclass that sets up an OS-independent path for the store file. Under posix-compliant OSes is `$HOME/.avg//.pkl` Under Windows is `%APPDATA%\Avg\/.pkl` :param string appName: Name of the application. This string is used to compose the full path to the file store and it creates a namespace (directory) for multiple files for the same application. :param string fileName: Name of the file store file. `.pkl` will be added as extension. libavg-1.8.2/sphinxdoc/player.rst000066400000000000000000000624401236127404500170250ustar00rootroot00000000000000Player & Canvas =============== .. automodule:: libavg.avg :no-members: .. inheritance-diagram:: OffscreenCanvas :parts: 1 .. inheritance-diagram:: Player :parts: 1 This section describes the classes that provide a framework for rendering. The :py:class:`Player` class is an interface to the avg renderer. The :py:class:`Canvas` class and its descendant :py:class:`OffscreenCanvas` provide areas to draw on. .. autoclass:: Canvas A Canvas is a tree of nodes. It is the place where a scenegraph is displayed. In a libavg session, there is one main canvas that corresponds to the screen (which is of class :py:class:`Canvas`) and zero or more canvases that are rendered offscreen (which are of class :py:class:`OffscreenCanvas`). .. py:method:: getElementByID(id) -> Node Returns the element in the canvas's tree that has the :py:attr:`id` given. .. py:method:: screenshot() -> Bitmap Returns the image the canvas has last rendered as :py:class:`Bitmap`. For the main canvas, this is a real screenshot. For offscreen canvases, this is the image rendered offscreen. .. py:method:: getRootNode() -> CanvasNode Returns the root of the scenegraph. For the main canvas, this is an :py:class:`AVGNode`. For an offscreen canvas, this is a :py:class:`CanvasNode`. .. autoclass:: OffscreenCanvas An OffscreenCanvas is a Canvas that is rendered to a texture. It can be referenced in the href attribute of an image node. See https://www.libavg.de/wiki/ProgrammersGuide/OffscreenRendering for an in-depth explanation of using offscreen rendering. Offscreen canvases are created by calling :py:meth:`Player.createCanvas`, :py:meth:`Player.loadCanvasFile` or :py:meth:`Player.loadCanvasString`. .. py:attribute:: autorender Turns autorendering on or off. Default is :py:const:`True`. .. py:attribute:: handleevents :py:const:`True` if events that arrive at an image node that is displaying this canvas are routed to the offscreen canvas. Read-only. .. py:attribute:: mipmap :py:const:`True` if mipmaps are generated and used for the canvas. This is used instead of RasterNode.mipmap for images that render the canvas. Read-only. .. py:attribute:: multisamplesamples Number of samples per pixel to use for multisampling. Setting this to 1 disables multisampling. Read-only. .. py:method:: getID() -> string Returns the id of the canvas. This is the same as calling :samp:`canvas.getRootNode().getID()`. .. py:method:: getNumDependentCanvases Returns the number of canvases that reference this canvas. Used mainly for unit tests. .. py:method:: registerCameraNode .. py:method:: render() Forces an immediate redraw of the offscreen canvas. This makes sure that following calls to screenshot() get a current version of the canvas and is usually used in combination with :samp:`autorender=False`. .. py:method:: unregisterCameraNode .. py:classmethod:: isMultisampleSupported() -> bool :py:const:`True` if the machine's OpenGL implementation supports offscreen multisampling. .. autoclass:: Player The class used to load and play avg files and the main interface to the avg renderer. Player is a singleton. There is only one instance, accessed by :py:attr:`avg.player`. **Messages:** To get these messages, call :py:meth:`Publisher.subscribe`. .. py:method:: KEY_DOWN(keyEvent) Called whenever a key is pressed. .. py:method:: KEY_UP(keyEvent) Called whenever a key is released. .. py:method:: ON_FRAME() Called each frame. .. py:attribute:: pluginPath A list of directories where the player searches for plugins when :py:meth:`loadPlugin()` is called. The separator between path entries is a semicolon (';') under Windows and a colon (':') under Mac and Linux. .. py:attribute:: volume Total audio playback volume. 0 is silence, 1 passes media file volume through unchanged. Values higher than 1 can be used to amplify playback. A limiter prevents distortion when the volume is set too high. .. py:method:: addInputDevice(inputDevice) Registers an :py:class:`InputDevice` with the system. .. py:method:: areFullShadersSupported() -> bool Returns :py:const:`True` if the current OpenGL configuration has full shader support. Platforms without full shader support (this includes OpenGL ES) disable several :py:class:`FXNode` types. Calling this when playback is not running is an error. .. py:method:: assumePixelsPerMM(ppmm) Tells the system to assume a resolution for the physical screen, overriding operating system information. The parameter is the number of pixels per millimeter as a :samp:`float`. This function affects the values returned by :py:meth:`getPhysicalScreenDimensions` and :py:meth:`getPixelsPerMM`. It is useful for situations in which the OS cannot know the resolution (e.g. projectors) and when the automatic functions return wrong values (which happens, unfortunately, because of operating system deficiencies). .. py:method:: callFromThread(pyfunc) Executes :py:attr:`pyfunc` in the main thread of execution, in the next event handling phase. This method is the only libavg method that is thread-safe and can be called from secondary threads of execution. :py:attr:`pyfunc` can be any python callable, including any libavg methods. .. py:method:: clearInterval(id) -> bool Stops a timeout, an interval or an onFrameHandler from being called. Returns :py:const:`True` if there was an interval with the given :py:attr:`id`, :py:const:`False` if not. :param int id: An id returned by :py:meth:`setInterval`, :py:meth:`setTimeout` or :py:meth:`setOnFrameHandler`. .. py:method:: createCanvas(*params) -> OffscreenCanvas Creates an empty offscreen canvas. Parameters are given under :py:class:`OffscreenCanvas`. .. py:method:: createMainCanvas(*params) -> Canvas Creates an empty canvas with a render window and an AVGNode as root node. Parameters are given under :py:class:`AVGNode`. .. py:method:: createNode(xml) -> Node Creates a new Node. This node can be used as parameter to :py:meth:`DivNode.appendChild()` and :py:meth:`DivNode.insertChild()`. This method will create any type of node, including :samp:`
` nodes with children. :param xml: xml string conforming to the avg dtd that specifies the node to create. .. py:method:: createNode(type, args) -> Node Creates a new Node. This node can be used as parameter to :py:meth:`DivNode.appendChild()` and :py:meth:`DivNode.insertChild()`. This method will only create one node at a time. :param string type: Type string of the node to create (For example, :samp:`image` and :samp:`words` are valid type strings). :param dict args: a dictionary specifying attributes of the node. .. py:method:: deleteCanvas(id) Removes the canvas given by id from the player's internal list of canvases. It is an error to delete a canvas that is still referenced by an image node. .. py:method:: enableGLErrorChecks(enable) Enables or disables checking for errors after each OpenGL call. By default, this is :py:const:`False`, since it hurts performance in some setups. It is enabled by the tests. You do not need this method unless you are looking for errors inside libavg. .. py:method:: enableMouse(enable) Enables or disable mouse event handling. .. py:method:: enableMultitouch() Enables multitouch event handling. Several drivers are available that generate multitouch events. To choose a driver, set the environment variable :envvar:`AVG_MULTITOUCH_DRIVER` to the appropriate value: :samp:`TUIO`: Listens for TUIO events from a tracker that conforms to the TUIO protocol (http://www.tuio.org), a de-facto standard for multitouch events. By default, it listens to events on the default TUIO UDP port 3333, but this can be configured using the environment variable :envvar:`AVG_TUIO_PORT`. :samp:`APPLETRACKPAD`: Uses the trackpad built into Mac Book Pros to generate events. :samp:`LINUXMTDEV`: Uses the linux mtdev library to interface to multitouch devices. The environment variable :envvar:`AVG_LINUX_MULTITOUCH_DEVICE` is used to determine which device file to open. Default is :samp:`/dev/input/event3`. :samp:`TRACKER`: Enables the internal camera-based tracker. Configuring this tracker is described under https://www.libavg.de/wiki/ProgrammersGuide/Tracker. :samp:`WIN7TOUCH`: Enables handling of Windows 7 touch events. This works with all devices which have Windows 7 drivers. :samp:`XINPUT`: Uses X11-based multitouch detection. This needs X11 with XInput >= 2.1 support. For backwards compatibility reasons, XINPUT21 is supported as value as well. If :envvar:`AVG_MULTITOUCH_DRIVER` is not set, the driver defaults to a plattform-specific one. Under Linux, the default is :samp:`XINPUT` if XInput multitouch is supported on the system, otherwise :samp:`LINUXMTDEV`. Under Windows, the default is :samp:`WIN7TOUCH`. :py:meth:`enableMultitouch` throws an exception if the chosen driver is not available or no multitouch device could be found. (Exception: Since there is no way to determine if a TUIO device is available, :py:meth:`enableMultitouch` always appears to succeed in this case.) .. py:method:: getCanvas(id) -> OffscreenCanvas Returns the offscreen canvas with the :py:attr:`id` given. .. py:method:: getCurrentEvent() -> Event Must be called inside an event handler and returns the event that's being processed. Throws an exception if called outside an event handler. .. py:method:: getEffectiveFramerate() -> float Returns the framerate that the player is actually achieving. The value returned is not averaged and reflects only the current frame. .. py:method:: getElementByID(id) -> Node Returns an element in the main avg tree. :param id: id attribute of the node to return. .. py:method:: getEventHook() -> pyfunc Returns the last event hook set using :py:meth:`setEventHook`. .. py:method:: getFrameDuration() -> float Returns the number of milliseconds that have elapsed since the last frame (i.e. the last display update). .. py:method:: getFramerate() -> float Returns the current target framerate in frames per second. To get the actual framerate that the player is currently achieving, call :py:meth:`getEffectiveFramerate`. .. py:method:: getFrameTime() -> int Returns the number of milliseconds that have elapsed since playback has started. Honors FakeFPS. The time returned stays constant for an entire frame; it is the time of the last display update. .. py:method:: getKeyModifierState() -> KeyModifier Returns the current modifier keys pressed, or'ed together. For a list of possible values, see :py:attr:`KeyEvent.modifiers`. .. py:method:: getMainCanvas() -> Canvas Returns the main canvas. This is the canvas loaded using :py:meth:`loadFile` or :py:meth:`loadString` and displayed on screen. .. py:method:: getMouseState() -> MouseEvent Returns the last mouse event generated. .. py:method:: getPhysicalScreenDimensions() -> Point2D Returns the size of the primary screen in millimeters. .. py:method:: getPixelsPerMM() -> float Returns the number of dots per millimeter of the primary display. Assumes square pixels. .. py:method:: getRootNode() -> Node Returns the outermost element in the main avg tree. .. py:method:: getScreenResolution() -> Point2D Returns the size in pixels of the current screen. .. py:method:: getTestHelper .. py:method:: getTracker() -> Tracker Returns a tracker previously created using :py:meth:`enableMultitouch` with the internal tracker configured. .. py:method:: getVideoMemInstalled() -> int Returns the amount of dedicated video memory installed in the system in bytes (which might be zero in case of shared-memory graphics cards). Only available when using NVidia drivers. .. py:method:: getVideoMemUsed() -> int Returns the amount of dedicated video memory used in bytes. This is the total amount used by all programs. Only available when using NVidia drivers. .. py:method:: getVideoRefreshRate() -> float Returns the current hardware video refresh rate in number of refreshes per second. .. py:method:: isCursorShown() Returns :py:const:`True` if the mouse cursor is visible. .. py:method:: isFullscreen() Returns :py:const:`True` if the player is running in fullscreen mode. .. py:method:: isMultitouchAvailable() -> bool Returns :py:const:`True` if a multitouch device has been configured and is active, :py:const:`False` if not. Must be called after :py:meth:`play()`. .. py:method:: isPlaying() -> bool Returns :py:const:`True` if :py:meth:`play()` is currently executing, :py:const:`False` if not. .. py:method:: keepWindowOpen() Tells the player to keep the playback window open after :py:meth:`play()` has returned. This makes it possible to reuse the window with another scene and :py:meth:`play()` call. It is used by the tests to keep flickering to a minimum and increase speed. .. py:method:: loadCanvasFile(filename) -> OffscreenCanvas Loads the canvas file specified in filename and adds it to the registered offscreen canvases. .. py:method:: loadCanvasString(avgString) -> OffscreenCanvas Parses avgString, loads the nodes it contains and adds the hierarchy to the registered offscreen canvases. :param string avgString: An xml string containing an avg node hierarchy. .. py:method:: loadFile(filename) -> Canvas Loads the avg file specified in filename. Returns the canvas loaded. The canvas is the main canvas displayed onscreen. .. py:method:: loadPlugin(name) Load a Plugin. :param string name: filename of the plugin without directory and file extension. .. py:method:: loadString(avgString) -> Canvas Parses avgString and loads the nodes it contains. Returns the canvas loaded. The canvas is the main canvas displayed onscreen. :param string avgString: An xml string containing an avg node hierarchy. .. py:method:: play() Opens a playback window or screen and starts playback. play returns when playback has ended. .. py:method:: screenshot() -> Bitmap Returns the contents of the current screen as a bitmap. .. py:method:: setCursor(bitmap, hotspot) Sets the mouse cursor to the bitmap given. The bitmap must have a size divisible by 8 and an RGBA pixel format. The cursor generated is binary black and white with a binary transparency channel. hotspot is the relative position of the actual pointing coordinate in the bitmap. .. py:method:: setEventHook(pyfunc) Set a callable which will receive all events before the standard event handlers receive them. If this callable returns :py:const:`True`, the event is not propagated to the standard event handlers. Generally, :py:meth:`setEventHook` should be used as a last resort. In most cases, standard event handlers are a lot cleaner. Also, setting several event hooks is not supported by libavg. To get around this limitation, you can use :py:meth:`getEventHook` to chain event hook functions. Note that :py:attr:`event.node` is not set in the callback, since the system hasn't determined the node to send the event to at that point. .. py:method:: setFakeFPS(fps) Sets a fixed number of virtual frames per second that are used as clock source for video playback, animations and other time-based actions. If a value of :samp:`-1` is given as parameter, the real clock is used. :py:meth:`setFakeFPS` can be used to get reproducible results for recordings or automated tests. Setting FakeFPS has the side-effect of disabling audio. .. py:method:: setFramerate(framerate) Sets the desired framerate for playback. Turns off syncronization to the vertical blanking interval. .. py:method:: setGamma(red, green, blue) Sets display gamma. This is a control for overall brightness and contrast that leaves black and white unchanged but adjusts greyscale values. :samp:`1.0` is identity, higher values give a brighter image, lower values a darker one. .. py:method:: setInterval(time, pyfunc) -> int Sets a python callable object that should be executed regularly. :py:meth:`setInterval` returns an id that can be used to call :py:meth:`clearInterval()` to stop the function from being called. The callback is called at most once per frame. :param int time: Number of milliseconds between two calls. :param pyfunc: Python callable to execute. .. py:method:: setMousePos(pos) Sets the position of the mouse cursor. Generates a mouse motion event. .. py:method:: setMultiSampleSamples(multiSampleSamples) Sets the number of samples per pixel to compute. This costs performance and smoothes the edges of polygons. A value of :samp:`1` turns multisampling (also knowna as FSAA - Full-Screen Antialiasing) off. Good values are dependent on the graphics driver and the performance of the graphics card. .. py:method:: setOGLOptions(usePOW2Textures, usePixelBuffers, multiSampleSamples, shaderUsage=AUTO, useDebugContext=False) Determines which OpenGL extensions to check for and use if possible. This method is mainly used for debugging purposes while developing libavg, but can also be used to work around buggy drivers. The values set here override those in the :file:`avgrc` file. Note that with the exception of multiSampleSamples, fallbacks are always used - if a feature is specified that the system doesn't support, a less demanding one will be used. Must be called before :py:meth:`play`. :param bool usePOW2Textures: If :py:const:`True`, restricts textures to power-of-two dimensions. :param bool usePixelBuffers: If :py:const:`False`, disables the use of OpenGL pixel buffer objects. :param int multiSampleSamples: The number of samples per pixel to compute. This costs performance and smoothes the edges of polygons. A value of :samp:`1` turns multisampling (also known as FSAA - Full-Screen Antialiasing) off. Good values are dependent on the graphics driver and the performance of the graphics card. :param shaderUsage: Either :py:const:`FULL`, :py:const:`MINIMAL` or :py:const:`AUTO`. :py:const:`MINIMAL` restricts shader usage to a subset that doesn't use much GPU power. :param useDebugContext: Uses an OpenGL Debug Context for rendering if the graphics driver supports it. This causes more verbose error messages and warnings in the case of OpenGL errors. .. py:method:: setOnFrameHandler(pyfunc) -> int Sets a python callable object that should be executed once per frame. This is the same as :samp:`setInterval(0, pyfunc)`. Returns an id that can be used to call :py:meth:`clearInterval()` to stop the function from being called. :param pyfunc: Python callable to execute. .. py:method:: setResolution(fullscreen, width, height, bpp) Sets display engine parameters. Must be called before :py:meth:`loadFile` or :py:meth:`loadString`. :param bool fullscreen: :py:const:`True` if the avg file should be rendered fullscreen. :param int width, height: The window size (if fullscreen is :py:const:`False`) or screen resolution (if fullscreen is :py:const:`True`). :param int bpp: Number of bits per pixel to use. Valid values are :samp:`15`, :samp:`16`, :samp:`24` and :samp:`32`. .. py:method:: setTimeout(time, pyfunc) -> int Sets a python callable object that should be executed after a set amount of time. :py:meth:`setTimeout` returns an id that can be used to call :py:meth:`clearInterval()` to stop the function from being called. :param int time: Number of milliseconds before the call. :param pyfunc: Python callable to execute. .. py:method:: setVBlankFramerate(rate) Sets the desired number of monitor refreshes before the next frame is displayed. The resulting framerate is determined by the monitor refresh rate divided by the rate parameter. :param int rate: Number of vertical blanking intervals to wait. On Mac OS X, only :samp:`1` is supported as rate. .. py:method:: setWindowFrame(hasWindowFrame) :py:attr:`hasWindowFrame` should be set to :py:const:`True` if a non-fullscreen player should have a window frame. If set to :py:const:`False`, the player runs with no title bar or window frame. Must be called before :py:meth:`play` is called. .. py:method:: setWindowPos(x, y) Sets the location of the player window. Must be called before loadFile or loadString. .. py:method:: setWindowTitle(title) Sets the string displayed in the title bar of the libavg window. Default is 'libavg'. .. py:method:: showCursor(show) Shows or hides the mouse cursor. :param bool show: :py:const:`True` if the mouse cursor should be visible. .. py:method:: stop() Stops playback and resets the video mode if necessary. .. py:method:: stopOnEscape(stop) Toggles player stop upon escape keystroke. If stop is :py:const:`True` (the default), if player will halt playback when :kbd:`Esc` is pressed. .. py:method:: useGLES(gles) Chooses whether to use OpenGL ES or desktop OpenGL for rendering. Must be called before :py:meth:`play`. :param bool gles: :py:const:`True` if OpenGL ES should be used. .. py:classmethod:: get() -> Player .. deprecated:: 1.8 Use :attr:`avg.player` instead. This method gives access to the player instance. If no player has been created yet, a player is created. libavg-1.8.2/sphinxdoc/vectornodes.rst000066400000000000000000000155671236127404500200740ustar00rootroot00000000000000Vector Nodes ============ .. automodule:: libavg.avg :no-members: .. inheritance-diagram:: CircleNode CurveNode FilledVectorNode LineNode MeshNode Node PolygonNode PolyLineNode RectNode VectorNode libavg.geom.Arc libavg.geom.PieSlice libavg.geom.RoundedRect :parts: 1 .. autoclass:: CircleNode([r=1, texcoord1=0, texcoord2=1]) A circle. The reference point for a circle is its center. .. py:attribute:: r The radius of the circle in pixels. .. py:attribute:: texcoord1 .. py:attribute:: texcoord2 .. autoclass:: CurveNode([pos1, pos2, pos3, pos4, texcoord1, texcoord2]) A cubic bezier curve (``_). :py:attr:`pos1` and :py:attr:`pos4` are the two endpoints of the curve. :py:attr:`pos2` and :py:attr:`pos3` are control points. .. py:method:: getPtOnCurve(t) -> pos Returns a point on the curve. Which point is determined by the value of t. If :samp:`t=0`, returns :py:attr:`pos1`. :samp:`t=1` returns :py:attr:`pos4`, and values in between return the points in between. .. py:attribute:: length Returns an approximation of the length of the curve (ro). .. py:attribute:: pos1 .. py:attribute:: pos2 .. py:attribute:: pos3 .. py:attribute:: pos4 .. py:attribute:: texcoord1 .. py:attribute:: texcoord2 .. autoclass:: FilledVectorNode([filltexhref, fillopacity=0, fillcolor="FFFFFF", filltexcoord1=Point2D(0,0), filltexcoord2=Point2D(1,1)]) Base class for vector nodes which have a filled area and a border. The area can be filled either with a solid color (:py:attr:`fillcolor`) or with a texture loaded from a file (:py:attr:`filltexhref`) or taken from a bitmap object (:py:meth:`setFillBitmap`). .. py:attribute:: fillcolor .. py:attribute:: fillopacity .. py:attribute:: filltexcoord1 .. py:attribute:: filltexcoord2 .. py:attribute:: filltexhref An image file to use as a texture for the area of the node. .. py:method:: setFillBitmap(bitmap) Sets a bitmap to use as a fill texture. Sets :attr:`filltexhref` to an empty string. .. autoclass:: LineNode([pos1, pos2, texcoord1, texcoord2]) A line. :py:attr:`pos1` and :py:attr:`pos2` are the two endpoints of the line. .. py:attribute:: pos1 .. py:attribute:: pos2 .. py:attribute:: texcoord1 .. py:attribute:: texcoord2 .. autoclass:: MeshNode([vertexcoords, texcoords, triangles]) This is a generalized mesh of textured triangles. See https://www.libavg.de/wiki/ProgrammersGuide/MeshNode for an example. .. py:attribute:: texcoords .. py:attribute:: triangles .. py:attribute:: vertexcoords .. autoclass:: PolygonNode([linejoin="bevel", pos, texcoords]) A closed figure bounded by a number of line segments, optionally filled. Filled polygons may not be self-intersecting. .. py:attribute:: linejoin The method by which line segments are joined together. Valid values are :py:const:`bevel` and :py:const:`miter`. .. py:attribute:: pos A sequence (:py:class:`list` or :py:class:`tuple`) of pixel positions. .. py:attribute:: texcoords A sequence of float texture coordinates corresponding to the border positions. .. autoclass:: PolyLineNode([linejoin="bevel", pos, texcoords]) A figure similar to a :py:class:`PolygonNode`, but not closed and never filled. .. py:attribute:: linejoin The method by which line segments are joined together. Valid values are :py:const:`bevel` and :py:const:`miter`. .. py:attribute:: pos A sequence (:py:class:`list` or :py:class:`tuple`) of pixel positions. .. py:attribute:: texcoords A sequence of float texture coordinates corresponding to the border positions. .. autoclass:: RectNode([pos, size, angle]) A rectangle that can be filled. .. py:attribute:: angle The angle that the rectangle is rotated to in radians. 0 is unchanged, 3.14 is upside-down. The rectangle is rotated around its center. .. py:attribute:: pos The position of the top left corner of the rectangle. .. py:attribute:: size .. py:attribute:: texcoords .. autoclass:: VectorNode([color="FFFFFF", strokewidth=1, texhref, blendmode="blend"]) Base class for all nodes that draw geometrical primitives. All vector nodes support configurable stroke width. Strokes can be filled either with a solid color (:py:attr:`color`) or with a texture loaded from a file (:py:attr:`texhref`) or taken from a bitmap object (:py:meth:`setBitmap`). .. py:attribute:: blendmode The method of compositing the node with the nodes under it. Valid values are :py:const:`blend`, :py:const:`add`, :py:const:`min` and :py:const:`max`. For :py:const:`min` and :py:const:`max` blend modes, opacity is ignored. .. py:attribute:: color The color of the strokes in standard html color notation: :samp:`"FF0000"` is red, :samp:`"00FF00"` green, etc. .. py:attribute:: strokewidth The width of the strokes in the vector. For lines, this is the line width. For rectangles, it is the width of the outline, etc. .. py:attribute:: texhref An image file to use as a texture for the node. .. py:method:: setBitmap(bitmap) Sets a bitmap to use as a texture. Sets :attr:`texhref` to an empty string. .. automodule:: libavg.geom :no-members: .. autoclass:: Arc(radius, startangle, endangle[, pos=(0,0)]) An unfilled arc (incomplete circle) from :py:attr:`startangle` to :py:attr:`endangle`. :py:attr:`pos` is the center of the circle. .. py:attribute:: endangle .. py:attribute:: pos .. py:attribute:: radius .. py:attribute:: startangle .. autoclass:: PieSlice(radius, startangle, endangle[, pos=(0,0)]) An arc (incomplete circle) from :py:attr:`startangle` to :py:attr:`endangle` connected to the center of the circle. :py:attr:`pos` is the center of the circle. A :py:class:`PieSlice` can be filled. .. py:attribute:: endangle .. py:attribute:: pos .. py:attribute:: radius .. py:attribute:: startangle .. autoclass:: RoundedRect(size, radius, pos) A rectangle with rounded corners. :py:attr:`radius` is the corner radius. .. py:attribute:: pos .. py:attribute:: radius .. py:attribute:: size libavg-1.8.2/sphinxdoc/widget.rst000066400000000000000000000513351236127404500170150ustar00rootroot00000000000000Widget Classes ============== The libavg.widget module contains high-level user interface elements such as buttons and list boxes. Widgets are fully skinnable (using the :py:class:`Skin` class and an xml configuration file) and multitouch-enabled. Sample code for all widgets can be found in the :samp:`widget.py` sample. .. note:: The widget module is experimental. Functionality and interface are still in flux and subject to change. .. automodule:: libavg.widget :no-members: .. inheritance-diagram:: SwitchNode Button TextButton BmpButton ToggleButton CheckBox BmpToggleButton Keyboard Slider ScrollBar ProgressBar ScrollArea ScrollPane TimeSlider MediaControl :parts: 1 .. inheritance-diagram:: HStretchNode VStretchNode HVStretchNode Skin :parts: 1 .. autoclass:: BmpButton(upSrc, downSrc, [disabledSrc=None]) A :py:class:`Button` that is created from image files. Internally, it creates two or three :py:class:`ImageNode` s and uses them as constructor parameters for :py:class:`Button`. .. autoclass:: BmpToggleButton(uncheckedUpSrc, uncheckedDownSrc, checkedUpSrc, checkedDownSrc, [uncheckedDisabledSrc=None, checkedDisabledSrc=None]) A :py:class:`ToggleButton` that is created from image files. Internally, it creates image nodes for the src parameters and uses them as constructor parameters for :py:class:`ToggleButton`. .. autoclass:: Button(upNode, downNode, [disabledNode=None, activeAreaNode=None, fatFingerEnlarge=False, enabled=True]) A button that shows different user-supplied nodes depending on its state. Possible button states are up, down and disabled. The nodes are attached as children to the Button on construction. For a simple button, image nodes can be passed. Uses the :py:class:`TapRecognizer` to detect clicks. .. image:: ButtonStates.png :param avg.Node upNode: The node displayed when the button is not pressed. :param avg.Node downNode: The node displayed when the button is pressed. :param avg.Node disabledNode: The node displayed when the button is disabled. :param avg.Node activeAreaNode: A node that is used only to determine if a click is over the button. Usually, this node is invisible. :py:attr:`activeAreaNode` is useful for small touch buttons, where the active area should be larger than the visible button to account for touch inaccuracies. :param bool fatFingerEnlarge: If this parameter is set to :py:const:`True`, the button generates its own internal :py:attr:`activeAreaNode` that is at least 20x20mm large. :py:attr:`fatFingerEnlarge` is incompatible with a custom :py:attr:`activeAreaNode`. **Messages:** To get these messages, call :py:meth:`Publisher.subscribe`. .. py:method:: Button.PRESSED() Called when a tap on the button is initiated. .. py:method:: Button.RELEASED() Called when a tap on the button ends. Emitted for both successful and aborted taps. .. py:method:: Button.CLICKED() Called when the button is clicked. .. py:attribute:: enabled :py:const:`True` if the button accepts input. If the button is disabled, it shows the :py:attr:`disabledNode`. .. autoclass:: CheckBox([text="", skinObj=skin.Skin.default]) This is a classic checkbox with text to the right. .. autoclass:: HStretchNode(endsExtent, [src=None, minExtent=-1]) A node that stretches its graphics to fill the size given horizontally. It is used as base component for scrollbars and buttons. The base bitmap is split into three parts: left, center and right. The left and right parts are :py:attr:`endsExtent` wide and generated from the corresponding parts of the source bitmap. The center part is generated from a one pixel wide slice of the source bitmap and stretched to fill the space left between the left and right parts. :param int endsExtent: Width of the left and right bitmaps in pixels. :param src: Either the name of a bitmap file or a :py:class:`Bitmap` object. Used to generate the graphics used. :param int minExtent: Minimum horizontal size. The default of -1 uses :py:const:`2*endsExtent+1` as minimum. .. autoclass:: HVStretchNode(endsExtent, [src=None, minExtent=-(1,-1)]) A node that stretches its graphics to fill the size given horizontally and vertically. It is used as base component for scrollareas. Similar to :py:class:`HStretchNode`, the base bitmap is split and partial bitmaps are extracted. Four corner bitmaps of size :py:attr:`endsExtent` stay the same size, four one-pixel-slice bitmaps fill the sides, and a single one-pixel bitmap is used to fill the center area. :param IntPoint endsExtent: Size of the corner bitmaps in pixels. :param src: Either the name of a bitmap file or a :py:class:`Bitmap` object. Used to generate the graphics used. :param IntPoint minExtent: Minimum size. The default of :py:const:`(-1,-1]` uses :py:const:`2*endsExtent+1` as minimum. .. autoclass:: Keyboard(bgSrc, downSrc, keyDefs, shiftKeyCode, [altGrKeyCode=None, stickyShift=False, feedbackSrc=None]) Implements an onscreen keyboard that turns mouse clicks or touches into key presses. The keyboard is completely configurable. Keyboard graphics are determined by the two image files in :py:attr:`bgSrc` and :py:attr:`downSrc`. Keys can be defined as rectangles anywhere on these images. Works for both single-touch and multitouch devices. Generates events when keys are pressed or released. An additional enlarged image of the key being pressed can be rendered above a pending touch as well by using :py:attr:`feedbackSrc`. Needs offscreen rendering support on the machine to generate individual key images from the image files supplied. :param string bgSrc: Filename of an image that contains the keyboard with unpressed keys. :param string downSrc: Filename of an image that contains the keyboard with pressed keys. :param list keyDefs: List of key definitions. Keys can be either character keys: [(, , ), , , , ] or command keys: [, , , , ] For character keys, the shift and altgr keycodes are optional. To define entire rows of evenly-spaced keys, use :py:meth:`makeRowKeyDefs`. :param shiftKeyCode: One of the command keycodes. When a key with this code is pressed, pressing other keys causes them to return the shifted keycode. :param altGrKeyCode: One of the command keycodes. When a key with this code is pressed, pressing other keys causes them to return the altgr keycode. :param bool stickyShift: For single-touch devices, the shift key must stay in the pressed state until the next normal key is pressed to have any effect. This is the behaviour if :py:attr:`stickyShift` is :py:const:`True`. If it is :py:const:`False` (the default), a multitouch device is assumed and shift works like on a physical keyboard. :param string feedbackSrc: Filename of an image that contains an enlarged version of bgSrc for use as feedback during key pressed. If this parameter not set the feedback funktion is turned off. **Messages:** :py:class:`Keyboard` emits messages on every key press and release: To get these messages, call :py:meth:`Publisher.subscribe`. .. py:method:: DOWN(keycode) Emitted whenever a key (command or char) is pressed. .. py:method:: UP(keycode) Emitted whenever a key (command or char) is released. .. py:method:: CHAR(char) Emitted whenever a character is generated. This is generally when a char key is released and takes into account shift/altgr status. .. py:method:: reset() Resets any sticky keys (shift, altgr) to their default state. .. py:classmethod:: makeRowKeyDefs(startPos, keySize, spacing, feedbackStr, keyStr, shiftKeyStr, [altGrKeyStr]) Creates key definitions for a row of uniform keys. Useful for creating the keyDefs parameter of the Keyboard constructor. All the keys get no repeat functionality. :param avg.Point2D startPos: Top left position of the row. :param avg.Point2D keySize: Size of each key. :param int spacing: Number of empty pixels between two keys. :param string keyStr: Unicode string containing the unshifted keycodes (i.e. :samp:`u"qwertzuiopżś"`) :param string shiftKeyStr: Unicode string containing the shifted keycodes (i.e. :samp:`u"QWERTZUIOPńć"`) :param string altGrKeyStr: Unicode string containing the keycodes when altgr is pressed. .. autoclass:: MediaControl([duration=1000, time=0, skinObj=skin.Skin.default]) A composite control that incorporates a :py:class:`Slider`, a play/pause button and text widgets that display the time. By itself, the :py:class:`MediaControl` is independent of a media node. The controlling application is responsible for keeping track of media node and :py:class:`MediaControl` state and syncing the two. **Messages:** .. py:method:: PLAY_CLICKED() Emitted when the play/pause toggle is switched to play. .. py:method:: PAUSE_CLICKED() Emitted when the play/pause toggle is switched to pause. .. py:method:: SEEK_PRESSED() Emitted when the user starts dragging the seek thumb. .. py:method:: SEEK_MOTION(curTime) Emitted when the user moves the seek thumb. .. py:method:: SEEK_RELEASED() Emitted when the user releases the seek thumb. .. py:attribute:: duration Duration of the medium in milliseconds. .. py:attribute:: time Current media time in milliseconds. .. py:method:: play() Switches to play mode by toggling the button. .. py:method:: pause() Switches to pause mode by toggling the button. .. autoclass:: Orientation() .. py:data:: HORIZONTAL .. py:data:: VERTICAL .. autoclass:: ProgressBar(orientation, [skinObj=skin.Skin.default, height=0, width=0, range=(0.,1.), value=0.0]) A horizontal bar-shaped UI element that indicates the progression of an operation. .. py:attribute:: range Tuple giving minimum and maximum value. .. py:attribute:: value Current progression. The application is responsible for updating the value. In general, :py:attr:`value` will start at :py:attr:`range[0]` and end with :py:attr:`range[1]`. .. autoclass:: ScrollArea(contentNode, size[, skinObj=skin.Skin.default, enabled=True, scrollBars=(Orientation.HORIZONTAL, Orientation.VERTICAL)]) A rectangular area that allows a user to choose a view into arbitrary content. The content can be larger than the :py:class:`ScrollArea`, in which case scroll bars can be used to allow the user to choose which part to view. Dragging the content to determine the viewport is also supported. A :py:class:`ScrollArea` uses :py:class:`ScrollPane` and :py:class:`ScrollBar` objects internally. **Messages:** To get these messages, call :py:meth:`Publisher.subscribe`. .. py:method:: PRESSED() Emitted when a content drag is initiated. .. py:method:: RELEASED() Emitted when a content drag is finished. .. py:method:: CONTENT_POS_CHANGED(pos) Emitted when the viewport changes for any reason. .. py:attribute:: contentsize The size of the :py:attr:`contentNode`. .. py:attribute:: contentpos The position of the content within the area. .. autoclass:: ScrollBar([orientation=Orientation.HORIZONTAL, skinObj=skin.Skin.default, enabled=True, height=0, width=0, range=(0.,1.), thumbPos=0.0, thumbExtent=0.1]) A vertical or horizontal scroll bar. **Messages:** To get these messages, call :py:meth:`Publisher.subscribe`. .. py:method:: PRESSED() Emitted when a drag is initiated. .. py:method:: RELEASED() Emitted when a drag is finished. .. py:method:: THUMB_POS_CHANGED(pos) Emitted when the thumb is dragged. .. py:attribute:: range Minimum and maximum values for the thumb. .. py:attribute:: thumbPos .. py:attribute:: thumbExtent .. autoclass:: ScrollPane(contentNode) A rectangular view into arbitrary content. No user interaction is implemented. .. py:attribute:: contentpos .. py:attribute:: contentsize .. autoclass:: Skin(skinXmlFName[, mediaDir=""]) A :py:class:`Skin` determines the appearance of any user interface elements that use it. Skin configuration is determined by an xml file. This xml file determines the bitmaps to use and the sizes of various components. It also determines the fonts used by the elements. Skinnable user interface elements include :py:class:`TextButton`, :py:class:`Slider`, :py:class:`ScrollBar`, :py:class:`ProgressBar`, :py:class:`ScrollArea`, :py:class:`CheckBox` and :py:class:`MediaControl`. In addition, the fonts defined can be accessed by the application. The default skin xml file is located at :samp:`src/python/data/SimpleSkin.xml`. It provides a good basis from which to create your own skin. :param string skinXmlFName: The name of the xml configuration file. :param string mediaDir: The location of the image files to use. .. py:attribute:: fonts: A dictionary of :py:class:`FontStyle` objects created from the xml configuration file. .. autoclass:: Slider([orientation=Orientation.HORIZONTAL, skinObj=skin.Skin.default]) Sliders are horizontal or vertical bar with a draggable thumb that can be used to set a value. In contrast to a scroll bar, the slider's thumb has no range. **Messages:** To get these messages, call :py:meth:`Publisher.subscribe`. .. py:method:: PRESSED() Emitted when a drag is initiated. .. py:method:: RELEASED() Emitted when a drag is finished. .. py:method:: THUMB_POS_CHANGED(pos) Emitted when the thumb is dragged. .. py:attribute:: range Minimum and maximum values for the thumb. .. py:attribute:: thumbPos .. autoclass:: SwitchNode([nodeMap=None, visibleid=None]) A :py:class:`DivNode` that keeps a map of child nodes and shows only one of the map members at any time. :param map nodeMap: A map :py:const:`id->node` that contains the nodes to switch between. .. py:method:: setNodeMap(nodeMap) Can be used to set the :py:attr:`nodeMap` after construction if no node map was set before. .. py:attribute:: visibleid The id of the visible child node. .. autoclass:: TextButton(text, [skinObj=skin.Skin.default]) A :py:class:`Button` that is created using the given :py:class:`Skin` and a text. .. py:attribute:: text The string displayed on the button. .. autoclass:: TimeSlider() Works like a :py:class:`ProgressBar` with an additional slider thumb. .. autoclass:: ToggleButton(uncheckedUpNode, uncheckedDownNode, checkedUpNode, checkedDownNode, [uncheckedDisabledNode=None, checkedDisabledNode=None, activeAreaNode=None, fatFingerEnlarge=False, enabled=True, checked=False]) A button that can be used to toggle between checked and unchecked states. Classical GUI checkboxes are an example of this kind of button. A :py:class:`ToggleButton` has a total of six visual states. In addition to the distinction between checked and unchecked, a button can be enabled or disabled. Buttons also change their appearance as soon as they are touched, leading to two further states. For each visual state, a node is passed as constructor parameter. The constructor attaches the nodes to the :py:class:`ToggleButton`. Uses the :py:class:`TapRecognizer` to detect clicks. .. image:: ToggleButtonStates.png :param avg.Node uncheckedUpNode: The node displayed when the button is unchecked and not touched. :param avg.Node uncheckedDownNode: The node displayed when the button is unchecked and touched. :param avg.Node checkedUpNode: The node displayed when the button is checked and not touched. :param avg.Node checkedDownNode: The node displayed when the button is checked and not touched. :param avg.Node uncheckedDisabledNode: The node displayed when the button is unchecked and disabled. :param avg.Node checkedDisabledNode: The node displayed when the button is checked and disabled. :param avg.Node activeAreaNode: A node that is used only to determine if a click is over the button. Usually, this node is invisible. :py:attr:`activeAreaNode` is useful for small touch buttons, where the active area should be larger than the visible button to account for touch inaccuracies. :param bool fatFingerEnlarge: If this parameter is set to :py:const:`True`, the button generates its own internal :py:attr:`activeAreaNode` that is at least 20x20mm large. :py:attr:`fatFingerEnlarge` is incompatible with a custom :py:attr:`activeAreaNode`. :param bool checked: If this parameter is set to :py:const:`True`, the button starts in the checked state. :param bool enabled: If this parameter is set to :py:const:`True`, the button starts in the disabled state. **Messages:** To get these messages, call :py:meth:`Publisher.subscribe`. .. py:method:: Button.PRESSED() Called when a tap on the button is initiated. .. py:method:: Button.RELEASED() Called when a tap on the button ends. Emitted for both successful and aborted taps. .. py:method:: Button.TOGGLED() Called when the button changes from unchecked to checked or vice-versa. .. py:attribute:: checked The state of the toggle. .. py:attribute:: enabled Determines whether the button accepts input. .. autoclass:: VStretchNode(endsExtent, [src=None, minExtent=-1]) A node that stretches its graphics to fill the size given vertically. It is used as base component for scrollbars. The base bitmap is split into three parts: top, center and bottom. The top and bottom parts are :py:attr:`endsExtent` wide and generated from the corresponding parts of the source bitmap. The center part is generated from a one pixel high slice of the source bitmap and stretched to fill the space left between the top and bottom parts. :param int endsExtent: Width of the top and bottom bitmaps in pixels. :param src: Either the name of a bitmap file or a :py:class:`Bitmap` object. Used to generate the graphics used. :param int minExtent: Minimum vertical size. The default of :py:const:`-1` uses :py:const:`2*endsExtent+1` as minimum. libavg-1.8.2/src/000077500000000000000000000000001236127404500135615ustar00rootroot00000000000000libavg-1.8.2/src/Makefile.am000066400000000000000000000010731236127404500156160ustar00rootroot00000000000000SUBDIRS = base graphics imaging lmfit oscpack audio video player \ anim wrapper python test utils samples EXTRA_DIST = avgrc avgconfigwrapper.h api.h avgconfig_win.h version.h \ $(wildcard glm/*.hpp) $(wildcard glm/core/*.hpp) $(wildcard glm/core/*.inl) \ $(wildcard glm/gtc/*.hpp) $(wildcard glm/gtc/*.inl) \ $(wildcard glm/gtx/*.hpp) $(wildcard glm/gtx/*.inl) \ $(wildcard glm/virtrev/*.hpp) BUILT_SOURCES = version.h DISTCLEANFILES = version.h version.h: FORCE $(top_srcdir)/CreateVersionFile.py $(top_builddir)/src FORCE: libavg-1.8.2/src/addcopyright.py000077500000000000000000000013241236127404500166170ustar00rootroot00000000000000#!/usr/bin/python import sys, os, fnmatch CopyrightNoticeLines = file("Copyright").read().splitlines() for dir in ["base", "conradrelais", "graphics", "parport", "player", "python"]: files = os.listdir(dir) for f in files: if fnmatch.fnmatch(f, "*.cpp") or fnmatch.fnmatch(f, "*.h"): fname = dir+"/"+f print "Processing " + fname fobj = file(fname, "r+") str = fobj.read() lines = str.splitlines() while lines[0].find('//') == 0: lines = lines[1:] lines = CopyrightNoticeLines+lines fobj.seek(0) fobj.truncate() for line in lines: fobj.write(line+"\n") libavg-1.8.2/src/anim/000077500000000000000000000000001236127404500145055ustar00rootroot00000000000000libavg-1.8.2/src/anim/Anim.cpp000066400000000000000000000057321236127404500161040ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de #include "Anim.h" #include "../base/Exception.h" #include "../base/ObjectCounter.h" #include "../player/Player.h" using namespace boost::python; using namespace std; namespace avg { Anim::Anim(const object& startCallback, const object& stopCallback) : m_StartCallback(startCallback), m_StopCallback(stopCallback), m_bRunning(false), m_bIsRoot(true) { ObjectCounter::get()->incRef(&typeid(*this)); Player::get()->registerPlaybackEndListener(this); } Anim::~Anim() { ObjectCounter::get()->decRef(&typeid(*this)); if (Player::exists()) { Player::get()->unregisterPlaybackEndListener(this); } } void Anim::setStartCallback(const object& startCallback) { m_StartCallback = startCallback; } void Anim::setStopCallback(const object& stopCallback) { m_StopCallback = stopCallback; } void Anim::start(bool) { if (m_bRunning) { throw(Exception(AVG_ERR_UNSUPPORTED, "Anim.start(): animation already running.")); } if (!(Player::get()->isPlaying())) { throw(Exception(AVG_ERR_UNSUPPORTED, "Animation playback can only be started when the player is running.")); } m_bRunning = true; if (m_bIsRoot) { Player::get()->registerPreRenderListener(this); } if (m_StartCallback != object()) { call(m_StartCallback.ptr()); } } bool Anim::isRunning() const { return m_bRunning; } void Anim::setHasParent() { assert(!m_bRunning); m_bIsRoot = false; } void Anim::onPreRender() { step(); } void Anim::onPlaybackEnd() { AnimPtr tempThis = shared_from_this(); m_StartCallback = object(); m_StopCallback = object(); if (m_bRunning) { abort(); } } void Anim::setStopped() { if (m_bIsRoot) { Player::get()->unregisterPreRenderListener(this); } m_bRunning = false; if (m_StopCallback != object()) { try { m_StopCallback(); } catch (error_already_set &) { cerr << "Python exception in Anim stop callback." << endl; PyErr_Print(); exit(5); } } } } libavg-1.8.2/src/anim/Anim.h000066400000000000000000000046021236127404500155440ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _Anim_H_ #define _Anim_H_ #include "../api.h" // Python docs say python.h should be included before any standard headers (!) #include "../player/WrapPython.h" #include "../base/IPreRenderListener.h" #include "../base/IPlaybackEndListener.h" #include #include #include #include #include namespace avg { class Anim; class GroupAnim; typedef boost::shared_ptr AnimPtr; typedef boost::weak_ptr AnimWeakPtr; class AVG_API Anim: public boost::enable_shared_from_this, IPreRenderListener, IPlaybackEndListener { public: Anim(const boost::python::object& startCallback, const boost::python::object& stopCallback); virtual ~Anim(); void setStartCallback(const boost::python::object& startCallback); void setStopCallback(const boost::python::object& stopCallback); virtual void start(bool bKeepAttr=false); virtual void abort() = 0; bool isRunning() const; void setHasParent(); virtual void onPreRender(); virtual void onPlaybackEnd(); virtual bool step() = 0; protected: void setStopped(); private: Anim(); Anim(const Anim&); boost::python::object m_StartCallback; boost::python::object m_StopCallback; bool m_bRunning; bool m_bIsRoot; }; template bool isPythonType(const boost::python::object& obj) { boost::python::extract ext(obj); return ext.check(); } } #endif libavg-1.8.2/src/anim/AttrAnim.cpp000066400000000000000000000050101236127404500167240ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de #include "AttrAnim.h" #include "../base/Exception.h" #include "../player/Player.h" #include "../player/Node.h" using namespace boost; using namespace boost::python; using namespace std; namespace avg { AttrAnim::AttrAnimationMap AttrAnim::s_ActiveAnimations; bool ObjAttrID::operator < (const ObjAttrID& other) const { if (m_ObjHash < other.m_ObjHash) { return true; } else if (m_ObjHash > other.m_ObjHash) { return false; } else if (m_sAttrName < other.m_sAttrName) { return true; } else { return false; } } int AttrAnim::getNumRunningAnims() { return s_ActiveAnimations.size(); } AttrAnim::AttrAnim(const object& node, const string& sAttrName, const object& startCallback, const object& stopCallback) : Anim(startCallback, stopCallback), m_Node(node), m_sAttrName(sAttrName) { object obj = getValue(); } AttrAnim::~AttrAnim() { } void AttrAnim::start(bool bKeepAttr) { stopActiveAttrAnim(); Anim::start(); addToMap(); } object AttrAnim::getValue() const { return m_Node.attr(m_sAttrName.c_str()); } void AttrAnim::setValue(const object& val) { m_Node.attr(m_sAttrName.c_str()) = val; } void AttrAnim::addToMap() { s_ActiveAnimations[ObjAttrID(m_Node, m_sAttrName)] = dynamic_pointer_cast(shared_from_this()); } void AttrAnim::removeFromMap() { s_ActiveAnimations.erase(ObjAttrID(m_Node, m_sAttrName)); } void AttrAnim::stopActiveAttrAnim() { ObjAttrID id(m_Node, m_sAttrName); AttrAnimationMap::iterator it = s_ActiveAnimations.find(id); if (it != s_ActiveAnimations.end()) { it->second->abort(); } } } libavg-1.8.2/src/anim/AttrAnim.h000066400000000000000000000046401236127404500164010ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _AttrAnim_H_ #define _AttrAnim_H_ #include "Anim.h" #include "../api.h" // Python docs say python.h should be included before any standard headers (!) #include "../player/WrapPython.h" #include #include #include #include #include namespace avg { struct ObjAttrID { ObjAttrID(const boost::python::object& obj, const std::string& sAttrName) : m_ObjHash(boost::python::extract(obj.attr("__hash__")())), m_sAttrName(sAttrName) { } long m_ObjHash; std::string m_sAttrName; bool operator < (const ObjAttrID& other) const; }; class AttrAnim; typedef boost::shared_ptr AttrAnimPtr; typedef boost::weak_ptr AttrAnimWeakPtr; class AVG_API AttrAnim: public Anim { public: static int getNumRunningAnims(); AttrAnim(const boost::python::object& node, const std::string& sAttrName, const boost::python::object& startCallback, const boost::python::object& stopCallback); virtual ~AttrAnim(); virtual void start(bool bKeepAttr=false); protected: boost::python::object getValue() const; void setValue(const boost::python::object& val); void addToMap(); void removeFromMap(); void stopActiveAttrAnim(); private: AttrAnim(); AttrAnim(const AttrAnim&); boost::python::object m_Node; std::string m_sAttrName; typedef std::map AttrAnimationMap; static AttrAnimationMap s_ActiveAnimations; }; } #endif libavg-1.8.2/src/anim/ContinuousAnim.cpp000066400000000000000000000052631236127404500201720ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "ContinuousAnim.h" #include "../base/Exception.h" #include "../base/MathHelper.h" #include "../player/Player.h" using namespace boost::python; using namespace std; namespace avg { ContinuousAnim::ContinuousAnim(const object& node, const string& sAttrName, const object& startValue, const object& speed, bool bUseInt, const object& startCallback, const object& stopCallback) : AttrAnim(node, sAttrName, startCallback, stopCallback), m_StartValue(startValue), m_Speed(speed), m_bUseInt(bUseInt) { } ContinuousAnim::~ContinuousAnim() { } void ContinuousAnim::start(bool bKeepAttr) { AttrAnim::start(); if (!bKeepAttr) { setValue(m_StartValue); } m_EffStartValue = getValue(); m_StartTime = Player::get()->getFrameTime(); } void ContinuousAnim::abort() { if (isRunning()) { AnimPtr tempThis = shared_from_this(); removeFromMap(); setStopped(); } } bool ContinuousAnim::step() { object curValue; float time = (Player::get()->getFrameTime()-m_StartTime)/1000.0f; if (isPythonType(m_EffStartValue)) { curValue = object(time*extract(m_Speed)+m_EffStartValue); if (m_bUseInt) { float d = extract(curValue); curValue = object(round(d)); } } else if (isPythonType(m_EffStartValue)) { glm::vec2 pt = extract(m_Speed)(); curValue = object(time*pt+m_EffStartValue); if (m_bUseInt) { glm::vec2 pt = extract(curValue)(); curValue = object(glm::vec2(round(pt.x), round(pt.y))); } } else { throw (Exception(AVG_ERR_TYPE, "Animated attributes must be either numbers or Point2D.")); } setValue(curValue); return false; } } libavg-1.8.2/src/anim/ContinuousAnim.h000066400000000000000000000033621236127404500176350ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _ContinuousAnim_H_ #define _ContinuousAnim_H_ #include "../api.h" #include "SimpleAnim.h" namespace avg { class AVG_API ContinuousAnim: public AttrAnim { public: ContinuousAnim(const boost::python::object& node, const std::string& sAttrName, const boost::python::object& startValue, const boost::python::object& speed, bool bUseInt=false, const boost::python::object& startCallback=boost::python::object(), const boost::python::object& stopCallback=boost::python::object()); virtual ~ContinuousAnim(); virtual void start(bool bKeepAttr=false); virtual void abort(); virtual bool step(); private: boost::python::object m_StartValue; boost::python::object m_Speed; bool m_bUseInt; boost::python::object m_EffStartValue; long long m_StartTime; }; } #endif libavg-1.8.2/src/anim/EaseInOutAnim.cpp000066400000000000000000000045211236127404500176540ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "EaseInOutAnim.h" #include "../player/Player.h" #include "../base/MathHelper.h" #include using namespace boost::python; using namespace std; namespace avg { EaseInOutAnim::EaseInOutAnim(const object& node, const string& sAttrName, long long duration, const object& startValue, const object& endValue, long long easeInDuration, long long easeOutDuration, bool bUseInt, const object& startCallback, const object& stopCallback) : SimpleAnim(node, sAttrName, duration, startValue, endValue, bUseInt, startCallback, stopCallback), m_EaseInDuration(float(easeInDuration)/duration), m_EaseOutDuration(float(easeOutDuration)/duration) { } EaseInOutAnim::~EaseInOutAnim() { } float EaseInOutAnim::interpolate(float t) { float accelDist = m_EaseInDuration*2/PI; float decelDist = m_EaseOutDuration*2/PI; float dist; if (t 1-m_EaseOutDuration) { // Deceleration stage float nt = (t-(1-m_EaseOutDuration))/m_EaseOutDuration; float s = sin(nt*PI/2); dist = accelDist+(1-m_EaseInDuration-m_EaseOutDuration)+s*decelDist; } else { // Linear stage dist = accelDist+t-m_EaseInDuration; } return dist/(accelDist+(1-m_EaseInDuration-m_EaseOutDuration)+decelDist); } } libavg-1.8.2/src/anim/EaseInOutAnim.h000066400000000000000000000032511236127404500173200ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _EaseInOutAnim_H_ #define _EaseInOutAnim_H_ #include "../api.h" #include "SimpleAnim.h" namespace avg { class AVG_API EaseInOutAnim: public SimpleAnim { public: EaseInOutAnim(const boost::python::object& node, const std::string& sAttrName, long long duration, const boost::python::object& pStartValue, const boost::python::object& pEndValue, long long easeInDuration, long long easeOutDuration, bool bUseInt=false, const boost::python::object& startCallback=boost::python::object(), const boost::python::object& stopCallback=boost::python::object()); virtual ~EaseInOutAnim(); protected: virtual float interpolate(float t); private: float m_EaseInDuration; float m_EaseOutDuration; }; } #endif libavg-1.8.2/src/anim/LinearAnim.cpp000066400000000000000000000043311236127404500172310ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "LinearAnim.h" #include "../player/Player.h" using namespace boost::python; using namespace std; namespace avg { LinearAnim::LinearAnim(const object& node, const string& sAttrName, long long duration, const object& startValue, const object& endValue, bool bUseInt, const object& startCallback, const object& stopCallback) : SimpleAnim(node, sAttrName, duration, startValue, endValue, bUseInt, startCallback, stopCallback) { } LinearAnim::~LinearAnim() { } float LinearAnim::interpolate(float t) { return t; } float LinearAnim::getStartPart(float start, float end, float cur) { return (cur-start)/(end-start); } AnimPtr fadeIn(const boost::python::object& node, long long duration, float max, const boost::python::object& stopCallback) { object startVal = node.attr("opacity"); AnimPtr pAnim(new LinearAnim(node, "opacity", duration, startVal, object(max), false, object(), stopCallback)); pAnim->start(false); return pAnim; } AnimPtr fadeOut(const boost::python::object& node, long long duration, const boost::python::object& stopCallback) { object startVal = node.attr("opacity"); AnimPtr pAnim(new LinearAnim(node, "opacity", duration, startVal, object(0), false, object(), stopCallback)); pAnim->start(true); return pAnim; } } libavg-1.8.2/src/anim/LinearAnim.h000066400000000000000000000036441236127404500167040ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _LinearAnim_H_ #define _LinearAnim_H_ #include "../api.h" #include "SimpleAnim.h" namespace avg { class AVG_API LinearAnim: public SimpleAnim { public: LinearAnim(const boost::python::object& node, const std::string& sAttrName, long long duration, const boost::python::object& pStartValue, const boost::python::object& pEndValue, bool bUseInt=false, const boost::python::object& startCallback=boost::python::object(), const boost::python::object& stopCallback=boost::python::object()); virtual ~LinearAnim(); protected: virtual float interpolate(float t); private: float getStartPart(float start, float end, float cur); }; AnimPtr fadeIn(const boost::python::object& node, long long duration, float max=1.0f, const boost::python::object& stopCallback=boost::python::object()); AnimPtr fadeOut(const boost::python::object& node, long long duration, const boost::python::object& stopCallback=boost::python::object()); } #endif libavg-1.8.2/src/anim/Makefile.am000066400000000000000000000006341236127404500165440ustar00rootroot00000000000000AM_CPPFLAGS = -I.. @XML2_CFLAGS@ @PYTHON_CPPFLAGS@ ALL_H = Anim.h SimpleAnim.h LinearAnim.h AttrAnim.h ContinuousAnim.h EaseInOutAnim.h \ WaitAnim.h ParallelAnim.h StateAnim.h ALL_CPP = Anim.cpp SimpleAnim.cpp LinearAnim.cpp AttrAnim.cpp ContinuousAnim.cpp \ EaseInOutAnim.cpp WaitAnim.cpp ParallelAnim.cpp StateAnim.cpp noinst_LTLIBRARIES = libanim.la libanim_la_SOURCES = $(ALL_CPP) $(ALL_H) libavg-1.8.2/src/anim/ParallelAnim.cpp000066400000000000000000000060071236127404500175550ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "ParallelAnim.h" #include "../player/Player.h" using namespace boost; using namespace boost::python; using namespace std; namespace avg { ParallelAnim::ParallelAnim(const vector& anims, const object& startCallback, const object& stopCallback, long long maxAge) : Anim(startCallback, stopCallback), m_Anims(anims), m_MaxAge(maxAge) { vector::iterator it; for (it=m_Anims.begin(); it != m_Anims.end(); ++it) { (*it)->setHasParent(); } } ParallelAnim::~ParallelAnim() { if (Player::exists()) { abort(); } } void ParallelAnim::start(bool bKeepAttr) { Anim::start(); m_StartTime = Player::get()->getFrameTime(); vector::iterator it; for (it=m_Anims.begin(); it != m_Anims.end(); ++it) { (*it)->start(bKeepAttr); if ((*it)->isRunning()) { m_RunningAnims.push_back(*it); } m_This = dynamic_pointer_cast(shared_from_this()); } } void ParallelAnim::abort() { if (isRunning()) { vector::iterator it; for (it=m_RunningAnims.begin(); it != m_RunningAnims.end(); ++it) { (*it)->abort(); } m_RunningAnims.clear(); setStopped(); ParallelAnimPtr tempThis = m_This; m_This = ParallelAnimPtr(); tempThis = ParallelAnimPtr(); } } bool ParallelAnim::step() { assert(isRunning()); vector::iterator it; for (it=m_RunningAnims.begin(); it != m_RunningAnims.end(); ) { AnimPtr pAnim = (*it); bool bDone; if (pAnim->isRunning()) { bDone = pAnim->step(); } else { bDone = true; } if (bDone) { it = m_RunningAnims.erase(it); } else { ++it; } } if (m_RunningAnims.empty()) { setStopped(); ParallelAnimPtr tempThis = m_This; m_This = ParallelAnimPtr(); tempThis = ParallelAnimPtr(); return true; } if (m_MaxAge != -1 && Player::get()->getFrameTime()-m_StartTime >= m_MaxAge) { abort(); return true; } return false; } } libavg-1.8.2/src/anim/ParallelAnim.h000066400000000000000000000034371236127404500172260ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _ParallelAnim_H_ #define _ParallelAnim_H_ #include "../api.h" #include "Anim.h" #include namespace avg { class ParallelAnim; typedef boost::shared_ptr ParallelAnimPtr; class AVG_API ParallelAnim: public Anim { public: virtual ~ParallelAnim(); ParallelAnim(const std::vector& anims, const boost::python::object& startCallback=boost::python::object(), const boost::python::object& stopCallback=boost::python::object(), long long maxAge=-1); virtual void start(bool bKeepAttr=false); virtual void abort(); virtual bool step(); private: std::vector m_Anims; std::vector m_RunningAnims; long long m_MaxAge; long long m_StartTime; ParallelAnimPtr m_This; // Makes sure there is always a reference to the animation // while it's running. }; } #endif libavg-1.8.2/src/anim/SimpleAnim.cpp000066400000000000000000000121761236127404500172560ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de #include "SimpleAnim.h" #include "../base/Exception.h" #include "../base/MathHelper.h" #include "../player/Player.h" using namespace boost; using namespace boost::python; using namespace std; namespace avg { SimpleAnim::SimpleAnim(const object& node, const string& sAttrName, long long duration, const object& startValue, const object& endValue, bool bUseInt, const object& startCallback, const object& stopCallback) : AttrAnim(node, sAttrName, startCallback, stopCallback), m_Duration(duration), m_StartValue(startValue), m_EndValue(endValue), m_bUseInt(bUseInt) { } SimpleAnim::~SimpleAnim() { if (Player::exists() && isRunning()) { setStopped(); } } void SimpleAnim::start(bool bKeepAttr) { AttrAnim::start(); if (bKeepAttr) { m_StartTime = calcStartTime(); } else { m_StartTime = Player::get()->getFrameTime(); } if (m_Duration == 0) { setValue(m_EndValue); remove(); } else { step(); } } void SimpleAnim::abort() { if (isRunning()) { remove(); } } template object typedLERP(const object& startValue, const object& endValue, float part) { T start = extract(startValue); T end = extract(endValue); T cur = start+(end-start)*part; return object(cur); } bool SimpleAnim::step() { assert(isRunning()); float t = ((float(Player::get()->getFrameTime())-m_StartTime) /m_Duration); if (t >= 1.0) { setValue(m_EndValue); remove(); return true; } else { object curValue; float part = interpolate(t); if (isPythonType(m_StartValue)) { curValue = typedLERP(m_StartValue, m_EndValue, part); if (m_bUseInt) { float d = extract(curValue); curValue = object(round(d)); } } else if (isPythonType(m_StartValue)) { curValue = typedLERP(m_StartValue, m_EndValue, part); if (m_bUseInt) { glm::vec2 pt = extract(curValue); curValue = object(glm::vec2(round(pt.x), round(pt.y))); } } else { throw (Exception(AVG_ERR_TYPE, "Animated attributes must be either numbers or Point2D.")); } setValue(curValue); return false; } } long long SimpleAnim::getStartTime() const { return m_StartTime; } long long SimpleAnim::getDuration() const { return m_Duration; } long long SimpleAnim::calcStartTime() { float part; if (isPythonType(m_StartValue)) { if (m_EndValue == m_StartValue) { part = 0; } else { part = getStartPart(extract(m_StartValue), extract(m_EndValue), extract(getValue())); } } else if (isPythonType(m_StartValue)) { float start = glm::vec2(extract(m_StartValue)()).x; float end = glm::vec2(extract(m_EndValue)()).x; float cur = glm::vec2(extract(getValue())()).x; if (start == end) { start = glm::vec2(extract(m_StartValue)()).y; end = glm::vec2(extract(m_EndValue)()).y; cur = glm::vec2(extract(getValue())()).y; } if (start == end) { part = 0; } else { part = getStartPart(start, end, cur); } } else { throw (Exception(AVG_ERR_TYPE, "Animated attributes must be either numbers or Point2D.")); } return Player::get()->getFrameTime()-(long long)(part*getDuration()); } float SimpleAnim::getStartPart(float start, float end, float cur) { float tstart = 0; float tend = 1; bool bDir = (start < end); for (int i=0; i<10; ++i) { float tmiddle = (tstart+tend)/2; float part = interpolate(tmiddle); float middle = start+(end-start)*part; if ((bDir && middle < cur) || (!bDir && middle >= cur)) { tstart = tmiddle; } else { tend = tmiddle; } } return (tend+tstart)/2; } void SimpleAnim::remove() { AnimPtr tempThis = shared_from_this(); removeFromMap(); setStopped(); } } libavg-1.8.2/src/anim/SimpleAnim.h000066400000000000000000000042541236127404500167210ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _SimpleAnim_H_ #define _SimpleAnim_H_ #include "../api.h" // Python docs say python.h should be included before any standard headers (!) #include "../player/WrapPython.h" #include "AttrAnim.h" #include #include #include namespace avg { class SimpleAnim; typedef boost::shared_ptr SimpleAnimPtr; class AVG_API SimpleAnim: public AttrAnim { public: SimpleAnim(const boost::python::object& node, const std::string& sAttrName, long long duration, const boost::python::object& pStartValue, const boost::python::object& pEndValue, bool bUseInt, const boost::python::object& startCallback, const boost::python::object& stopCallback); virtual ~SimpleAnim()=0; virtual void start(bool bKeepAttr=false); virtual void abort(); virtual bool step(); protected: virtual float interpolate(float t)=0; void remove(); private: long long getStartTime() const; long long getDuration() const; long long calcStartTime(); virtual float getStartPart(float start, float end, float cur); long long m_Duration; boost::python::object m_StartValue; boost::python::object m_EndValue; bool m_bUseInt; long long m_StartTime; }; } #endif libavg-1.8.2/src/anim/StateAnim.cpp000066400000000000000000000061231236127404500171000ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "StateAnim.h" #include "../base/Exception.h" #include "../player/Player.h" using namespace boost::python; using namespace std; namespace avg { AnimState::AnimState(const string& sName, AnimPtr pAnim, const string& sNextName) : m_sName(sName), m_pAnim(pAnim), m_sNextName(sNextName) { } AnimState::AnimState() { } StateAnim::StateAnim(const vector& states) : Anim(object(), object()), m_bDebug(false) { vector::const_iterator it; for (it=states.begin(); it != states.end(); ++it) { m_States[(*it).m_sName] = *it; it->m_pAnim->setHasParent(); } } StateAnim::~StateAnim() { setState(""); } void StateAnim::abort() { setState(""); } void StateAnim::setState(const std::string& sName, bool bKeepAttr) { if (m_sCurStateName == sName) { return; } if (!m_sCurStateName.empty()) { m_States[m_sCurStateName].m_pAnim->abort(); } switchToNewState(sName, bKeepAttr); } const std::string& StateAnim::getState() const { return m_sCurStateName; } void StateAnim::setDebug(bool bDebug) { m_bDebug = bDebug; } bool StateAnim::step() { // Make sure the object isn't deleted until the end of the method. AnimPtr tempThis = shared_from_this(); if (!m_sCurStateName.empty()) { const AnimState& curState = m_States[m_sCurStateName]; bool bDone = curState.m_pAnim->step(); if (bDone) { switchToNewState(curState.m_sNextName, false); } } return false; } void StateAnim::switchToNewState(const string& sName, bool bKeepAttr) { if (m_bDebug) { cerr << this << " State change: '" << m_sCurStateName << "' --> '" << sName << "'" << endl; } string sOldStateName = m_sCurStateName; m_sCurStateName = sName; if (!sName.empty()) { map::iterator it = m_States.find(sName); if (it == m_States.end()) { throw Exception(AVG_ERR_INVALID_ARGS, "StateAnim: State "+sName+" unknown."); } else { it->second.m_pAnim->start(bKeepAttr); } if (sOldStateName == "") { Anim::start(false); } } else { Anim::setStopped(); } } } libavg-1.8.2/src/anim/StateAnim.h000066400000000000000000000033531236127404500165470ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _StateAnim_H_ #define _StateAnim_H_ #include "../api.h" #include "Anim.h" #include #include namespace avg { struct AVG_API AnimState { AnimState(const std::string& sName, AnimPtr pAnim, const std::string& sNextName = ""); AnimState(); std::string m_sName; AnimPtr m_pAnim; std::string m_sNextName; }; class AVG_API StateAnim: public Anim { public: StateAnim(const std::vector& states); virtual ~StateAnim(); virtual void abort(); virtual void setState(const std::string& sName, bool bKeepAttr=false); const std::string& getState() const; void setDebug(bool bDebug); virtual bool step(); private: void switchToNewState(const std::string& sName, bool bKeepAttr); std::map m_States; bool m_bDebug; std::string m_sCurStateName; }; } #endif libavg-1.8.2/src/anim/WaitAnim.cpp000066400000000000000000000033401236127404500167220ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "WaitAnim.h" #include "../player/Player.h" using namespace boost; using namespace boost::python; using namespace std; namespace avg { WaitAnim::WaitAnim(long long duration, const object& startCallback, const object& stopCallback) : Anim(startCallback, stopCallback), m_Duration(duration) { } WaitAnim::~WaitAnim() { } void WaitAnim::start(bool bKeepAttr) { m_pThis = dynamic_pointer_cast(shared_from_this()); Anim::start(); m_StartTime = Player::get()->getFrameTime(); } void WaitAnim::abort() { setStopped(); m_pThis = WaitAnimPtr(); } bool WaitAnim::step() { assert(isRunning()); if (m_Duration != -1 && Player::get()->getFrameTime()-m_StartTime > m_Duration) { setStopped(); m_pThis = WaitAnimPtr(); return true; } else { return false; } } } libavg-1.8.2/src/anim/WaitAnim.h000066400000000000000000000030751236127404500163740ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _WaitAnim_H_ #define _WaitAnim_H_ #include "../api.h" #include "SimpleAnim.h" namespace avg { class WaitAnim; typedef boost::shared_ptr WaitAnimPtr; class AVG_API WaitAnim: public Anim { public: WaitAnim(long long duration = -1, const boost::python::object& startCallback=boost::python::object(), const boost::python::object& stopCallback=boost::python::object()); virtual ~WaitAnim(); virtual void start(bool bKeepAttr=false); virtual void abort(); virtual bool step(); private: long long m_Duration; long long m_StartTime; WaitAnimPtr m_pThis; // Make sure we're not deleted while running. }; } #endif libavg-1.8.2/src/api.h000066400000000000000000000031371236127404500145070ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // // Original author of this file is Jan Boelsche (regular.gonzales@googlemail.com). // #ifndef _API_H_ #define _API_H_ #ifdef _WIN32 // in declspec land #pragma warning(disable: 4251) #define AVG_PLUGIN_API extern "C" __declspec(dllexport) #ifdef AVG_PLUGIN #define AVG_API __declspec(dllimport) #define AVG_TEMPLATE_API #else #define AVG_API __declspec(dllexport) #define AVG_TEMPLATE_API __declspec(dllexport) #endif #else // not _WIN32, plain and simple #define AVG_API #define AVG_TEMPLATE_API #define AVG_PLUGIN_API extern "C" #endif #ifdef __APPLE__ // Workaround for snow leopard incompatibility between c++ headers and python headers: // always needs to be included before Python.h. #include #endif #endif libavg-1.8.2/src/audio/000077500000000000000000000000001236127404500146625ustar00rootroot00000000000000libavg-1.8.2/src/audio/AudioBuffer.cpp000066400000000000000000000045761236127404500175750ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // // Original author of this file is Nick Hebner (hebnern@gmail.com). // #include "AudioBuffer.h" #include #include #define VOLUME_FADE_SAMPLES 100 namespace avg { AudioBuffer::AudioBuffer(int numFrames, AudioParams ap) : m_NumFrames(numFrames), m_AP(ap) { m_pData = new short[numFrames*sizeof(short)*ap.m_Channels]; } AudioBuffer::~AudioBuffer() { delete[] m_pData; } short* AudioBuffer::getData() { return m_pData; } int AudioBuffer::getNumFrames() { return m_NumFrames; } int AudioBuffer::getNumBytes() { return m_NumFrames*m_AP.m_Channels*sizeof(short); } int AudioBuffer::getFrameSize() { return m_AP.m_Channels*sizeof(short); } int AudioBuffer::getNumChannels() { return m_AP.m_Channels; } int AudioBuffer::getRate() { return m_AP.m_SampleRate; } void AudioBuffer::clear() { memset(m_pData, 0, m_NumFrames*sizeof(short)*m_AP.m_Channels); } void AudioBuffer::volumize(float lastVol, float curVol) { float volDiff = lastVol - curVol; if (curVol == 1.0f && volDiff == 0.0f) { return; } for (int i = 0; i < m_NumFrames*m_AP.m_Channels; i++) { float fadeVol = 0; if (volDiff != 0 && i < VOLUME_FADE_SAMPLES) { fadeVol = volDiff * (VOLUME_FADE_SAMPLES - i) / VOLUME_FADE_SAMPLES; } int s = int(m_pData[i] * (curVol + fadeVol)); if (s < -32768) s = -32768; if (s > 32767) s = 32767; m_pData[i] = s; } } } libavg-1.8.2/src/audio/AudioBuffer.h000066400000000000000000000031351236127404500172300ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // // Original author of this file is Nick Hebner (hebnern@gmail.com). // #ifndef _AudioBuffer_H_ #define _AudioBuffer_H_ #include "../api.h" #include "AudioParams.h" #include namespace avg { class AVG_API AudioBuffer { public: AudioBuffer(int numFrames, AudioParams ap); virtual ~AudioBuffer(); short* getData(); int getNumFrames(); int getNumBytes(); int getFrameSize(); int getNumChannels(); int getRate(); void clear(); void volumize(float lastVol, float curVol); private: int m_NumFrames; short* m_pData; AudioParams m_AP; }; typedef boost::shared_ptr AudioBufferPtr; } #endif libavg-1.8.2/src/audio/AudioEngine.cpp000066400000000000000000000165041236127404500175630ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // // Original author of this file is Nick Hebner (hebnern@gmail.com). // #include "AudioEngine.h" #include "Dynamics.h" #include "../base/Exception.h" #include "../base/Logger.h" #include using namespace std; using namespace boost; namespace avg { AudioEngine* AudioEngine::s_pInstance = 0; AudioEngine* AudioEngine::get() { return s_pInstance; } AudioEngine::AudioEngine() : m_pTempBuffer(), m_pMixBuffer(0), m_pLimiter(0), m_bEnabled(true), m_Volume(1) { AVG_ASSERT(s_pInstance == 0); if (SDL_InitSubSystem(SDL_INIT_AUDIO) == -1) { AVG_LOG_ERROR("Can't init SDL audio subsystem."); exit(-1); } s_pInstance = this; } AudioEngine::~AudioEngine() { if (m_pMixBuffer) { delete[] m_pMixBuffer; } SDL_QuitSubSystem(SDL_INIT_AUDIO); m_AudioSources.clear(); } int AudioEngine::getChannels() { return m_AP.m_Channels; } int AudioEngine::getSampleRate() { return m_AP.m_SampleRate; } const AudioParams * AudioEngine::getParams() { if (isEnabled()) { return &m_AP; } else { return 0; } } void AudioEngine::init(const AudioParams& ap, float volume) { m_Volume = volume; m_AP = ap; Dynamics* pLimiter = new Dynamics(float(m_AP.m_SampleRate)); pLimiter->setThreshold(0.f); // in dB pLimiter->setAttackTime(0.f); // in seconds pLimiter->setReleaseTime(0.05f); // in seconds pLimiter->setRmsTime(0.f); // in seconds pLimiter->setRatio(std::numeric_limits::infinity()); pLimiter->setMakeupGain(0.f); // in dB m_pLimiter = pLimiter; SDL_AudioSpec desired; desired.freq = m_AP.m_SampleRate; desired.format = AUDIO_S16SYS; desired.channels = m_AP.m_Channels; desired.silence = 0; desired.samples = m_AP.m_OutputBufferSamples; desired.callback = audioCallback; desired.userdata = this; int err = SDL_OpenAudio(&desired, 0); if (err < 0) { static bool bWarned = false; if (!bWarned) { AVG_TRACE(Logger::category::CONFIG, Logger::severity::WARNING, "Can't open audio: " << SDL_GetError()); bWarned = true; } } } void AudioEngine::teardown() { { lock_guard lock(m_Mutex); SDL_PauseAudio(1); } // Optimized away - takes too long. // SDL_CloseAudio(); m_AudioSources.clear(); if (m_pLimiter) { delete m_pLimiter; m_pLimiter = 0; } } void AudioEngine::setAudioEnabled(bool bEnabled) { SDL_LockAudio(); lock_guard lock(m_Mutex); AVG_ASSERT(m_AudioSources.empty()); m_bEnabled = bEnabled; if (m_bEnabled) { play(); } else { pause(); } SDL_UnlockAudio(); } void AudioEngine::play() { SDL_PauseAudio(0); } void AudioEngine::pause() { SDL_PauseAudio(1); } int AudioEngine::addSource(AudioMsgQueue& dataQ, AudioMsgQueue& statusQ) { SDL_LockAudio(); lock_guard lock(m_Mutex); static int nextID = -1; nextID++; AudioSourcePtr pSrc(new AudioSource(dataQ, statusQ, m_AP.m_SampleRate)); m_AudioSources[nextID] = pSrc; SDL_UnlockAudio(); return nextID; } void AudioEngine::removeSource(int id) { SDL_LockAudio(); lock_guard lock(m_Mutex); int numErased = m_AudioSources.erase(id); AVG_ASSERT(numErased == 1); SDL_UnlockAudio(); } void AudioEngine::pauseSource(int id) { lock_guard lock(m_Mutex); AudioSourceMap::iterator itSource = m_AudioSources.find(id); AVG_ASSERT(itSource != m_AudioSources.end()); AudioSourcePtr pSource = itSource->second; pSource->pause(); } void AudioEngine::playSource(int id) { lock_guard lock(m_Mutex); AudioSourceMap::iterator itSource = m_AudioSources.find(id); AVG_ASSERT(itSource != m_AudioSources.end()); AudioSourcePtr pSource = itSource->second; pSource->play(); } void AudioEngine::notifySeek(int id) { lock_guard lock(m_Mutex); AudioSourceMap::iterator itSource = m_AudioSources.find(id); AVG_ASSERT(itSource != m_AudioSources.end()); AudioSourcePtr pSource = itSource->second; pSource->notifySeek(); } void AudioEngine::setSourceVolume(int id, float volume) { lock_guard lock(m_Mutex); AudioSourceMap::iterator itSource = m_AudioSources.find(id); AVG_ASSERT(itSource != m_AudioSources.end()); AudioSourcePtr pSource = itSource->second; pSource->setVolume(volume); } void AudioEngine::setVolume(float volume) { SDL_LockAudio(); lock_guard lock(m_Mutex); m_Volume = volume; SDL_UnlockAudio(); } float AudioEngine::getVolume() const { return m_Volume; } bool AudioEngine::isEnabled() const { return m_bEnabled; } void AudioEngine::mixAudio(Uint8 *pDestBuffer, int destBufferLen) { int numFrames = destBufferLen/(2*getChannels()); // 16 bit samples. if (m_AudioSources.size() == 0) { return; } if (!m_pTempBuffer || m_pTempBuffer->getNumFrames() < numFrames) { if (m_pTempBuffer) { delete[] m_pMixBuffer; } m_pTempBuffer = AudioBufferPtr(new AudioBuffer(numFrames, m_AP)); m_pMixBuffer = new float[getChannels()*numFrames]; } for (int i = 0; i < getChannels()*numFrames; ++i) { m_pMixBuffer[i]=0; } { lock_guard lock(m_Mutex); AudioSourceMap::iterator it; for (it = m_AudioSources.begin(); it != m_AudioSources.end(); it++) { m_pTempBuffer->clear(); it->second->fillAudioBuffer(m_pTempBuffer); addBuffers(m_pMixBuffer, m_pTempBuffer); } } calcVolume(m_pMixBuffer, numFrames*getChannels(), getVolume()); for (int i = 0; i < numFrames; ++i) { m_pLimiter->process(m_pMixBuffer+i*getChannels()); for (int j = 0; j < getChannels(); ++j) { ((short*)pDestBuffer)[i*2+j]=short(m_pMixBuffer[i*2+j]*32768); } } } void AudioEngine::audioCallback(void *userData, Uint8 *audioBuffer, int audioBufferLen) { AudioEngine *pThis = (AudioEngine*)userData; pThis->mixAudio(audioBuffer, audioBufferLen); } void AudioEngine::addBuffers(float *pDest, AudioBufferPtr pSrc) { int numFrames = pSrc->getNumFrames(); short * pData = pSrc->getData(); for(int i = 0; i < numFrames*getChannels(); ++i) { pDest[i] += pData[i]/32768.0f; } } void AudioEngine::calcVolume(float *pBuffer, int numSamples, float volume) { // TODO: We need a VolumeFader class that keeps state. for(int i = 0; i < numSamples; ++i) { pBuffer[i] *= volume; } } } libavg-1.8.2/src/audio/AudioEngine.h000066400000000000000000000052051236127404500172240ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // // Original author of this file is Nick Hebner (hebnern@gmail.com). // #ifndef _AudioEngine_H_ #define _AudioEngine_H_ #include "../api.h" #include "AudioSource.h" #include "AudioParams.h" #include "AudioBuffer.h" #include "IProcessor.h" #include #include #include namespace avg { typedef std::map AudioSourceMap; class AVG_API AudioEngine { public: static AudioEngine* get(); AudioEngine(); virtual ~AudioEngine(); int getChannels(); int getSampleRate(); const AudioParams * getParams(); void setAudioEnabled(bool bEnabled); void init(const AudioParams& ap, float volume); void teardown(); void play(); void pause(); int addSource(AudioMsgQueue& dataQ, AudioMsgQueue& statusQ); void removeSource(int id); void pauseSource(int id); void playSource(int id); void notifySeek(int id); void setSourceVolume(int id, float volume); void setVolume(float volume); float getVolume() const; bool isEnabled() const; private: void mixAudio(Uint8 *pDestBuffer, int destBufferLen); static void audioCallback(void *userData, Uint8 *audioBuffer, int audioBufferLen); void addBuffers(float *pDest, AudioBufferPtr pSrc); void calcVolume(float *pBuffer, int numSamples, float volume); AudioParams m_AP; AudioBufferPtr m_pTempBuffer; float * m_pMixBuffer; IProcessor* m_pLimiter; boost::mutex m_Mutex; bool m_bEnabled; AudioSourceMap m_AudioSources; float m_Volume; static AudioEngine* s_pInstance; }; } #endif libavg-1.8.2/src/audio/AudioMsg.cpp000066400000000000000000000067411236127404500171060ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "AudioMsg.h" #include "../base/ObjectCounter.h" #include "../base/Exception.h" #include using namespace std; namespace avg { AudioMsg::AudioMsg() : m_MsgType(NONE) { ObjectCounter::get()->incRef(&typeid(*this)); } AudioMsg::~AudioMsg() { ObjectCounter::get()->decRef(&typeid(*this)); } void AudioMsg::setAudio(AudioBufferPtr pAudioBuffer, float audioTime) { AVG_ASSERT(pAudioBuffer); setType(AUDIO); m_pAudioBuffer = pAudioBuffer; m_AudioTime = audioTime; } void AudioMsg::setAudioTime(float audioTime) { setType(AUDIO_TIME); m_AudioTime = audioTime; } void AudioMsg::setEOF() { setType(END_OF_FILE); } void AudioMsg::setError(const Exception& ex) { setType(ERROR); m_pEx = new Exception(ex); } void AudioMsg::setSeekDone(int seqNum, float seekTime) { setType(SEEK_DONE); AVG_ASSERT(seqNum != -1); m_SeekSeqNum = seqNum; m_SeekTime = seekTime; } void AudioMsg::setClosed() { setType(CLOSED); } AudioMsg::MsgType AudioMsg::getType() { return m_MsgType; } AudioBufferPtr AudioMsg::getAudioBuffer() const { AVG_ASSERT(m_MsgType == AUDIO); return m_pAudioBuffer; } float AudioMsg::getAudioTime() const { AVG_ASSERT(m_MsgType == AUDIO_TIME || m_MsgType == AUDIO); return m_AudioTime; } const Exception& AudioMsg::getException() const { AVG_ASSERT(m_MsgType == ERROR); return *m_pEx; } int AudioMsg::getSeekSeqNum() { AVG_ASSERT(m_MsgType == SEEK_DONE); return m_SeekSeqNum; } float AudioMsg::getSeekTime() { AVG_ASSERT(m_MsgType == SEEK_DONE); return m_SeekTime; } void AudioMsg::dump() { switch (m_MsgType) { case NONE: cerr << "NONE" << endl; break; case AUDIO: cerr << "AUDIO" << endl; break; case AUDIO_TIME: cerr << "AUDIO_TIME" << endl; break; case END_OF_FILE: cerr << "END_OF_FILE" << endl; break; case ERROR: cerr << "ERROR" << endl; break; case FRAME: cerr << "FRAME" << endl; break; case VDPAU_FRAME: cerr << "VDPAU_FRAME" << endl; break; case SEEK_DONE: cerr << "SEEK_DONE" << endl; break; case PACKET: cerr << "PACKET" << endl; break; case CLOSED: cerr << "CLOSED" << endl; break; default: AVG_ASSERT(false); break; } } void AudioMsg::setType(MsgType msgType) { AVG_ASSERT(m_MsgType == NONE); m_MsgType = msgType; } } libavg-1.8.2/src/audio/AudioMsg.h000066400000000000000000000041201236127404500165400ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _AudioMsg_H_ #define _AudioMsg_H_ #include "../api.h" #include "../base/Queue.h" #include "AudioBuffer.h" #include namespace avg { class AVG_API AudioMsg { public: enum MsgType {NONE, AUDIO, AUDIO_TIME, END_OF_FILE, ERROR, FRAME, VDPAU_FRAME, SEEK_DONE, PACKET, CLOSED}; AudioMsg(); void setAudio(AudioBufferPtr pAudioBuffer, float audioTime); void setAudioTime(float audioTime); void setEOF(); void setError(const Exception& ex); void setSeekDone(int seqNum, float seekTime); void setClosed(); virtual ~AudioMsg(); MsgType getType(); AudioBufferPtr getAudioBuffer() const; float getAudioTime() const; const Exception& getException() const; int getSeekSeqNum(); float getSeekTime(); virtual void dump(); protected: void setType(MsgType msgType); private: MsgType m_MsgType; // AUDIO AudioBufferPtr m_pAudioBuffer; float m_AudioTime; // ERROR Exception* m_pEx; // SEEK_DONE int m_SeekSeqNum; float m_SeekTime; }; typedef boost::shared_ptr AudioMsgPtr; typedef Queue AudioMsgQueue; typedef boost::shared_ptr AudioMsgQueuePtr; } #endif libavg-1.8.2/src/audio/AudioParams.cpp000066400000000000000000000024311236127404500175730ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // // Original author of this file is Nick Hebner (hebnern@gmail.com). // #include "AudioParams.h" #include "../base/ObjectCounter.h" namespace avg { AudioParams::AudioParams() { } AudioParams::AudioParams(int sampleRate, int channels, int outputBufferSamples) : m_SampleRate(sampleRate), m_Channels(channels), m_OutputBufferSamples(outputBufferSamples) { } } libavg-1.8.2/src/audio/AudioParams.h000066400000000000000000000023141236127404500172400ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // // Original author of this file is Nick Hebner (hebnern@gmail.com). // #ifndef _AudioParams_H_ #define _AudioParams_H_ namespace avg { struct AudioParams { AudioParams(); AudioParams(int sampleRate, int channels, int outputBufferSamples); int m_SampleRate; int m_Channels; int m_OutputBufferSamples; }; } #endif libavg-1.8.2/src/audio/AudioSource.cpp000066400000000000000000000114001236127404500176040ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "AudioSource.h" #include "AudioEngine.h" #include #include using namespace std; namespace avg { AudioSource::AudioSource(AudioMsgQueue& msgQ, AudioMsgQueue& statusQ, int sampleRate) : m_MsgQ(msgQ), m_StatusQ(statusQ), m_SampleRate(sampleRate), m_bPaused(false), m_bSeeking(false), m_Volume(1.0), m_LastVolume(1.0) { } AudioSource::~AudioSource() { } void AudioSource::pause() { m_bPaused = true; } void AudioSource::play() { m_bPaused = false; } void AudioSource::notifySeek() { while (m_bSeeking) { processNextMsg(true); } m_bSeeking = true; } void AudioSource::setVolume(float volume) { m_Volume = volume; } void AudioSource::fillAudioBuffer(AudioBufferPtr pBuffer) { bool bContinue = true; while (bContinue && m_bSeeking) { bContinue = processNextMsg(false); } if (!m_bPaused) { unsigned char* pDest = (unsigned char *)(pBuffer->getData()); int framesLeftToFill = pBuffer->getNumFrames(); AudioMsgPtr pMsg; while (framesLeftToFill > 0) { int framesLeftInBuffer = 0; if (m_pInputAudioBuffer) { framesLeftInBuffer = m_pInputAudioBuffer->getNumFrames() - m_CurInputAudioPos; } while (framesLeftInBuffer > 0 && framesLeftToFill > 0) { int framesToCopy = min(framesLeftToFill, framesLeftInBuffer); // cerr << "framesToCopy: " << framesToCopy << endl; char * pInputPos = (char*)m_pInputAudioBuffer->getData() + m_CurInputAudioPos*pBuffer->getFrameSize(); int bytesToCopy = framesToCopy*pBuffer->getFrameSize(); memcpy(pDest, pInputPos, bytesToCopy); m_CurInputAudioPos += framesToCopy; framesLeftToFill -= framesToCopy; framesLeftInBuffer -= framesToCopy; pDest += bytesToCopy; m_LastTime += framesToCopy/m_SampleRate; // cerr << " " << m_LastTime << endl; } if (framesLeftToFill != 0) { bool bContinue = processNextMsg(false); if (!bContinue) { framesLeftToFill = 0; } } } pBuffer->volumize(m_LastVolume, m_Volume); m_LastVolume = m_Volume; AudioMsgPtr pStatusMsg(new AudioMsg); pStatusMsg->setAudioTime(m_LastTime); m_StatusQ.push(pStatusMsg); } } bool AudioSource::processNextMsg(bool bWait) { AudioMsgPtr pMsg = m_MsgQ.pop(bWait); if (pMsg) { switch (pMsg->getType()) { case AudioMsg::AUDIO: m_pInputAudioBuffer = pMsg->getAudioBuffer(); m_CurInputAudioPos = 0; m_LastTime = pMsg->getAudioTime(); // cerr << " New buffer: " << m_LastTime << endl; return true; case AudioMsg::END_OF_FILE: { // cerr << " AudioSource: EOF" << endl; m_bSeeking = false; AudioMsgPtr pStatusMsg(new AudioMsg); pStatusMsg->setEOF(); m_StatusQ.push(pStatusMsg); return false; } case AudioMsg::SEEK_DONE: { // cerr << " AudioSource: SEEK_DONE" << endl; m_bSeeking = false; m_pInputAudioBuffer = AudioBufferPtr(); m_LastTime = pMsg->getSeekTime(); AudioMsgPtr pStatusMsg(new AudioMsg); pStatusMsg->setSeekDone(pMsg->getSeekSeqNum(), m_LastTime); m_StatusQ.push(pStatusMsg); return true; } default: AVG_ASSERT(false); return false; } } else { // cerr << "no pop" << endl; return false; } } } libavg-1.8.2/src/audio/AudioSource.h000066400000000000000000000032401236127404500172540ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _AudioSource_H_ #define _AudioSource_H_ #include "../api.h" #include "AudioMsg.h" #include namespace avg { class AVG_API AudioSource { public: AudioSource(AudioMsgQueue& msgQ, AudioMsgQueue& statusQ, int sampleRate); virtual ~AudioSource(); void pause(); void play(); void notifySeek(); void setVolume(float volume); void fillAudioBuffer(AudioBufferPtr pBuffer); private: bool processNextMsg(bool bWait); AudioMsgQueue& m_MsgQ; AudioMsgQueue& m_StatusQ; int m_SampleRate; AudioBufferPtr m_pInputAudioBuffer; float m_LastTime; int m_CurInputAudioPos; bool m_bPaused; bool m_bSeeking; float m_Volume; float m_LastVolume; }; typedef boost::shared_ptr AudioSourcePtr; } #endif libavg-1.8.2/src/audio/Dynamics.h000066400000000000000000000175211236127404500166100ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // // Original author of this file is Andreas Beisler. // #pragma once #ifndef __Dynamics_H__ #define __Dynamics_H__ #include "../api.h" #include "IProcessor.h" #include #include #include #include #define LOOKAHEAD 64 #define AVG1 27 #define AVG2 38 namespace avg { // Dynamics processor (compressor & limiter). template class AVG_API Dynamics: public IProcessor { public: Dynamics(T fs); virtual ~Dynamics(); virtual void process(T* pSamples); void setThreshold(T threshold); T getThreshold() const; void setRmsTime(T rmsTime); T getRmsTime() const; void setRatio(T ratio); T getRatio() const; void setAttackTime(T attTime); T getAttackTime() const; void setReleaseTime(T relTime); T getReleaseTime() const; void setMakeupGain(T makeupGain); T getMakeupGain() const; private: void maxFilter(T& rms); T m_fs; T threshold_; T preGain_; T rmsTime_; T rmsCoef_; T rms1_; T* lookaheadBuf_; int lookaheadBufIdx_; T ratio_; T inverseRatio_; T attTime_; T attCoef_; T relTime_; T relCoef_; T env1_; T* avg1Buf_; int avg1BufRIdx_; int avg1BufWIdx_; T avg1Old_; T* avg2Buf_; int avg2BufRIdx_; int avg2BufWIdx_; T avg2Old_; T* delayBuf_; int delayBufIdx_; T makeupGain_; T postGain_; }; template Dynamics::Dynamics(T fs) : m_fs(fs), threshold_(0.), preGain_(1.), rmsTime_(0.), rmsCoef_(0.), rms1_(0.), lookaheadBuf_(0), lookaheadBufIdx_(0), ratio_(std::numeric_limits::infinity()), inverseRatio_(0.), attTime_(0.), attCoef_(0.), relTime_(0.), relCoef_(0.), env1_(0.), avg1Buf_(0), avg1BufRIdx_(0), avg1BufWIdx_(AVG1 - 1), avg1Old_(0.), avg2Buf_(0), avg2BufRIdx_(0), avg2BufWIdx_(AVG2 - 1), avg2Old_(0.), delayBuf_(0), delayBufIdx_(0), makeupGain_(0.), postGain_(1.) { lookaheadBuf_ = new T[LOOKAHEAD]; for (int i = 0; i < LOOKAHEAD; i++) { lookaheadBuf_[i] = 1.f; } avg1Buf_ = new T[AVG1]; memset(avg1Buf_, 0, sizeof(T) * (AVG1)); avg2Buf_ = new T[AVG2]; memset(avg2Buf_, 0, sizeof(T) * (AVG2)); delayBuf_ = new T[LOOKAHEAD*CHANNELS]; memset(delayBuf_, 0, sizeof(T)*LOOKAHEAD*CHANNELS); setThreshold(0.); setRmsTime(0.); setRatio(std::numeric_limits::infinity()); setAttackTime(0.); setReleaseTime(0.05); setMakeupGain(0.); } template Dynamics::~Dynamics() { delete[] lookaheadBuf_; delete[] avg1Buf_; delete[] avg2Buf_; delete[] delayBuf_; } template void Dynamics::maxFilter(T& rms) { int j = lookaheadBufIdx_; for (int i = 0; i < LOOKAHEAD; i++) { j = (j+1)&(LOOKAHEAD-1); if (lookaheadBuf_[j] < rms) { lookaheadBuf_[j] = rms; } } } template void Dynamics::process(T* pSamples) { //---------------- Preprocessing T x = 0.f; for (int i = 0; i < CHANNELS; i++) { // Apply pregain const T tmp = pSamples[i] * preGain_; T abs = std::fabs(tmp); if (abs > x) { x = abs; } } //---------------- RMS T rms = (1.f - rmsCoef_) * x * x + rmsCoef_ * rms1_; rms1_ = rms; rms = sqrt(rms); //---------------- Max filter if (rms > 1.) { maxFilter(rms); } //---------------- Ratio T dbMax = std::log10(lookaheadBuf_[lookaheadBufIdx_]); T dbComp = dbMax * inverseRatio_; T comp = std::pow(static_cast(10.), dbComp); T c = comp / lookaheadBuf_[lookaheadBufIdx_]; lookaheadBuf_[lookaheadBufIdx_] = 1.; lookaheadBufIdx_ = (lookaheadBufIdx_+1)%LOOKAHEAD; //---------------- Attack/release envelope if (env1_ <= c) { c = c + (env1_ - c) * relCoef_; } else { c = c + (env1_ - c) * attCoef_; } env1_ = c; //---------------- Smoothing const T tmp1 = avg1Old_ + c - avg1Buf_[avg1BufRIdx_]; avg1Old_ = tmp1; avg1Buf_[avg1BufWIdx_] = c; c = tmp1; avg1BufRIdx_ = (avg1BufRIdx_+1)%AVG1; avg1BufWIdx_ = (avg1BufWIdx_+1)%AVG1; const T tmp2 = avg2Old_ + c - avg2Buf_[avg2BufRIdx_]; avg2Old_ = tmp2; avg2Buf_[avg2BufWIdx_] = c; c = tmp2; avg2BufRIdx_ = (avg2BufRIdx_+1)%AVG2; avg2BufWIdx_ = (avg2BufWIdx_+1)%AVG2; c = c / (static_cast(AVG1) * static_cast(AVG2)); //---------------- Postprocessing for (int i = 0; i < CHANNELS; i++) { // Delay input samples const T in = delayBuf_[delayBufIdx_*CHANNELS+i]; delayBuf_[delayBufIdx_*CHANNELS+i] = pSamples[i]; // Apply control signal pSamples[i] = in * c * postGain_; } delayBufIdx_ = (delayBufIdx_+1)&(LOOKAHEAD-1); } template void Dynamics::setThreshold(T threshold) { threshold_ = threshold; preGain_ = std::pow(10.f, -threshold / 20.f); } template T Dynamics::getThreshold() const { return threshold_; } template void Dynamics::setRmsTime(T rmsTime) { rmsTime_ = rmsTime; rmsCoef_ = 0.f; if (rmsTime > 0.f) { rmsCoef_ = std::pow(0.001f, 1.f / (m_fs * rmsTime)); } } template T Dynamics::getRmsTime() const { return rmsTime_; } template void Dynamics::setRatio(T ratio) { ratio_ = ratio; inverseRatio_ = 1.f / ratio; } template T Dynamics::getRatio() const { return ratio_; } template void Dynamics::setAttackTime(T attTime) { attTime_ = attTime; attCoef_ = 0.f; if (attTime > 0.f) { attCoef_ = pow(0.001f, 1.f / (m_fs * attTime)); } } template T Dynamics::getAttackTime() const { return attTime_; } template void Dynamics::setReleaseTime(T relTime) { relTime_ = relTime; relCoef_ = 0.f; if (relTime > 0.f) { relCoef_ = pow(0.001f, 1.f / (m_fs * relTime)); } } template T Dynamics::getReleaseTime() const { return relTime_; } template void Dynamics::setMakeupGain(T makeupGain) { makeupGain_ = makeupGain; postGain_ = std::pow(10.f, makeupGain / 20.f); } template T Dynamics::getMakeupGain() const { return makeupGain_; } } #endif libavg-1.8.2/src/audio/IProcessor.h000066400000000000000000000021101236127404500171150ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _Processor_H_ #define _Processor_H_ namespace avg { template class AVG_API IProcessor { public: virtual ~IProcessor() {}; virtual void process(T* pSamples) = 0; }; } #endif libavg-1.8.2/src/audio/Makefile.am000066400000000000000000000010401236127404500167110ustar00rootroot00000000000000AM_CPPFLAGS = -I.. @PTHREAD_CFLAGS@ ALL_H = AudioEngine.h AudioBuffer.h AudioParams.h \ Dynamics.h IProcessor.h AudioMsg.h AudioSource.h TESTS = testlimiter noinst_LTLIBRARIES = libaudio.la noinst_PROGRAMS = testlimiter libaudio_la_SOURCES = AudioEngine.cpp AudioBuffer.cpp AudioParams.cpp AudioMsg.cpp \ AudioSource.cpp $(ALL_H) testlimiter_SOURCES = testlimiter.cpp $(ALL_H) testlimiter_LDADD = ./libaudio.la ../base/libbase.la \ ../base/triangulate/libtriangulate.la \ @BOOST_THREAD_LIBS@ @PTHREAD_LIBS@ libavg-1.8.2/src/audio/testlimiter.cpp000066400000000000000000000065321236127404500177410ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "Dynamics.h" #include "../base/TestSuite.h" #include "../base/MathHelper.h" #include #include using namespace avg; using namespace std; class LimiterTest: public Test { public: LimiterTest() : Test("LimiterTest", 2) { } void runTests() { const int CHANNELS = 2; float fs = 44100.f; int numSamples = int(fs * 0.1f); // Setup a brickwall limiter typedef Dynamics TStereoLimiter; TStereoLimiter* d = new TStereoLimiter(fs); d->setThreshold(0.f); // in dB d->setAttackTime(0.f); // in seconds d->setReleaseTime(0.05f); // in seconds d->setRmsTime(0.f); // in seconds d->setRatio(std::numeric_limits::infinity()); d->setMakeupGain(0.f); // in dB // Generate input and output test data float* pSamples = new float[CHANNELS*numSamples]; for (int j = 0; j < numSamples; j++) { for (int i = 0; i < CHANNELS; i++) { pSamples[j*CHANNELS+i] = 2*sin(j*(440.f/44100)*float(M_PI)); } } // Let the limiter work. for (int i=0; iprocess(pSamples+i*CHANNELS); } // Check if everything is ok. bool bDiscontinuities = false; bool bAboveThreshold = false; for (int j = 1; j < numSamples; j++) { for (int i = 0; i < CHANNELS; i++) { // Test if anything is above the threshold. if (pSamples[j*CHANNELS+i] > 1) { bAboveThreshold = true; } if (fabs(pSamples[j*CHANNELS+i]-pSamples[(j-1)*CHANNELS+i]) > 0.05f) { bDiscontinuities = true; // cerr << j << ": " << outSamples[j*OUT_CHANNELS+i] << ", " << // outSamples[(j-1)*OUT_CHANNELS+i] << endl; } } } TEST(!bAboveThreshold); TEST(!bDiscontinuities); /* // Save data to ascii file. FILE * pFile = fopen("data.txt", "w"); for (int j = 0; j < numSamples; j++) { fprintf(pFile, "%f\n", pSamples[j*OUT_CHANNELS]); } fclose(pFile); */ // Free memory delete d; delete[] pSamples; } }; int main(int nargs, char** args) { LimiterTest test; test.runTests(); bool bOK = test.isOk(); if (bOK) { return 0; } else { return 1; } } libavg-1.8.2/src/avgconfig_win.h000066400000000000000000000011711236127404500165520ustar00rootroot00000000000000/* src/avgconfig.h.in. Generated from configure.in by autoheader. */ /* Enable DirectShow camera support */ #define AVG_ENABLE_DSHOW /* Enable CMU 1394 Digital Camera Driver support */ #define AVG_ENABLE_CMU1394 /* Enable firewire camera support */ #undef AVG_ENABLE_1394 /* Enable firewire camera support v.2 */ #undef AVG_ENABLE_1394_2 /* ffmpeg >= 0.5.0 */ #define HAVE_LIBAVFORMAT_AVFORMAT_H /* Enable Video4Linux2 camera support */ #undef AVG_ENABLE_V4L2 /* Enable parallel port support */ #undef AVG_ENABLE_PARPORT /* Enable ffmpeg swscale support. */ #define AVG_ENABLE_SWSCALE /* Name of package */ #undef PACKAGE libavg-1.8.2/src/avgconfigwrapper.h000066400000000000000000000023041236127404500172750ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "api.h" #ifdef _WIN32 #include "../avgconfig_win.h" #else #include "avgconfig.h" #endif // These defines regularly cause multiple definition warnings and are usually // completely unneeded. #undef PACKAGE #undef PACKAGE_BUGREPORT #undef PACKAGE_NAME #undef PACKAGE_STRING #undef PACKAGE_TARNAME #undef PACKAGE_VERSION libavg-1.8.2/src/avgrc000066400000000000000000000030011236127404500146000ustar00rootroot00000000000000 false 24 false false true 4 0 auto true 2 44100 1024 15 300 50 0.393 100 900 5 -1 0.1 0.03 0, 0 0, 0 libavg-1.8.2/src/base/000077500000000000000000000000001236127404500144735ustar00rootroot00000000000000libavg-1.8.2/src/base/Backtrace.cpp000066400000000000000000000065211236127404500170620ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "Backtrace.h" #include "StringHelper.h" #ifndef _WIN32 #include #include #endif #include #include #include using namespace std; namespace avg { void dumpBacktrace() { #ifndef _WIN32 vector sFuncs; getBacktrace(sFuncs); vector::iterator it = sFuncs.begin(); ++it; for (; it != sFuncs.end(); ++it) { cerr << " " << *it << endl; } #endif } string funcNameFromLine(const string& sLine) { try { #ifdef __APPLE__ string::size_type addressPos = sLine.find("0x"); string::size_type namePos = sLine.find(" ", addressPos); namePos++; string::size_type nameEndPos = sLine.find(" ", namePos); #else string::size_type namePos = sLine.find("("); namePos++; string::size_type nameEndPos = sLine.find_first_of(")+", namePos); #endif return sLine.substr(namePos, nameEndPos-namePos); } catch (exception&) { return sLine; } } void consolidateRepeatedLines(vector& sFuncs, unsigned& i, unsigned numSameLines) { unsigned firstSameLine = i - numSameLines; sFuncs[firstSameLine+1] = " [...]"; sFuncs.erase(sFuncs.begin()+firstSameLine+2, sFuncs.begin()+i-1); i = firstSameLine + 3; } void getBacktrace(vector& sFuncs) { #ifndef _WIN32 void* callstack[128]; int numFrames = backtrace(callstack, 128); char** ppszLines = backtrace_symbols(callstack, numFrames); for (int i = 1; i < numFrames; ++i) { string sLine = ppszLines[i]; string sFuncName = funcNameFromLine(sLine); int result; char * pszDemangledFuncName = abi::__cxa_demangle(sFuncName.c_str(), 0, 0, &result); if (!result) { sFuncName = pszDemangledFuncName; free(pszDemangledFuncName); } char szLineNum[10]; sprintf(szLineNum, "%3d", i); sFuncs.push_back(string(szLineNum)+" "+sFuncName); } free(ppszLines); unsigned numSameLines = 1; unsigned i = 1; for (i = 1; i < sFuncs.size(); ++i) { if (sFuncs[i].substr(4, string::npos) == sFuncs[i-1].substr(4, string::npos)) { numSameLines++; } else { if (numSameLines > 3) { consolidateRepeatedLines(sFuncs, i, numSameLines); } numSameLines = 1; } } if (numSameLines > 2) { consolidateRepeatedLines(sFuncs, i, numSameLines); } #endif } } libavg-1.8.2/src/base/Backtrace.h000066400000000000000000000020641236127404500165250ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _Backtrace_H_ #define _Backtrace_H_ #include #include namespace avg { void dumpBacktrace(); void getBacktrace(std::vector& sFuncs); } #endif libavg-1.8.2/src/base/BezierCurve.cpp000066400000000000000000000030471236127404500174300ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "BezierCurve.h" #include "GLMHelper.h" #include using namespace std; namespace avg { BezierCurve::BezierCurve(const glm::vec2& p0, const glm::vec2& p1, const glm::vec2& p2, const glm::vec2& p3) : m_P0(p0), m_P1(p1), m_P2(p2), m_P3(p3) { } glm::vec2 BezierCurve::interpolate(float t) const { return (1.f-t)*(1.f-t)*(1.f-t)*m_P0+ 3.f*t*(1.f-t)*(1.f-t) *m_P1+ 3.f*t*t*(1.f-t) *m_P2+ t*t*t *m_P3; } glm::vec2 BezierCurve::getDeriv(float t) const { return 3.f*(m_P1-m_P0)*(1.f-t)*(1.f-t)+ 6.f*(m_P2-m_P1)*(1.f-t)*t+ 3.f*(m_P3-m_P2)*t*t; } } libavg-1.8.2/src/base/BezierCurve.h000066400000000000000000000026531236127404500170770ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _BezierCurve_H_ #define _BezierCurve_H_ #include "../api.h" #include "../glm/glm.hpp" #include #include namespace avg { class AVG_API BezierCurve { public: BezierCurve(const glm::vec2& p0, const glm::vec2& p1, const glm::vec2& p2, const glm::vec2& p3); glm::vec2 interpolate(float t) const; glm::vec2 getDeriv(float t) const; private: glm::vec2 m_P0; glm::vec2 m_P1; glm::vec2 m_P2; glm::vec2 m_P3; }; typedef boost::shared_ptr BezierCurvePtr; } #endif libavg-1.8.2/src/base/CmdQueue.h000066400000000000000000000030321236127404500163520ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _CmdQueue_H_ #define _CmdQueue_H_ #include "Command.h" #include "Queue.h" #include "../api.h" namespace avg { template class AVG_TEMPLATE_API CmdQueue: public Queue > { public: CmdQueue(int maxSize=-1); typedef typename Queue >::QElementPtr CmdPtr; void pushCmd(typename Command::CmdFunc func); }; template CmdQueue::CmdQueue(int maxSize) : Queue >(maxSize) { } template void CmdQueue::pushCmd(typename Command::CmdFunc func) { this->push(CmdPtr(new Command(func))); } } #endif libavg-1.8.2/src/base/Command.h000066400000000000000000000026151236127404500162260ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _Command_H_ #define _Command_H_ #include "../api.h" #include namespace avg { template class AVG_TEMPLATE_API Command { public: typedef boost::function CmdFunc; Command(CmdFunc Func); void execute(RECEIVER* pTarget); private: CmdFunc m_Func; }; template Command::Command(CmdFunc Func) : m_Func(Func) { } template void Command::execute(RECEIVER* pTarget) { m_Func(pTarget); } } #endif libavg-1.8.2/src/base/ConfigMgr.cpp000066400000000000000000000257011236127404500170570ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "ConfigMgr.h" #include "Logger.h" #include "Exception.h" #include "OSHelper.h" #include #include #include #include #ifndef _WIN32 #include #else #include #endif using namespace std; namespace avg { ConfigOption::ConfigOption(const string& sName, const string& sValue) : m_sName(sName), m_sValue(sValue) { } ConfigMgr* ConfigMgr::m_pGlobalConfigMgr = 0; void deleteConfigMgr() { delete ConfigMgr::m_pGlobalConfigMgr; ConfigMgr::m_pGlobalConfigMgr = 0; } ConfigMgr* ConfigMgr::get() { if (!m_pGlobalConfigMgr) { m_pGlobalConfigMgr = new ConfigMgr; atexit(deleteConfigMgr); } return m_pGlobalConfigMgr; } ConfigMgr::ConfigMgr() { addSubsys("scr"); addOption("scr", "gles", "false"); addOption("scr", "bpp", "24"); addOption("scr", "fullscreen", "false"); addOption("scr", "windowwidth", "0"); addOption("scr", "windowheight", "0"); addOption("scr", "dotspermm", "0"); addOption("scr", "usepow2textures", "false"); addOption("scr", "usepixelbuffers", "true"); addOption("scr", "multisamplesamples", "8"); addOption("scr", "shaderusage", "auto"); addOption("scr", "gamma", "-1,-1,-1"); addOption("scr", "vsyncmode", "auto"); addOption("scr", "videoaccel", "true"); addSubsys("aud"); addOption("aud", "channels", "2"); addOption("aud", "samplerate", "44100"); addOption("aud", "outputbuffersamples", "1024"); addSubsys("gesture"); addOption("gesture", "maxtapdist", "15"); addOption("gesture", "maxdoubletaptime", "300"); addOption("gesture", "minswipedist", "50"); addOption("gesture", "swipedirectiontolerance", "0.393"); // pi/8 addOption("gesture", "maxswipecontactdist", "100"); addOption("gesture", "holddelay", "500"); addOption("gesture", "mindragdist", "5"); addOption("gesture", "filtermincutoff", "0.1"); addOption("gesture", "filterbeta", "0.03"); addOption("gesture", "friction", "-1"); addSubsys("touch"); addOption("touch", "area", "0, 0"); addOption("touch", "offset", "0, 0"); m_sFName = "avgrc"; loadFile(getGlobalConfigDir()+m_sFName); char * pHome = getenv("HOME"); if (pHome) { loadFile(string(pHome)+"/."+m_sFName); } } void ConfigMgr::addSubsys(const string& sName) { m_SubsysOptionMap[sName] = ConfigOptionVector(); } void ConfigMgr::addOption(const string& sSubsys, const string& sName, const std::string& sDefault) { ConfigOptionVector& Subsys = m_SubsysOptionMap[sSubsys]; Subsys.push_back(ConfigOption(sName, sDefault)); } const ConfigOptionVector* ConfigMgr::getOptions(const string& sSubsys) const { SubsysOptionMap::const_iterator it = m_SubsysOptionMap.find(sSubsys); if (it == m_SubsysOptionMap.end()) { return 0; } else { return &(*it).second; } } const string* ConfigMgr::getOption(const string& sSubsys, const string& sName) const { const ConfigOptionVector* pOptionVector = getOptions(sSubsys); if (!pOptionVector) { return 0; } else { for (unsigned int i=0; isize(); i++) { if ((*pOptionVector)[i].m_sName == sName) { return &(*pOptionVector)[i].m_sValue; } } return 0; } } bool ConfigMgr::getBoolOption(const string& sSubsys, const string& sName, bool bDefault) const { const string * psOption = getOption(sSubsys, sName); if (psOption == 0) { return bDefault; } if (*psOption == "true") { return true; } else if (*psOption == "false") { return false; } else { AVG_LOG_ERROR(m_sFName << ": Unrecognized value for option " << sName << ": " << *psOption << ". Must be true or false. Aborting."); exit(-1); } } int ConfigMgr::getIntOption(const string& sSubsys, const string& sName, int Default) const { errno = 0; const string * psOption = getOption(sSubsys, sName); if (psOption == 0) { return Default; } int Result = strtol(psOption->c_str(), 0, 10); int rc = errno; if (rc == EINVAL || rc == ERANGE) { AVG_LOG_ERROR(m_sFName << ": Unrecognized value for option "<c_str(), "%f,%f,%f", Val, Val+1, Val+2); if (rc < 3) { AVG_LOG_ERROR(m_sFName << ": Unrecognized value for option "<c_str(), "%f,%f", val, val+1); if (rc < 2) { AVG_LOG_ERROR(m_sFName << ": Unrecognized value for option " << sName << ": " << *psOption << ". Must be 2 comma-separated numbers(x, y). Aborting."); exit(-1); } return glm::vec2(val[0], val[1]); } void ConfigMgr::getStringOption(const string& sSubsys, const string& sName, const string& sDefault, string& sVal) const { const string * psOption = getOption(sSubsys, sName); if (psOption == 0) { sVal = sDefault; } else { sVal = *psOption; } } bool ConfigMgr::loadFile(const std::string& sPath) { string sSubsys; try { #ifndef _WIN32 // I don't think read permissions on config files are an issue under windows. int err = access(sPath.c_str(), R_OK); if (err == -1) { if (errno == EACCES) { AVG_LOG_WARNING(sPath+ ": File exists, but process doesn't have read permissions!"); } return false; } #else // but this actually prevents ugly XML parsing errors when file does not exist // and cygwin is used int err = _access(sPath.c_str(), 0); if (err == -1) { return false; } #endif xmlDocPtr doc; doc = xmlParseFile(sPath.c_str()); if (!doc) { throw Exception(AVG_ERR_XML_VALID, "Error parsing "+sPath +". File is not well-formed."); } xmlNodePtr pRoot = xmlDocGetRootElement(doc); if (xmlStrcmp(pRoot->name, (const xmlChar *)(m_sFName.c_str()))) { AVG_LOG_ERROR(sPath+": Root node must be <"+m_sFName+">, found " << pRoot->name << ". Aborting."); exit(255); } xmlNodePtr pSubsysNode = pRoot->xmlChildrenNode; while (pSubsysNode) { if (xmlStrcmp(pSubsysNode->name, (const xmlChar *)"text") && xmlStrcmp(pSubsysNode->name, (const xmlChar *)"comment")) { sSubsys = ((const char *)pSubsysNode->name); xmlNodePtr pOptionNode = pSubsysNode->xmlChildrenNode; if (!pOptionNode) { AVG_LOG_ERROR(sPath << ": Option " << sSubsys << " has no value. Ignoring."); } else { ConfigOptionVector& CurSubsys = getSubsys(sSubsys); while (pOptionNode) { if (xmlStrcmp(pOptionNode->name, (const xmlChar *)"text") && xmlStrcmp(pOptionNode->name, (const xmlChar *)"comment")) { setOption(CurSubsys, doc, pOptionNode); } pOptionNode = pOptionNode->next; } } } pSubsysNode = pSubsysNode->next; } xmlFreeDoc(doc); } catch (Exception& e) { switch (e.getCode()) { case AVG_ERR_OPTION_SUBSYS_UNKNOWN: AVG_LOG_ERROR("While parsing " << sPath << ": Option group " << e.getStr() << " unknown. Aborting."); exit(255); case AVG_ERR_OPTION_UNKNOWN: AVG_LOG_ERROR("While parsing " << sPath << ": Option " << sSubsys << ":" << e.getStr() << " unknown. Aborting."); exit(255); default: throw; } } return true; } ConfigOptionVector& ConfigMgr::getSubsys(const string& sName) { SubsysOptionMap::iterator pos = m_SubsysOptionMap.find(sName); if (pos == m_SubsysOptionMap.end()) { throw Exception(AVG_ERR_OPTION_SUBSYS_UNKNOWN, sName); } else { return pos->second; } } void ConfigMgr::setOption(ConfigOptionVector& optionVector, xmlDocPtr doc, xmlNodePtr pNode) { string sName = (const char *)pNode->name; xmlChar * pVal = xmlNodeListGetString(doc, pNode->xmlChildrenNode, 1); string sValue = (const char *)pVal; xmlFree(pVal); setOption(optionVector, sName, sValue); } void ConfigMgr::setOption(ConfigOptionVector& optionVector, const string& sName, const string& sValue) { for (unsigned int i = 0; i < optionVector.size(); i++) { if (optionVector[i].m_sName == sName) { optionVector[i].m_sValue = sValue; return; } } throw Exception(AVG_ERR_OPTION_UNKNOWN, sName); } void ConfigMgr::dump() const { SubsysOptionMap::const_iterator it; for (it = m_SubsysOptionMap.begin(); it != m_SubsysOptionMap.end(); ++it) { cerr << (*it).first << ": " << endl; const ConfigOptionVector& SubsysOptions = (*it).second; for (unsigned int j = 0; j < SubsysOptions.size(); ++j) { cerr << " " << SubsysOptions[j].m_sName << ": " << SubsysOptions[j].m_sValue << endl; } } } string getGlobalConfigDir() { #ifdef _WIN32 return getAvgLibPath()+"/etc/"; #else return "/etc/"; #endif } } libavg-1.8.2/src/base/ConfigMgr.h000066400000000000000000000055551236127404500165310ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _ConfigMgr_H_ #define _ConfigMgr_H_ #include "../api.h" #include "GLMHelper.h" #include #include #include #include namespace avg { struct ConfigOption { ConfigOption(const std::string& sName, const std::string& sValue); std::string m_sName; std::string m_sValue; }; typedef std::vector ConfigOptionVector; class AVG_API ConfigMgr { public: static ConfigMgr* get(); void addSubsys(const std::string& sName); void addOption(const std::string& sSubsys, const std::string& sName, const std::string& sDefault); const ConfigOptionVector* getOptions(const std::string& sSubsys) const; const std::string* getOption(const std::string& sSubsys, const std::string& sName) const; bool getBoolOption(const std::string& sSubsys, const std::string& sName, bool bDefault) const; int getIntOption(const std::string& sSubsys, const std::string& sName, int Default) const; void getGammaOption(const std::string& sSubsys, const std::string& sName, float* Val) const; glm::vec2 getSizeOption(const std::string& sSubsys, const std::string& sName) const; void getStringOption(const std::string& sSubsys, const std::string& sName, const std::string& sDefault, std::string& sVal) const; void dump() const; private: ConfigMgr(); bool loadFile(const std::string& sPath); ConfigOptionVector& getSubsys(const std::string& sName); void setOption(ConfigOptionVector& optionVector, xmlDocPtr doc, xmlNodePtr pNode); void setOption(ConfigOptionVector& optionVector, const std::string& sName, const std::string& sValue); typedef std::map SubsysOptionMap; SubsysOptionMap m_SubsysOptionMap; std::string m_sFName; static ConfigMgr* m_pGlobalConfigMgr; friend void deleteConfigMgr(); }; std::string getGlobalConfigDir(); } #endif libavg-1.8.2/src/base/CubicSpline.cpp000066400000000000000000000055341236127404500174060ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "CubicSpline.h" #include "Exception.h" #include "MathHelper.h" #include using namespace std; namespace avg { CubicSpline::CubicSpline(const vector& x, const vector& y, bool bLoop) { AVG_ASSERT(x.size() == y.size()); for (unsigned i=0; i& pts, bool bLoop) : m_Pts(pts) { init(); } CubicSpline::~CubicSpline() { } float CubicSpline::interpolate(float orig) { int len = m_Pts.size(); int low = 0; int high = len-1; // Binary search. while (high - low > 1) { int avg = (high+low) / 2; if (m_Pts[avg].x > orig) { high = avg; } else { low = avg; } } float h = m_Pts[high].x - m_Pts[low].x; float a = (m_Pts[high].x-orig)/h; float b = (orig-m_Pts[low].x)/h; float y = a*m_Pts[low].y + b*m_Pts[high].y + ((a*a*a-a)*m_Y2[low] + (b*b*b-b)*m_Y2[high])*(h*h)/6.f; return y; } void CubicSpline::init() { int len = m_Pts.size(); for (int i=1; i u(len-1,0); m_Y2.push_back(0.f); u[0] = 0.f; for (int i=1; i=0; i--) { m_Y2[i] = m_Y2[i]*m_Y2[i+1]+u[i]; } } } libavg-1.8.2/src/base/CubicSpline.h000066400000000000000000000027621236127404500170530ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _CubicSpline_H_ #define _CubicSpline_H_ #include "../api.h" #include "../glm/glm.hpp" #include #include namespace avg { class AVG_API CubicSpline { public: CubicSpline(const std::vector& x, const std::vector& y, bool bLoop=false); CubicSpline(const std::vector& pts, bool bLoop=false); virtual ~CubicSpline(); float interpolate(float orig); private: void init(); std::vector m_Pts; std::vector m_Y2; // Second derivatives }; typedef boost::shared_ptr CubicSplinePtr; } #endif libavg-1.8.2/src/base/DAG.cpp000066400000000000000000000064001236127404500155720ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "DAG.h" #include "Exception.h" #include using namespace std; namespace avg { class AVG_API DAGNode: public boost::enable_shared_from_this { public: DAGNode(long vertexID, const std::set& outgoingIDs); void resolveIDs(DAG* pDAG); long m_VertexID; std::set m_OutgoingIDs; std::set m_pOutgoingNodes; std::set m_pIncomingNodes; }; DAGNode::DAGNode(long vertexID, const set& outgoingIDs) { m_VertexID = vertexID; m_OutgoingIDs = outgoingIDs; } void DAGNode::resolveIDs(DAG* pDAG) { set::iterator it; for (it=m_OutgoingIDs.begin(); it!=m_OutgoingIDs.end(); ++it) { long outgoingID = *it; DAGNodePtr pDestNode = pDAG->findNode(outgoingID); m_pOutgoingNodes.insert(pDestNode); pDestNode->m_pIncomingNodes.insert(shared_from_this()); } m_OutgoingIDs.clear(); } DAG::DAG() { } DAG::~DAG() { } void DAG::addNode(long vertexID, const set& outgoingIDs) { DAGNode* pNode = new DAGNode(vertexID, outgoingIDs); m_pNodes.insert(DAGNodePtr(pNode)); } void DAG::sort(vector& pResults) { resolveIDs(); while (!m_pNodes.empty()) { DAGNodePtr pCurNode = findStartNode(*m_pNodes.begin()); removeNode(pCurNode); pResults.push_back(pCurNode->m_VertexID); } } void DAG::resolveIDs() { set::iterator it; for (it=m_pNodes.begin(); it!=m_pNodes.end(); ++it) { (*it)->resolveIDs(this); } } DAGNodePtr DAG::findNode(long id) { set::iterator it; for (it=m_pNodes.begin(); it!=m_pNodes.end(); ++it) { if ((*it)->m_VertexID == id) { return (*it); } } AVG_ASSERT(false); return DAGNodePtr(); } void DAG::removeNode(DAGNodePtr pNode) { set::iterator it; for (it=pNode->m_pOutgoingNodes.begin(); it!=pNode->m_pOutgoingNodes.end(); ++it) { DAGNodePtr pDestNode = *it; pDestNode->m_pIncomingNodes.erase(pNode); } m_pNodes.erase(pNode); } DAGNodePtr DAG::findStartNode(DAGNodePtr pNode, unsigned depth) { if (pNode->m_pIncomingNodes.empty()) { return pNode; } else { if (depth > m_pNodes.size()) { throw Exception(AVG_ERR_INVALID_ARGS, "cyclic graph"); } return findStartNode(*pNode->m_pIncomingNodes.begin(), depth+1); } } } libavg-1.8.2/src/base/DAG.h000066400000000000000000000031371236127404500152430ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _DAG_H_ #define _DAG_H_ #include "../api.h" #include #include #include namespace avg { class DAG; class DAGNode; typedef boost::shared_ptr DAGNodePtr; // Directed Acyclic Graph class. // Only useful for sorting. The process of sorting destroys the DAG. class AVG_API DAG { public: DAG(); virtual ~DAG(); void addNode(long vertexID, const std::set& outgoingIDs); void sort(std::vector& pResults); private: friend class DAGNode; void resolveIDs(); DAGNodePtr findNode(long pID); void removeNode(DAGNodePtr pNode); DAGNodePtr findStartNode(DAGNodePtr pNode, unsigned depth=0); std::set m_pNodes; }; } #endif libavg-1.8.2/src/base/DirEntry.cpp000066400000000000000000000030011236127404500167310ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "DirEntry.h" using namespace std; namespace avg { #ifdef _WIN32 DirEntry::DirEntry(string sDirName, const _finddata_t& findData) : m_sDirName(sDirName), m_FindData(findData) { } #else DirEntry::DirEntry(string sDirName, dirent * pEntry) : m_sDirName(sDirName), m_pEntry(pEntry) { } #endif DirEntry::~DirEntry() { } std::string DirEntry::getName() { #ifdef _WIN32 return m_FindData.name; #else return m_pEntry->d_name; #endif } void DirEntry::remove() { #ifdef _WIN32 ::_unlink((m_sDirName+"\\"+m_FindData.name).c_str()); #else ::unlink((m_sDirName+"/"+m_pEntry->d_name).c_str()); #endif } } libavg-1.8.2/src/base/DirEntry.h000066400000000000000000000027661236127404500164170ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _DirEntry_H_ #define _DirEntry_H_ #include "../api.h" #include #ifdef _WIN32 #include #else #include #endif #include namespace avg { class AVG_API DirEntry { public: #ifdef _WIN32 DirEntry(std::string sDirName, const _finddata_t& findData); #else DirEntry(std::string sDirName, dirent * pEntry); #endif virtual ~DirEntry(); std::string getName(); void remove(); private: std::string m_sDirName; #ifdef _WIN32 _finddata_t m_FindData; #else dirent * m_pEntry; #endif }; typedef boost::shared_ptr DirEntryPtr; } #endif libavg-1.8.2/src/base/Directory.cpp000066400000000000000000000057771236127404500171630ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "Directory.h" #ifdef _WIN32 #include #endif #include #include using namespace std; namespace avg { Directory::Directory(std::string sName) : m_sName(sName) { #ifdef _WIN32 m_hFile = -1; #else m_pDir = 0; #endif } Directory::~Directory() { #ifdef _WIN32 _findclose(m_hFile); #else if (m_pDir) { closedir(m_pDir); } #endif } int Directory::open(bool bCreateIfMissing) { #ifdef _WIN32 m_hFile = _findfirst((m_sName+"/*").c_str(), &m_FindData); if(m_hFile == -1L) { if (bCreateIfMissing) { int err = CreateDirectory(m_sName.c_str(), 0); if (err == 0) { return -1; } else { m_hFile = _findfirst((m_sName+"/*").c_str(), &m_FindData); m_bFirstFile = true; return 0; } } else { return -1; } } else { m_bFirstFile = true; return 0; } #else m_pDir = opendir(m_sName.c_str()); if (!m_pDir) { if (bCreateIfMissing) { int err = mkdir(m_sName.c_str(), S_IRWXU | S_IRWXG | S_IRWXO); if (err) { return err; } else { m_pDir = opendir(m_sName.c_str()); return 0; } } else { return -1; } } else { return 0; } #endif } DirEntryPtr Directory::getNextEntry() { #ifdef _WIN32 if (!m_bFirstFile) { int rc = _findnext(m_hFile, &m_FindData); if (rc == -1) { return DirEntryPtr(); } } m_bFirstFile = false; return DirEntryPtr(new DirEntry(m_sName, m_FindData)); #else dirent * pDirent; pDirent = readdir(m_pDir); if (pDirent) { return DirEntryPtr(new DirEntry(m_sName, pDirent)); } else { return DirEntryPtr(); } #endif } const std::string& Directory::getName() { return m_sName; } void Directory::empty() { DirEntryPtr pEntry; do { pEntry = getNextEntry(); if (pEntry) { pEntry->remove(); } } while (pEntry); } } libavg-1.8.2/src/base/Directory.h000066400000000000000000000027061236127404500166150ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _Directory_H_ #define _Directory_H_ #include "../api.h" #include "DirEntry.h" #ifdef _WIN32 #include #else #include #endif #include namespace avg { class AVG_API Directory { public: Directory(std::string sName); virtual ~Directory(); int open(bool bCreateIfMissing = false); DirEntryPtr getNextEntry(); const std::string& getName(); void empty(); private: std::string m_sName; #ifdef _WIN32 _finddata_t m_FindData; intptr_t m_hFile; bool m_bFirstFile; #else DIR * m_pDir; #endif }; } #endif libavg-1.8.2/src/base/DlfcnWrapper.cpp000066400000000000000000000030001236127404500175570ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "DlfcnWrapper.h" #include #include #ifndef WIN32_LEAN_AND_MEAN #define WIN32_LEAN_AND_MEAN #endif #include "windows.h" using namespace std; namespace avg { void* dlopen(const char *pszPath, int ignored) { return LoadLibrary(pszPath); } void dlclose(void* handle) { FreeLibrary((HMODULE)handle); } void* dlsym(void* handle, const char* functionName) { return GetProcAddress((HMODULE)handle, functionName); } const char* dlerror() { static char buffer[1024]; int err = GetLastError(); ostringstream ss; ss << err; strncpy(buffer,ss.str().c_str(),1023); return buffer; } } libavg-1.8.2/src/base/DlfcnWrapper.h000066400000000000000000000022711236127404500172350ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _DlfcnWrapper_h_ #define _DlfcnWrapper_h_ #ifdef _WIN32 #define RTLD_LOCAL 0 #define RTLD_NOW 0 namespace avg { void* dlopen(const char *pszPath, int ignored); void dlclose(void* handle); void* dlsym(void* handle, const char* functionName); const char* dlerror(); } #else #include #endif #endif libavg-1.8.2/src/base/Exception.cpp000066400000000000000000000042771236127404500171470ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "Exception.h" #include "Backtrace.h" #include "Logger.h" #include "OSHelper.h" #include #include #ifdef WIN32 #include #endif using namespace std; namespace avg { Exception::Exception(int code, const string& sErr) : std::exception(), m_Code (code), m_sErr (sErr) { } Exception::Exception(const Exception& ex) : std::exception(), m_Code (ex.getCode()), m_sErr (ex.getStr()) { } Exception::~Exception() throw() { } int Exception::getCode() const { return m_Code; } const string& Exception::getStr() const { return m_sErr; } const char* Exception::what() const throw() { return m_sErr.c_str(); } void debugBreak() { #ifdef _WIN32 __debugbreak(); #else __builtin_trap(); #endif } void avgAssert(bool b, const char * pszFile, int line, const char * pszReason) { if (!b) { string sDummy; static bool bBreak = getEnv("AVG_BREAK_ON_ASSERT", sDummy); if (bBreak) { debugBreak(); } else { stringstream ss; ss << "Assertion failed in " << pszFile << ": " << line << endl; if (pszReason) { ss << "Reason: " << pszReason << endl; } dumpBacktrace(); throw(Exception(AVG_ERR_ASSERT_FAILED, ss.str())); } } } } libavg-1.8.2/src/base/Exception.h000066400000000000000000000052601236127404500166050ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _Exception_H_ #define _Exception_H_ #include "../api.h" #include #include #define AVG_ERR_UNKNOWN -1 #define AVG_ERR_XML_PARSE 1 #define AVG_ERR_XML_VALID 2 #define AVG_ERR_XML_EMPTY 3 #define AVG_ERR_XML_NODE_UNKNOWN 4 #define AVG_ERR_XML_DUPLICATE_ID 5 #define AVG_ERR_VIDEO_INIT_FAILED 6 #define AVG_ERR_VIDEO_GENERAL 7 #define AVG_ERR_FONT_INIT_FAILED 10 #define AVG_ERR_VIDEO_LOAD_FAILED 11 #define AVG_ERR_UNSUPPORTED 12 #define AVG_ERR_OPTION_SUBSYS_UNKNOWN 13 #define AVG_ERR_OPTION_UNKNOWN 14 #define AVG_ERR_FILEIO 15 #define AVG_ERR_NOT_IN_SCENE 16 #define AVG_ERR_OUT_OF_RANGE 17 #define AVG_ERR_ALREADY_CONNECTED 18 #define AVG_ERR_LOAD_DURING_PLAYBACK 19 #define AVG_ERR_CANT_PARSE_STRING 20 #define AVG_ERR_INVALID_CAPTURE 21 #define AVG_ERR_NO_NODE 23 #define AVG_ERR_NO_ARG 24 #define AVG_ERR_INVALID_ARGS 25 #define AVG_ERR_NO_BUILDER 26 #define AVG_ERR_TYPE 27 #define AVG_ERR_CORRUPT_PLUGIN 28 #define AVG_ERR_CAMERA_FATAL 29 #define AVG_ERR_CAMERA_NONFATAL 30 #define AVG_ERR_DEPRECATED 31 #define AVG_ERR_ASSERT_FAILED 32 #define AVG_ERR_MT_INIT 33 #define AVG_ERR_DEBUG_CONTEXT_FAILED 34 namespace avg { class AVG_API Exception: public std::exception { public: Exception(int code, const std::string& sErr = ""); Exception(const Exception& ex); virtual ~Exception() throw(); virtual int getCode() const; virtual const std::string& getStr() const; virtual const char* what() const throw(); private: int m_Code; std::string m_sErr; }; void AVG_API debugBreak(); void AVG_API avgAssert(bool b, const char * pszFile, int line, const char * pszReason=0); #define AVG_ASSERT(b) avgAssert((b) != 0, __FILE__, __LINE__); #define AVG_ASSERT_MSG(b, pszReason) avgAssert((b) != 0, __FILE__, __LINE__, pszReason); } #endif libavg-1.8.2/src/base/FileHelper.cpp000066400000000000000000000074221236127404500172230ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "FileHelper.h" #include "Exception.h" #ifndef _WIN32 #include #else #include #endif #include #include #include #include #include #include #include #include #include #include using namespace std; namespace avg { string getPath(const string& sFilename) { if (sFilename.length() > 0 && sFilename.at(sFilename.length()-1) == '/') { return sFilename; } #ifdef _WIN32 int pos = int(sFilename.find_last_of("\\/")); string dirName; if (pos >= 0) { dirName = sFilename.substr(0, pos+1); } else { dirName = sFilename; } #else char * pszBuffer = strdup(sFilename.c_str()); string dirName(dirname(pszBuffer)); free(pszBuffer); dirName += "/"; #endif return dirName; } string getFilenamePart(const string& sFilename) { if (sFilename.find_last_of("\\/") == 0) { return sFilename; } #ifdef _WIN32 int pos = int(sFilename.find_last_of("\\/")); string BaseName(sFilename.substr(pos+1)); #else char * pszBuffer = strdup(sFilename.c_str()); string BaseName(basename(pszBuffer)); free(pszBuffer); #endif return BaseName; } string getExtension(const string& sFilename) { int pos = int(sFilename.find_last_of(".")); if (pos == 0) { return ""; } else { return sFilename.substr(pos+1); } } string getCWD() { char szBuf[1024]; #ifdef _WIN32 char * pBuf = _getcwd(szBuf, 1024); #else char * pBuf = getcwd(szBuf, 1024); #endif return string(pBuf)+"/"; } bool isAbsPath(const std::string& path) { #ifdef _WIN32 return ((path.length() != 0) && path[1] == ':') || path[0] == '\\' || path[0] == '/'; #else return path[0] == '/'; #endif } bool fileExists(const string& sFilename) { struct stat myStat; return stat(sFilename.c_str(), &myStat) != -1; } void readWholeFile(const string& sFilename, string& sContent) { ifstream file(sFilename.c_str()); if (!file) { throw Exception(AVG_ERR_FILEIO, "Opening "+sFilename+ " for reading failed."); } vector buffer(65536); sContent.resize(0); while (file) { file.read(&(*buffer.begin()), (streamsize)(buffer.size())); sContent.append(&(*buffer.begin()), (unsigned)file.gcount()); } if (!file.eof() || file.bad()) { throw Exception(AVG_ERR_FILEIO, "Reading "+sFilename+ " failed."); } } void writeWholeFile(const string& sFilename, const string& sContent) { ofstream outFile(sFilename.c_str()); if (!outFile) { throw Exception(AVG_ERR_FILEIO, "Opening "+sFilename+ " for writing failed."); } outFile << sContent; } void copyFile(const string& sSourceFile, const string& sDestFile) { string sData; readWholeFile(sSourceFile, sData); writeWholeFile(sDestFile, sData); } } libavg-1.8.2/src/base/FileHelper.h000066400000000000000000000031501236127404500166620ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _FileHelper_H_ #define _FileHelper_H_ #include "../api.h" #include namespace avg { std::string AVG_API getPath(const std::string& sFilename); std::string AVG_API getFilenamePart(const std::string& sFilename); std::string AVG_API getExtension(const std::string& sFilename); std::string AVG_API getCWD(); bool AVG_API isAbsPath(const std::string& path); bool AVG_API fileExists(const std::string& sFilename); void AVG_API readWholeFile(const std::string& sFilename, std::string& sContents); void AVG_API writeWholeFile(const std::string& sFilename, const std::string& sContent); void AVG_API copyFile(const std::string& sSourceFile, const std::string& sDestFile); #ifdef WIN32 #define unlink _unlink #endif } #endif libavg-1.8.2/src/base/GLMHelper.cpp000066400000000000000000000135351236127404500167650ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "GLMHelper.h" #include "StringHelper.h" #include "MathHelper.h" #include "../glm/gtx/rotate_vector.hpp" using namespace std; namespace avg { glm::vec2 getRotated(const glm::vec2& vec, float angle) { return glm::rotate(vec, angle*180/PI); } glm::vec2 getRotatedPivot(const glm::vec2& vec, float angle, const glm::vec2& pivot) { // translate pivot to origin glm::vec2 translated = vec - pivot; // calculate rotated coordinates about the origin glm::vec2 rotated = glm::rotate(translated, angle*180/PI); // re-translate pivot to original position rotated += pivot; return rotated; } float getAngle(const glm::vec2& vec) { return float(atan2(double(vec.y), double(vec.x))); } glm::vec2 fromPolar(float angle, float radius) { return glm::vec2(cos(angle)*radius, sin(angle)*radius); } template bool almostEqual(const glm::detail::tvec2& v1, const glm::detail::tvec2& v2) { return (fabs(v1.x-v2.x)+fabs(v1.y-v2.y)) < 0.0001; } template bool almostEqual(const glm::detail::tvec4& v1, const glm::detail::tvec4& v2) { return (fabs(v1.x-v2.x)+fabs(v1.y-v2.y)+fabs(v1.z-v2.z)+fabs(v1.w-v2.w)) < 0.0001; } template std::ostream& operator<<( std::ostream& os, const glm::detail::tvec2 &v) { os << "(" << v.x << "," << v.y << ")"; return os; } template std::ostream& operator<<( std::ostream& os, const glm::detail::tvec3 &v) { os << "(" << v.x << "," << v.y << "," << v.z << ")"; return os; } template std::ostream& operator<<( std::ostream& os, const glm::detail::tvec4 &v) { os << "(" << v.x << "," << v.y << "," << v.z << ", " << v.a << ")"; return os; } template std::ostream& operator<<( std::ostream& os, const glm::detail::tmat4x4 &m) { os << "(" << m[0] << ", " << endl << m[1] << ", " << endl << m[2] << ", " << endl << m[3] << ", " << endl << ")"; return os; } template std::istream& operator>>(std::istream& is, glm::detail::tvec2& p) { skipToken(is, '('); is >> p.x; skipToken(is, ','); is >> p.y; skipToken(is, ')'); return is; } template std::istream& operator>>(std::istream& is, glm::detail::tvec3& p) { skipToken(is, '('); is >> p.x; skipToken(is, ','); is >> p.y; skipToken(is, ','); is >> p.z; skipToken(is, ')'); return is; } glm::vec2 stringToVec2(const std::string& s) { glm::vec2 pt; fromString(s, pt); return pt; } glm::vec3 stringToVec3(const std::string& s) { glm::vec3 pt; fromString(s, pt); return pt; } glm::ivec3 stringToIVec3(const std::string& s) { glm::ivec3 pt; fromString(s, pt); return pt; } template AVG_TEMPLATE_API std::ostream& operator<<(std::ostream& os, const glm::detail::tvec2 &p); template AVG_TEMPLATE_API std::ostream& operator<<(std::ostream& os, const glm::detail::tvec2 &p); template AVG_TEMPLATE_API std::ostream& operator<<(std::ostream& os, const glm::detail::tvec2 &p); template AVG_TEMPLATE_API std::istream& operator>>(std::istream& is, glm::detail::tvec2& p); template AVG_TEMPLATE_API std::istream& operator>>(std::istream& is, glm::detail::tvec2& p); template AVG_TEMPLATE_API std::istream& operator>>(std::istream& is, glm::detail::tvec2& p); template AVG_TEMPLATE_API std::ostream& operator<<(std::ostream& os, const glm::detail::tvec3 &p); template AVG_TEMPLATE_API std::ostream& operator<<(std::ostream& os, const glm::detail::tvec3 &p); template AVG_TEMPLATE_API std::ostream& operator<<(std::ostream& os, const glm::detail::tvec3 &p); template AVG_TEMPLATE_API std::istream& operator>>(std::istream& is, glm::detail::tvec3& p); template AVG_TEMPLATE_API std::istream& operator>>(std::istream& is, glm::detail::tvec3& p); template AVG_TEMPLATE_API std::istream& operator>>(std::istream& is, glm::detail::tvec3& p); template AVG_TEMPLATE_API std::ostream& operator<<(std::ostream& os, const glm::detail::tvec4 &p); template AVG_TEMPLATE_API std::ostream& operator<<(std::ostream& os, const glm::detail::tvec4 &p); template AVG_TEMPLATE_API std::ostream& operator<<(std::ostream& os, const glm::detail::tvec4 &p); template AVG_TEMPLATE_API std::ostream& operator<<(std::ostream& os, const glm::detail::tmat4x4 &p); template AVG_TEMPLATE_API std::ostream& operator<<(std::ostream& os, const glm::detail::tmat4x4 &p); template AVG_TEMPLATE_API bool almostEqual(const glm::detail::tvec2& v1, const glm::detail::tvec2& v2); template AVG_TEMPLATE_API bool almostEqual(const glm::detail::tvec2& v1, const glm::detail::tvec2& v2); template AVG_TEMPLATE_API bool almostEqual(const glm::detail::tvec4& v1, const glm::detail::tvec4& v2); template AVG_TEMPLATE_API bool almostEqual(const glm::detail::tvec4& v1, const glm::detail::tvec4& v2); } libavg-1.8.2/src/base/GLMHelper.h000066400000000000000000000045311236127404500164260ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _GLMHelper_H_ #define _GLMHelper_H_ #include "../api.h" #include "../glm/glm.hpp" #include "../glm/gtc/matrix_transform.hpp" #include "../glm/gtc/type_ptr.hpp" #include #include namespace avg { glm::vec2 getRotated(const glm::vec2& vec, float angle); glm::vec2 getRotatedPivot(const glm::vec2& vec, float angle, const glm::vec2& pivot=glm::vec2(0,0)); float getAngle(const glm::vec2& vec); glm::vec2 fromPolar(float angle, float radius); template bool almostEqual(const glm::detail::tvec2& v1, const glm::detail::tvec2& v2); template bool almostEqual(const glm::detail::tvec4& v1, const glm::detail::tvec4& v2); template std::ostream& operator<<(std::ostream& os, const glm::detail::tvec2 &v); template std::ostream& operator<<(std::ostream& os, const glm::detail::tvec3 &v); template std::ostream& operator<<(std::ostream& os, const glm::detail::tvec4 &v); template std::ostream& operator<<(std::ostream& os, const glm::detail::tmat4x4 &v); template std::istream& operator>>(std::istream& is, glm::detail::tvec2& p); template std::istream& operator>>(std::istream& is, glm::detail::tvec3& p); typedef glm::ivec2 IntPoint; typedef std::vector Vec2Vector; glm::vec2 stringToVec2(const std::string& s); glm::vec3 stringToVec3(const std::string& s); glm::ivec3 stringToIVec3(const std::string& s); } #endif libavg-1.8.2/src/base/GeomHelper.cpp000066400000000000000000000115641236127404500172350ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "GeomHelper.h" #include #include using namespace std; namespace avg { LineSegment::LineSegment(const glm::vec2& pt0, const glm::vec2& pt1) : p0(pt0), p1(pt1) { } bool LineSegment::isPointOver(const glm::vec2& pt) { glm::vec2 c = pt - p0; glm::vec2 v = (p1 - p0); float d = glm::length(v); v /= d; float t = glm::dot(v, c); return (t >= 0 && t <= d); } // Code adapted from Antonio, Franklin, "Faster Line Segment Intersection," // Graphics Gems III (David Kirk, ed.), Academic Press, pp. 199-202, 1992. bool lineSegmentsIntersect(const LineSegment& l0, const LineSegment& l1) { float xdiff0 = l0.p1.x-l0.p0.x; float xdiff1 = l1.p0.x-l1.p1.x; float x1lo, x1hi; /* X bound box test*/ if (xdiff0 < 0) { x1lo=l0.p1.x; x1hi=l0.p0.x; } else { x1hi=l0.p1.x; x1lo=l0.p0.x; } if (xdiff1 > 0) { if (x1hi < l1.p1.x || l1.p0.x < x1lo) { return false; } } else { if (x1hi < l1.p0.x || l1.p1.x < x1lo) { return false; } } float ydiff0 = l0.p1.y-l0.p0.y; float ydiff1 = l1.p0.y-l1.p1.y; float y1lo, y1hi; /* Y bound box test*/ if (ydiff0 < 0) { y1lo=l0.p1.y; y1hi=l0.p0.y; } else { y1hi=l0.p1.y; y1lo=l0.p0.y; } if (ydiff1 > 0) { if (y1hi < l1.p1.y || l1.p0.y < y1lo) { return false; } } else { if (y1hi < l1.p0.y || l1.p1.y < y1lo) { return false; } } float Cx = l0.p0.x-l1.p0.x; float Cy = l0.p0.y-l1.p0.y; float d = ydiff1*Cx - xdiff1*Cy; /* alpha numerator*/ float f = ydiff0*xdiff1 - xdiff0*ydiff1; /* both denominator*/ if (f > 0) { /* alpha tests*/ if (d < 0 || d > f) { return false; } } else { if (d > 0 || d < f) { return false; } } float e = xdiff0*Cy - ydiff0*Cx; /* beta numerator*/ if(f > 0) { /* beta tests*/ if (e < 0 || e > f) { return false; } } else { if (e > 0 || e < f) { return false; } } if (f == 0) { // Theoretically, lines could still intersect in this case, but we don't care // because given numerical inaccuracies, the result is random anyway :-). return false; } // /*compute intersection coordinates*/ // float num = d*xdiff0; /* numerator */ // offset = SAME_SIGNS(num,f) ? f/2 : -f/2; /* round direction*/ // *x = x1 + (num+offset) / f; /* intersection x */ // // num = d*ydiff0; // offset = SAME_SIGNS(num,f) ? f/2 : -f/2; // *y = y1 + (num+offset) / f; /* intersection y */ return true; } // Original code from: // http://www.ecse.rpi.edu/Homepages/wrf/Research/Short_Notes/pnpoly.html. // Precomputing a bounding box for the polygon would speed this up a lot, // but the function hasn't shown up on any profiles so far. bool pointInPolygon(const glm::vec2& pt, const vector& poly) { if (poly.size() < 3) { return false; } bool bPtInPoly = false; for (unsigned i = 0, j = poly.size()-1; i < poly.size(); j = i++) { if (((poly[i].y > pt.y) != (poly[j].y > pt.y)) && (pt.x < (poly[j].x-poly[i].x)*(pt.y-poly[i].y) / (poly[j].y-poly[i].y) +poly[i].x)) { bPtInPoly = !bPtInPoly; } } return bPtInPoly; } glm::vec2 getLineLineIntersection(const glm::vec2& p1, const glm::vec2& v1, const glm::vec2& p2, const glm::vec2& v2) { float denom = v2.y*v1.x-v2.x*v1.y; if (fabs(denom) < 0.0000001) { // If the lines are parallel or coincident, we just return p2! return p2; } float numer = v2.x*(p1.y-p2.y) - v2.y*(p1.x-p2.x); float ua = numer/denom; return p1+ua*v1; } } libavg-1.8.2/src/base/GeomHelper.h000066400000000000000000000027631236127404500167030ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _GeomHelper_H_ #define _GeomHelper_H_ #include "../api.h" #include "../glm/glm.hpp" #include namespace avg { struct AVG_API LineSegment { public: LineSegment(const glm::vec2& pt0, const glm::vec2& pt1); glm::vec2 p0; glm::vec2 p1; bool isPointOver(const glm::vec2& pt); }; bool AVG_API lineSegmentsIntersect(const LineSegment& l0, const LineSegment& l1); bool AVG_API pointInPolygon(const glm::vec2& pt, const std::vector& poly); glm::vec2 AVG_API getLineLineIntersection(const glm::vec2& p1, const glm::vec2& v1, const glm::vec2& p2, const glm::vec2& v2); } #endif libavg-1.8.2/src/base/IFrameEndListener.h000066400000000000000000000021431236127404500201440ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _IFrameEndListener_H_ #define _IFrameEndListener_H_ #include "../api.h" namespace avg { class AVG_API IFrameEndListener { public: virtual ~IFrameEndListener() {}; virtual void onFrameEnd() = 0; }; } #endif libavg-1.8.2/src/base/ILogSink.h000066400000000000000000000026061236127404500163270ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de #ifndef _ILOGHANDLER_H_ #define _ILOGHANDLER_H_ #include "UTF8String.h" #ifdef _WIN32 #include #else #include #endif #include using namespace std; namespace avg{ typedef unsigned severity_t; typedef UTF8String category_t; class AVG_API ILogSink { public: virtual void logMessage(const tm* pTime, unsigned millis, const category_t& category, severity_t severity, const UTF8String& sMsg) = 0; }; typedef boost::shared_ptr LogSinkPtr; } #endif libavg-1.8.2/src/base/IPlaybackEndListener.h000066400000000000000000000021561236127404500206440ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _IPlaybackEndListener_H_ #define _IPlaybackEndListener_H_ #include "../api.h" namespace avg { class AVG_API IPlaybackEndListener { public: virtual ~IPlaybackEndListener() {}; virtual void onPlaybackEnd() = 0; }; } #endif libavg-1.8.2/src/base/IPreRenderListener.h000066400000000000000000000021231236127404500203470ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _IPreRenderListener_H_ #define _IPreRenderListener_H_ namespace avg { class AVG_API IPreRenderListener { public: virtual ~IPreRenderListener() {}; virtual void onPreRender() = 0; }; } #endif libavg-1.8.2/src/base/Logger.cpp000066400000000000000000000206721236127404500164250ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "Logger.h" #include "Exception.h" #include "StandardLogSink.h" #include "OSHelper.h" #include #ifdef _WIN32 #include #include #include #undef ERROR #else #include #include #endif #include #include using namespace std; namespace ba = boost::algorithm; namespace avg { const severity_t Logger::severity::CRITICAL = 50; const severity_t Logger::severity::ERROR = 40; const severity_t Logger::severity::WARNING = 30; const severity_t Logger::severity::INFO = 20; const severity_t Logger::severity::DEBUG = 10; const severity_t Logger::severity::NONE = 0; const category_t Logger::category::NONE = UTF8String("NONE"); const category_t Logger::category::PROFILE = UTF8String("PROFILE"); const category_t Logger::category::PROFILE_VIDEO = UTF8String("PROFILE_V"); const category_t Logger::category::EVENTS = UTF8String("EVENTS"); const category_t Logger::category::CONFIG = UTF8String("CONFIG"); const category_t Logger::category::MEMORY = UTF8String("MEMORY"); const category_t Logger::category::APP = UTF8String("APP"); const category_t Logger::category::PLUGIN = UTF8String("PLUGIN"); const category_t Logger::category::PLAYER = UTF8String("PLAYER"); const category_t Logger::category::SHADER = UTF8String("SHADER"); const category_t Logger::category::DEPRECATION = UTF8String("DEPREC"); namespace { Logger* s_pLogger = 0; boost::mutex s_logMutex; boost::mutex s_traceMutex; boost::mutex s_sinkMutex; boost::mutex s_removeStdSinkMutex; } boost::mutex Logger::m_CategoryMutex; Logger * Logger::get() { lock_guard lock(s_logMutex); if (!s_pLogger) { s_pLogger = new Logger; } return s_pLogger; } Logger::Logger() { m_Severity = severity::WARNING; string sEnvSeverity; bool bEnvSeveritySet = getEnv("AVG_LOG_SEVERITY", sEnvSeverity); if(bEnvSeveritySet) { m_Severity = Logger::stringToSeverity(sEnvSeverity); } setupCategory(); string sEnvCategories; bool bEnvSet = getEnv("AVG_LOG_CATEGORIES", sEnvCategories); if (bEnvSet) { vector sCategories; ba::split(sCategories, sEnvCategories, ba::is_any_of(" "), ba::token_compress_on); vector::iterator it; for(it=sCategories.begin(); it!=sCategories.end(); it++) { string::size_type pos = (*it).find(":"); string sCategory; string sSeverity = "NONE"; if(pos == string::npos) { sCategory = *it; } else { vector tmpValues; ba::split( tmpValues, *it, ba::is_any_of(":"), ba::token_compress_on); sCategory = tmpValues.at(0); sSeverity = tmpValues.at(1); } severity_t severity = stringToSeverity(sSeverity); configureCategory(sCategory, severity); } } string sDummy; bool bEnvOmitStdErr = getEnv("AVG_LOG_OMIT_STDERR", sDummy); if (!bEnvOmitStdErr) { m_pStdSink = LogSinkPtr(new StandardLogSink); addLogSink(m_pStdSink); } } Logger::~Logger() { } void Logger::addLogSink(const LogSinkPtr& logSink) { lock_guard lock(s_sinkMutex); m_pSinks.push_back(logSink); } void Logger::removeLogSink(const LogSinkPtr& logSink) { lock_guard lock(s_sinkMutex); std::vector::iterator it; it = find(m_pSinks.begin(), m_pSinks.end(), logSink); if ( it != m_pSinks.end() ) { m_pSinks.erase(it); } } void Logger::removeStdLogSink() { lock_guard lock(s_removeStdSinkMutex); if ( m_pStdSink.get()) { removeLogSink(m_pStdSink); m_pStdSink = LogSinkPtr(); } } category_t Logger::configureCategory(category_t category, severity_t severity) { lock_guard lock(m_CategoryMutex); severity = (severity == Logger::severity::NONE) ? m_Severity : severity; UTF8String sCategory = boost::to_upper_copy(string(category)); CatToSeverityMap::iterator it; it = m_CategorySeverities.find(sCategory); if ( it != m_CategorySeverities.end()) { m_CategorySeverities.erase(sCategory); } pair element(sCategory, severity); m_CategorySeverities.insert(element); return sCategory; } CatToSeverityMap Logger::getCategories() { return m_CategorySeverities; } void Logger::trace(const UTF8String& sMsg, const category_t& category, severity_t severity) const { lock_guard lock(s_traceMutex); struct tm* pTime; #ifdef _WIN32 __int64 now; _time64(&now); pTime = _localtime64(&now); DWORD tms = timeGetTime(); unsigned millis = unsigned(tms % 1000); #else struct timeval time; gettimeofday(&time, NULL); pTime = localtime(&time.tv_sec); unsigned millis = time.tv_usec/1000; #endif lock_guard lockHandler(s_sinkMutex); std::vector::const_iterator it; for(it=m_pSinks.begin(); it!=m_pSinks.end(); ++it){ (*it)->logMessage(pTime, millis, category, severity, sMsg); } } void Logger::logDebug(const UTF8String& msg, const category_t& category) const { log(msg, category, Logger::severity::DEBUG); } void Logger::logInfo(const UTF8String& msg, const category_t& category) const { log(msg, category, Logger::severity::INFO); } void Logger::logWarning(const UTF8String& msg, const category_t& category) const { log(msg, category, Logger::severity::WARNING); } void Logger::logError(const UTF8String& msg, const category_t& category) const { log(msg, category, Logger::severity::ERROR); } void Logger::logCritical(const UTF8String& msg, const category_t& category) const { log(msg, category, Logger::severity::CRITICAL); } void Logger::log(const UTF8String& msg, const category_t& category, severity_t severity) const { if(shouldLog(category, severity)) { Logger::trace(msg, category, severity); } } void Logger::setupCategory() { configureCategory(category::NONE); configureCategory(category::PROFILE); configureCategory(category::PROFILE_VIDEO); configureCategory(category::EVENTS); configureCategory(category::CONFIG); configureCategory(category::MEMORY); configureCategory(category::APP); configureCategory(category::PLUGIN); configureCategory(category::PLAYER); configureCategory(category::SHADER); configureCategory(category::DEPRECATION); } severity_t Logger::stringToSeverity(const string& sSeverity) { string severity = boost::to_upper_copy(string(sSeverity)); if (severity == "CRIT") { return Logger::severity::CRITICAL; } else if (severity == "ERR") { return Logger::severity::ERROR; } else if (severity == "WARN") { return Logger::severity::WARNING; } else if (severity == "INFO") { return Logger::severity::INFO; } else if (severity == "DBG") { return Logger::severity::DEBUG; } else if (severity == "NONE") { return Logger::severity::NONE; } throw Exception(AVG_ERR_INVALID_ARGS, severity + " is an invalid log severity"); } const char * Logger::severityToString(severity_t severity) { if(severity == Logger::severity::CRITICAL) { return "CRIT"; } else if(severity == Logger::severity::ERROR) { return "ERR"; } else if(severity == Logger::severity::WARNING) { return "WARN"; } else if(severity == Logger::severity::INFO) { return "INFO"; } else if(severity == Logger::severity::DEBUG) { return "DBG"; } throw Exception(AVG_ERR_UNKNOWN, "Unkown log severity"); } } libavg-1.8.2/src/base/Logger.h000066400000000000000000000113771236127404500160740ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _Logger_H_ #define _Logger_H_ #include "Exception.h" #include "ILogSink.h" #include "UTF8String.h" #include "ThreadHelper.h" #include "../api.h" #include #include #include #include #include #include #ifdef ERROR #undef ERROR #endif namespace avg { typedef boost::unordered_map< const category_t, const severity_t > CatToSeverityMap; #ifdef _WIN32 // non dll-interface class used as base for dll-interface class #pragma warning(disable:4275) #endif class AVG_API Logger: private boost::noncopyable { public: struct AVG_API severity { static const severity_t CRITICAL; static const severity_t ERROR; static const severity_t WARNING; static const severity_t INFO; static const severity_t DEBUG; static const severity_t NONE; }; struct AVG_API category { static const category_t NONE; static const category_t PROFILE; static const category_t PROFILE_VIDEO; static const category_t EVENTS; static const category_t CONFIG; static const category_t MEMORY; static const category_t APP; static const category_t PLUGIN; static const category_t PLAYER; static const category_t SHADER; static const category_t DEPRECATION; }; static Logger* get(); virtual ~Logger(); static severity_t stringToSeverity(const string& sSeverity); static const char * severityToString(const severity_t severity); void addLogSink(const LogSinkPtr& logSink); void removeLogSink(const LogSinkPtr& logSink); void removeStdLogSink(); category_t configureCategory(category_t category, severity_t severity=severity::NONE); CatToSeverityMap getCategories(); void trace(const UTF8String& sMsg, const category_t& category, severity_t severity) const; void logDebug(const UTF8String& msg, const category_t& category=category::APP) const; void logInfo(const UTF8String& msg, const category_t& category=category::APP) const; void logWarning(const UTF8String& msg, const category_t& category=category::APP) const; void logError(const UTF8String& msg, const category_t& category=category::APP) const; void logCritical(const UTF8String& msg, const category_t& category=category::APP) const; void log(const UTF8String& msg, const category_t& category=category::APP, severity_t severity=severity::INFO) const; inline bool shouldLog(const category_t& category, severity_t severity) const { lock_guard lock(m_CategoryMutex); try { severity_t targetSeverity = m_CategorySeverities.at(category); return (targetSeverity <= severity); } catch (out_of_range e){ string msg("Unknown category: " + category); throw Exception(AVG_ERR_INVALID_ARGS, msg); } } private: Logger(); void setupCategory(); std::vector m_pSinks; LogSinkPtr m_pStdSink; CatToSeverityMap m_CategorySeverities; severity_t m_Severity; static boost::mutex m_CategoryMutex; }; #define AVG_TRACE(category, severity, sMsg) { \ if (Logger::get()->shouldLog(category, severity)) { \ std::stringstream tmp(std::stringstream::in | std::stringstream::out); \ tmp << sMsg; \ Logger::get()->trace(tmp.str(), category, severity); \ }\ }\ #define AVG_LOG_ERROR(sMsg){ \ AVG_TRACE(Logger::category::NONE, Logger::severity::ERROR, sMsg); \ }\ #define AVG_LOG_WARNING(sMsg){ \ AVG_TRACE(Logger::category::NONE, Logger::severity::WARNING, sMsg); \ }\ #define AVG_LOG_INFO(sMsg){ \ AVG_TRACE(Logger::category::NONE, Logger::severity::INFO, sMsg); \ }\ #define AVG_LOG_DEBUG(sMsg){ \ AVG_TRACE(Logger::category::NONE, Logger::severity::DEBUG, sMsg); \ }\ } #endif libavg-1.8.2/src/base/Makefile.am000066400000000000000000000031251236127404500165300ustar00rootroot00000000000000SUBDIRS = triangulate AM_CPPFLAGS = -I.. @XML2_CFLAGS@ @PTHREAD_CFLAGS@ ALL_H = FileHelper.h Exception.h Logger.h ConfigMgr.h ObjectCounter.h \ XMLHelper.h TimeSource.h ProfilingZone.h ThreadProfiler.h \ ScopeTimer.h IFrameEndListener.h IPreRenderListener.h IPlaybackEndListener.h \ Test.h TestSuite.h OSHelper.h Queue.h WorkerThread.h Command.h ObjectCounter.h \ Rect.h Directory.h DirEntry.h StringHelper.h MathHelper.h GeomHelper.h \ CubicSpline.h BezierCurve.h UTF8String.h Triangle.h DAG.h \ WideLine.h DlfcnWrapper.h Signal.h Backtrace.h \ CmdQueue.h ProfilingZoneID.h GLMHelper.h StandardLogSink.h ILogSink.h \ ThreadHelper.h TESTS = testbase EXTRA_DIST = DlfcnWrapper.cpp noinst_LTLIBRARIES = libbase.la libbase_la_SOURCES = FileHelper.cpp Exception.cpp Logger.cpp \ ConfigMgr.cpp XMLHelper.cpp TimeSource.cpp OSHelper.cpp \ ProfilingZone.cpp ThreadProfiler.cpp ScopeTimer.cpp Test.cpp \ TestSuite.cpp ObjectCounter.cpp Directory.cpp DirEntry.cpp \ StringHelper.cpp MathHelper.cpp GeomHelper.cpp CubicSpline.cpp \ BezierCurve.cpp UTF8String.cpp Triangle.cpp DAG.cpp WideLine.cpp \ Backtrace.cpp ProfilingZoneID.cpp GLMHelper.cpp \ WorkerThread.cpp StandardLogSink.cpp ThreadHelper.cpp \ $(ALL_H) libbase_a_CXXFLAGS = -Wno-format-y2k noinst_PROGRAMS = testbase testbase_SOURCES = testbase.cpp $(ALL_H) testbase_LDADD = ./libbase.la ./triangulate/libtriangulate.la \ @BOOST_THREAD_LIBS@ @XML2_LIBS@ @PTHREAD_LIBS@ # -rdynamic needed only for testBacktrace to work under linux. testbase_LDFLAGS = -rdynamic libavg-1.8.2/src/base/MathHelper.cpp000066400000000000000000000037661236127404500172440ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "MathHelper.h" #include #include using namespace std; namespace avg { bool ispow2(int n) { return ((n & (n-1)) == 0); } int nextpow2(int n) { n--; n |= n >> 1; // handle 2 bit numbers n |= n >> 2; // handle 4 bit numbers n |= n >> 4; // handle 8 bit numbers n |= n >> 8; // handle 16 bit numbers n |= n >> 16; // handle 32 bit numbers n++; return n; } int safeCeil(float d) { if (fabs(d-int(d)) < EPSILON) { return int(d); } else { return int(d)+1; } } float invSqrt(float x) { #if 0 // TODO: This gives incorrect results on Athlon X2, gcc 4.2. float xhalf = 0.5f*x; int i = *(int*)&x; // get bits for floating value i = 0x5f3759d5 - (i>>1); // give initial guess y0 x = *(float*)&i; // convert bits back to float x *= 1.5f - xhalf*x*x; // newton step, repeating this step // increases accuracy x *= 1.5f - xhalf*x*x; return x; #endif return 1/sqrt(x); } bool almostEqual(float d1, float d2, float epsilon) { return (fabs(d1-d2) #include #include #ifndef M_PI #define M_PI 3.14159265358979323846 #endif namespace avg { static const float PI = 3.14159265358979323846f; static const float EPSILON = 0.00001f; bool ispow2(int n); int nextpow2(int n); int safeCeil(float d); bool almostEqual(float d1, float d2, float epsilon=EPSILON); float invSqrt(float x); template T sqr(T d) { return d*d; } template int sgn(T val) { return int(val/fabs(val)); } template std::vector vectorFromCArray(int n, T* pData) { std::vector v; for (int i=0; i std::vector > vector2DFromCArray(int n, int m, T* pData) { std::vector > v(4, std::vector()); for (int i=0; i T round(T d) { return floor(d + 0.5f); } #endif } #endif libavg-1.8.2/src/base/OSHelper.cpp000066400000000000000000000210641236127404500166630ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "OSHelper.h" #include "FileHelper.h" #include "Logger.h" #include "FileHelper.h" #include "Exception.h" #if defined(_WIN32) #include #include #undef ERROR #undef WARNING #elif defined(__APPLE__) #include #include #include #elif defined(__linux) #include #include #include #endif #include #include #include using namespace std; namespace avg { #ifdef _WIN32 string getWinErrMsg(unsigned err) { LPVOID lpMsgBuf; FormatMessage(FORMAT_MESSAGE_ALLOCATE_BUFFER | FORMAT_MESSAGE_FROM_SYSTEM | FORMAT_MESSAGE_IGNORE_INSERTS, NULL, err, MAKELANGID(LANG_NEUTRAL, SUBLANG_DEFAULT), (LPTSTR) &lpMsgBuf, 0, NULL ); string sMsg((char*)lpMsgBuf); LocalFree(lpMsgBuf); return sMsg; } #endif #if defined(__linux) // Adapted from binreloc static char * _br_find_exe_for_symbol (const void *symbol) { #define SIZE 1024 FILE *f; size_t address_string_len; char *address_string, line[SIZE], *found; if (symbol == NULL) return (char *) NULL; f = fopen ("/proc/self/maps", "r"); if (f == NULL) return (char *) NULL; address_string_len = 4; address_string = (char *) malloc(address_string_len); found = (char *) NULL; while (!feof (f)) { char *start_addr, *end_addr, *end_addr_end, *file; void *start_addr_p, *end_addr_p; size_t len; if (fgets (line, SIZE, f) == NULL) break; /* Sanity check. */ if (strstr (line, " r-xp ") == NULL || strchr (line, '/') == NULL) continue; /* Parse line. */ start_addr = line; end_addr = strchr (line, '-'); file = strchr (line, '/'); /* More sanity check. */ if (!(file > end_addr && end_addr != NULL && end_addr[0] == '-')) continue; end_addr[0] = '\0'; end_addr++; end_addr_end = strchr (end_addr, ' '); if (end_addr_end == NULL) continue; end_addr_end[0] = '\0'; len = strlen (file); if (len == 0) continue; if (file[len - 1] == '\n') file[len - 1] = '\0'; /* Get rid of "(deleted)" from the filename. */ len = strlen (file); if (len > 10 && strcmp (file + len - 10, " (deleted)") == 0) file[len - 10] = '\0'; /* I don't know whether this can happen but better safe than sorry. */ len = strlen (start_addr); if (len != strlen (end_addr)) continue; /* Transform the addresses into a string in the form of 0xdeadbeef, * then transform that into a pointer. */ if (address_string_len < len + 3) { address_string_len = len + 3; address_string = (char *) realloc (address_string, address_string_len); } memcpy (address_string, "0x", 2); memcpy (address_string + 2, start_addr, len); address_string[2 + len] = '\0'; sscanf (address_string, "%p", &start_addr_p); memcpy (address_string, "0x", 2); memcpy (address_string + 2, end_addr, len); address_string[2 + len] = '\0'; sscanf (address_string, "%p", &end_addr_p); if (symbol >= start_addr_p && symbol < end_addr_p) { found = file; break; } } free (address_string); fclose (f); if (found == NULL) return (char *) NULL; else return strdup (found); } #endif string getAvgLibPath() { #if defined(_WIN32) HMODULE hModule = GetModuleHandle("avg.pyd"); char szFilename[1024]; DWORD ok = GetModuleFileName(hModule, szFilename, sizeof(szFilename)); if (ok == 0) { AVG_LOG_ERROR("getAvgLibPath(): " << getWinErrMsg(GetLastError())); exit(5); } string sPath=getPath(szFilename); return sPath; #elif defined(__APPLE__) // We need to iterate through all images attached to the current executable // and figure out which one is the one we are interested in. uint32_t numImages = _dyld_image_count(); for (uint32_t i=0; i> vmsize >> rssize; return rssize*(size_t)(getpagesize()); #endif #endif } std::string convertUTF8ToFilename(const std::string & sName) { #ifdef _WIN32 // Conversion from utf-8 to something windows can use: // utf-8 long filename -> utf-16 long filename -> utf-16 short filename (8.3) // -> utf-8 short filename (= ASCII short filename). wchar_t wideString[2048]; int err1 = MultiByteToWideChar(CP_UTF8, 0, sName.c_str(), sName.size()+1, wideString, 2048); if (err1 == 0) { AVG_LOG_WARNING("Error in unicode conversion (MultiByteToWideChar): " << getWinErrMsg(GetLastError())); return sName; } wchar_t wideShortFName[2048]; DWORD err2 = GetShortPathNameW(wideString, wideShortFName, 1024); if (err2 != 0) { char pShortName[1024]; err1 = WideCharToMultiByte(CP_UTF8, 0, wideShortFName, -1, pShortName, 1024, 0, 0); if (err1 == 0) { AVG_LOG_WARNING("Error in unicode conversion (MultiByteToWideChar): " << getWinErrMsg(GetLastError())); } return pShortName; } else { return sName; } #else return sName; #endif } #ifdef __APPLE__ int reallyGetOSXMajorVersion() { utsname sysInfo; int rc = uname(&sysInfo); AVG_ASSERT(rc == 0); // cerr << sysInfo.sysname << ", " << sysInfo.nodename << ", " << sysInfo.release << // ", " << sysInfo.version << ", " << sysInfo.machine << endl; istringstream ss(sysInfo.release); int major; int minor; int dot; char c; ss >> major >> c >> minor >> c >> dot; return major; } int getOSXMajorVersion() { static int major = reallyGetOSXMajorVersion(); // only called once for speed reasons. return major; } #endif } libavg-1.8.2/src/base/OSHelper.h000066400000000000000000000027301236127404500163270ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _OSHelper_H_ #define _OSHelper_H_ #include "../api.h" #include namespace avg { #ifdef _WIN32 std::string getWinErrMsg(unsigned err); #endif std::string getAvgLibPath(); bool getEnv(const std::string & sName, std::string & sVal); void setEnv(const std::string & sName, const std::string & sVal); size_t getMemoryUsage(); // Converts a utf-8-encoded filename to something windows can use. // Under other operating systems, returns the input string. AVG_API std::string convertUTF8ToFilename(const std::string & sName); #ifdef __APPLE__ int getOSXMajorVersion(); #endif } #endif libavg-1.8.2/src/base/ObjectCounter.cpp000066400000000000000000000114451236127404500177520ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "ObjectCounter.h" #include "Exception.h" #include "Logger.h" #include #include #include #include #include #ifdef WIN32 #include #include #else #include #endif #define DEBUG_ALLOC 1 namespace avg { using namespace std; ObjectCounter* ObjectCounter::s_pObjectCounter = 0; bool ObjectCounter::s_bDeleted = false; boost::mutex * pCounterMutex; void deleteObjectCounter() { delete ObjectCounter::s_pObjectCounter; delete pCounterMutex; ObjectCounter::s_pObjectCounter = 0; } ObjectCounter::ObjectCounter() { } ObjectCounter::~ObjectCounter() { s_bDeleted = true; } ObjectCounter * ObjectCounter::get() { if (!s_pObjectCounter) { if (s_bDeleted) { // This is _after_ the deleteObjectCounter has been called. return 0; } else { s_pObjectCounter = new ObjectCounter; pCounterMutex = new boost::mutex; atexit(deleteObjectCounter); } } return s_pObjectCounter; } void ObjectCounter::incRef(const std::type_info* pType) { #ifdef DEBUG_ALLOC lock_guard Lock(*pCounterMutex); TypeMap::iterator MapEntry = m_TypeMap.find(pType); if (MapEntry == m_TypeMap.end()) { m_TypeMap[pType] = 1; } else { (MapEntry->second)++; } // cerr << "incRef " << demangle(pType->name()) << ":" << m_TypeMap[pType] << endl; #endif } void ObjectCounter::decRef(const std::type_info* pType) { #ifdef DEBUG_ALLOC if (!this) { // This happens if there are counted static objects that are deleted after // s_pObjectCounter has been deleted. return; } lock_guard Lock(*pCounterMutex); TypeMap::iterator MapEntry = m_TypeMap.find(pType); if (MapEntry == m_TypeMap.end()) { cerr << "ObjectCounter for " << demangle(pType->name()) << " does not exist." << endl; // Can't decref a type that hasn't been incref'd. AVG_ASSERT(false); } else { (MapEntry->second)--; if (MapEntry->second < 0) { cerr << "ObjectCounter: refcount for " << demangle(MapEntry->first->name()) << " < 0" << endl; AVG_ASSERT(false); } } // cerr << "decRef " << demangle(pType->name()) << ":" << MapEntry->second << endl; #endif } int ObjectCounter::getCount(const std::type_info* pType) { TypeMap::iterator MapEntry = m_TypeMap.find(pType); if (MapEntry == m_TypeMap.end()) { return 0; } else { return MapEntry->second; } } std::string ObjectCounter::dump() { stringstream ss; ss << "Object dump: " << endl; TypeMap::iterator it; vector strings; for (it = m_TypeMap.begin(); it != m_TypeMap.end(); ++it) { stringstream tempStream; if (it->second > 0) { tempStream << " " << demangle(it->first->name()) << ": " << it->second; strings.push_back(tempStream.str()); } } sort(strings.begin(), strings.end()); for (vector::iterator it=strings.begin(); it != strings.end(); ++it) { ss << *it << endl; } return ss.str(); } string ObjectCounter::demangle(string s) { int rc; string sResult; #ifdef _WIN32 char szDemangledName[2048]; rc = int(UnDecorateSymbolName(s.c_str(), szDemangledName, sizeof(szDemangledName), UNDNAME_COMPLETE)); if (rc) { sResult = szDemangledName; } else { int error = GetLastError(); printf("UnDecorateSymbolName returned error %d\n", error); sResult = s; } #else char * pszDemangled = abi::__cxa_demangle(s.c_str(), 0, 0, &rc); if (rc) { sResult = s; } else { sResult = pszDemangled; } if (pszDemangled) { free(pszDemangled); } #endif return sResult; } TypeMap ObjectCounter::getObjectCount(){ return m_TypeMap; } } libavg-1.8.2/src/base/ObjectCounter.h000066400000000000000000000031561236127404500174170ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _ObjectCounter_H_ #define _ObjectCounter_H_ #include "../api.h" #include #include #include namespace avg { typedef std::map TypeMap; class AVG_API ObjectCounter { public: static ObjectCounter* get(); virtual ~ObjectCounter(); void incRef(const std::type_info* pType); void decRef(const std::type_info* pType); int getCount(const std::type_info* pType); std::string demangle(std::string s); std::string dump(); TypeMap getObjectCount(); private: ObjectCounter(); static void deleteSingleton(); TypeMap m_TypeMap; static ObjectCounter* s_pObjectCounter; static bool s_bDeleted; friend void deleteObjectCounter(); }; } #endif libavg-1.8.2/src/base/ProfilingZone.cpp000066400000000000000000000037511236127404500177720ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "ProfilingZone.h" #include "ObjectCounter.h" #include using namespace boost; using namespace std; namespace avg { ProfilingZone::ProfilingZone(const ProfilingZoneID& zoneID) : m_TimeSum(0), m_AvgTime(0), m_NumFrames(0), m_Indent(0), m_ZoneID(zoneID) { ObjectCounter::get()->incRef(&typeid(*this)); } ProfilingZone::~ProfilingZone() { ObjectCounter::get()->decRef(&typeid(*this)); } void ProfilingZone::restart() { m_NumFrames = 0; m_AvgTime = 0; m_TimeSum = 0; } void ProfilingZone::reset() { m_NumFrames++; m_AvgTime = (m_AvgTime*(m_NumFrames-1)+m_TimeSum)/m_NumFrames; m_TimeSum = 0; } long long ProfilingZone::getUSecs() const { return m_TimeSum; } long long ProfilingZone::getAvgUSecs() const { return m_AvgTime; } void ProfilingZone::setIndentLevel(int indent) { m_Indent = indent; } int ProfilingZone::getIndentLevel() const { return m_Indent; } string ProfilingZone::getIndentString() const { return string(m_Indent, ' '); } const string& ProfilingZone::getName() const { return m_ZoneID.getName(); } } libavg-1.8.2/src/base/ProfilingZone.h000066400000000000000000000035331236127404500174350ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _ProfilingZone_H_ #define _ProfilingZone_H_ #include "../api.h" #include "ProfilingZoneID.h" #include "TimeSource.h" #include namespace avg { class AVG_API ProfilingZone { public: ProfilingZone(const ProfilingZoneID& zoneID); virtual ~ProfilingZone(); void restart(); void start() { m_StartTime = TimeSource::get()->getCurrentMicrosecs(); }; void stop() { m_TimeSum += TimeSource::get()->getCurrentMicrosecs()-m_StartTime; }; void reset(); long long getUSecs() const; long long getAvgUSecs() const; void setIndentLevel(int indent); int getIndentLevel() const; std::string getIndentString() const; const std::string& getName() const; private: long long m_TimeSum; long long m_AvgTime; long long m_StartTime; int m_NumFrames; int m_Indent; const ProfilingZoneID& m_ZoneID; }; typedef boost::shared_ptr ProfilingZonePtr; } #endif libavg-1.8.2/src/base/ProfilingZoneID.cpp000066400000000000000000000027631236127404500202110ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "ProfilingZoneID.h" #include "ThreadProfiler.h" using namespace std; namespace avg { ProfilingZoneID::ProfilingZoneID(const string& sName, bool bMultithreaded) : m_sName(sName), m_bMultithreaded(bMultithreaded), m_pProfiler(0) { } ProfilingZoneID::~ProfilingZoneID() { } const string& ProfilingZoneID::getName() const { return m_sName; } ThreadProfiler* ProfilingZoneID::getProfiler() { if (!m_pProfiler) { if (m_bMultithreaded) { return ThreadProfiler::get(); } else { m_pProfiler = ThreadProfiler::get(); } } return m_pProfiler; } } libavg-1.8.2/src/base/ProfilingZoneID.h000066400000000000000000000025141236127404500176500ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _ProfilingZoneID_H_ #define _ProfilingZoneID_H_ #include "../api.h" #include namespace avg { class ThreadProfiler; class AVG_API ProfilingZoneID { public: ProfilingZoneID(const std::string& sName, bool bMultithreaded=false); ~ProfilingZoneID(); const std::string& getName() const; ThreadProfiler* getProfiler(); private: std::string m_sName; bool m_bMultithreaded; ThreadProfiler* m_pProfiler; }; } #endif libavg-1.8.2/src/base/Queue.h000066400000000000000000000073001236127404500157300ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _Queue_H_ #define _Queue_H_ #include "../api.h" #include "Exception.h" #include #include #include #include #include namespace avg { typedef boost::unique_lock unique_lock; template class AVG_TEMPLATE_API Queue { public: typedef boost::shared_ptr QElementPtr; Queue(int maxSize=-1); virtual ~Queue(); bool empty() const; QElementPtr pop(bool bBlock = true); void clear(); void push(const QElementPtr& pElem); QElementPtr peek(bool bBlock = true) const; int size() const; int getMaxSize() const; private: QElementPtr getFrontElement(bool bBlock, unique_lock& Lock) const; std::deque m_pElements; mutable boost::mutex m_Mutex; mutable boost::condition m_Cond; int m_MaxSize; }; template Queue::Queue(int maxSize) : m_MaxSize(maxSize) { } template Queue::~Queue() { } template bool Queue::empty() const { unique_lock Lock(m_Mutex); return m_pElements.empty(); } template typename Queue::QElementPtr Queue::pop(bool bBlock) { unique_lock lock(m_Mutex); QElementPtr pElem = getFrontElement(bBlock, lock); if (pElem) { m_pElements.pop_front(); m_Cond.notify_one(); } return pElem; } template void Queue::clear() { QElementPtr pElem; do { pElem = pop(false); } while (pElem); } template typename Queue::QElementPtr Queue::peek(bool bBlock) const { unique_lock lock(m_Mutex); QElementPtr pElem = getFrontElement(bBlock, lock); if (pElem) { m_Cond.notify_one(); } return pElem; } template void Queue::push(const QElementPtr& pElem) { assert(pElem); unique_lock lock(m_Mutex); if (m_pElements.size() == (unsigned)m_MaxSize) { while (m_pElements.size() == (unsigned)m_MaxSize) { m_Cond.wait(lock); } } m_pElements.push_back(pElem); m_Cond.notify_one(); } template int Queue::size() const { unique_lock lock(m_Mutex); return int(m_pElements.size()); } template int Queue::getMaxSize() const { unique_lock lock(m_Mutex); return m_MaxSize; } template typename Queue::QElementPtr Queue::getFrontElement(bool bBlock, unique_lock& lock) const { if (m_pElements.empty()) { if (bBlock) { while (m_pElements.empty()) { m_Cond.wait(lock); } } else { return QElementPtr(); } } return m_pElements.front(); } } #endif libavg-1.8.2/src/base/Rect.h000066400000000000000000000113031236127404500155370ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _Rect_H_ #define _Rect_H_ #include "../api.h" #include "../base/GLMHelper.h" #include "../glm/glm.hpp" #include namespace avg { // Simple rectangle class. // If NUM is an integer, contains all points from tl up to but not including // br. template class AVG_TEMPLATE_API Rect { public: typedef glm::detail::tvec2 Vec2; Vec2 tl; Vec2 br; Rect(); Rect(NUM left, NUM top, NUM right, NUM bottom); Rect(const Vec2& TL, const Vec2& BR); template Rect(const Rect& rc); bool operator ==(const Rect& rect) const; bool operator !=(const Rect & rect) const; NUM width() const; NUM height() const; Vec2 center() const; void setWidth(NUM width); void setHeight(NUM height); void setSize(const Vec2& size); bool contains(const Vec2& pt) const; bool contains(const Rect& rect) const; bool intersects(const Rect& rect) const; void expand(const Rect& rect); void intersect(const Rect& rect); Vec2 size() const; Vec2 cropPoint(const Vec2& pt) const; }; template std::ostream& operator<<( std::ostream& os, const Rect &r) { os << "(" << r.tl << "-" << r.br << ")"; return os; } typedef Rect FRect; typedef Rect IntRect; template Rect::Rect() {} template Rect::Rect(const Vec2& TL, const Vec2& BR) : tl(TL), br(BR) {} template Rect::Rect(NUM left, NUM top, NUM right, NUM bottom) : tl(left, top), br(right, bottom) {} template template Rect::Rect(const Rect& rc) : tl (NUM(rc.tl.x), NUM(rc.tl.y)), br (NUM(rc.br.x), NUM(rc.br.y)) { } template bool Rect::operator ==(const Rect & rect) const { return (tl == rect.tl && br == rect.br); } template bool Rect::operator !=(const Rect & rect) const { return !(rect==*this); } template NUM Rect::width() const { return br.x-tl.x; } template NUM Rect::height() const { return br.y-tl.y; } template glm::detail::tvec2 Rect::center() const { return Vec2(tl+br)/2; } template void Rect::setWidth(NUM width) { br.x = tl.x+width; } template void Rect::setHeight(NUM height) { br.y = tl.y+height; } template void Rect::setSize(const Vec2& size) { setWidth(size.x); setHeight(size.y); } template bool Rect::contains(const Vec2& pt) const { return (pt.x >= tl.x && pt.x < br.x && pt.y >= tl.y && pt.y < br.y); } template bool Rect::contains(const Rect& rect) const { Vec2 brpt (rect.br.x-1, rect.br.y-1); return Contains(rect.tl) && Contains(brpt); } template bool Rect::intersects(const Rect& rect) const { if (rect.br.x <= tl.x || rect.tl.x >= br.x || rect.br.y <= tl.y || rect.tl.y >= br.y) return false; else return true; } template void Rect::expand(const Rect& rect) { tl.x = glm::min(tl.x, rect.tl.x); tl.y = glm::min(tl.y, rect.tl.y); br.x = glm::max(br.x, rect.br.x); br.y = glm::max(br.y, rect.br.y); } template void Rect::intersect(const Rect& rect) { tl.x = glm::max(tl.x, rect.tl.x); tl.y = glm::max(tl.y, rect.tl.y); br.x = glm::min(br.x, rect.br.x); br.y = glm::min(br.y, rect.br.y); } template glm::detail::tvec2 Rect::size() const { return Vec2(width(), height()); } template glm::detail::tvec2 Rect::cropPoint(const Vec2& pt) const { Vec2 Result; Result.x = std::min(std::max(pt.x, tl.x), br.x-1); Result.y = std::min(std::max(pt.y, tl.y), br.y-1); return Result; } #undef min #undef max } #endif libavg-1.8.2/src/base/ScopeTimer.cpp000066400000000000000000000020721236127404500172520ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "ScopeTimer.h" using namespace std; namespace avg { bool ScopeTimer::s_bTimersEnabled = false; void ScopeTimer::enableTimers(bool bEnable) { s_bTimersEnabled = bEnable; } } libavg-1.8.2/src/base/ScopeTimer.h000066400000000000000000000030311236127404500167130ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _ScopeTimer_H_ #define _ScopeTimer_H_ #include "../api.h" #include "ProfilingZoneID.h" #include "ThreadProfiler.h" namespace avg { class AVG_API ScopeTimer { public: ScopeTimer(ProfilingZoneID& zoneID) { if (s_bTimersEnabled) { m_pZoneID = &zoneID; m_pZoneID->getProfiler()->startZone(zoneID); } else { m_pZoneID = 0; } }; ~ScopeTimer() { if (m_pZoneID) { m_pZoneID->getProfiler()->stopZone(*m_pZoneID); } }; static void enableTimers(bool bEnable); private: ProfilingZoneID* m_pZoneID; static bool s_bTimersEnabled; }; } #endif libavg-1.8.2/src/base/Signal.h000066400000000000000000000063671236127404500160750ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _Signal_H_ #define _Signal_H_ #include "../api.h" #include "Exception.h" #include namespace avg { // Simple implementation of a signal/slot mechanism. // Might need to be replaced by boost::signal when things get more complicated. template class AVG_TEMPLATE_API Signal { public: typedef void (LISTENEROBJ::*ListenerFunc)() ; Signal(ListenerFunc pFunc); virtual ~Signal(); void connect(LISTENEROBJ* pListener); void disconnect(LISTENEROBJ* pListener); void emit(); int getNumListeners() const; private: ListenerFunc m_pFunc; std::list m_Listeners; typedef typename std::list::iterator ListenerIterator; LISTENEROBJ* m_pCurrentListener; bool m_bKillCurrentListener; }; template Signal::Signal(ListenerFunc pFunc) : m_pFunc(pFunc), m_pCurrentListener(0), m_bKillCurrentListener(false) { } template Signal::~Signal() { } template void Signal::connect(LISTENEROBJ* pListener) { ListenerIterator it; it = find(m_Listeners.begin(), m_Listeners.end(), pListener); // If the listener is already connected, something is wrong, unless we're // deleting it at this very moment. AVG_ASSERT(it == m_Listeners.end() || (*it == m_pCurrentListener && m_bKillCurrentListener)); m_Listeners.push_back(pListener); } template void Signal::disconnect(LISTENEROBJ* pListener) { if (m_pCurrentListener == pListener) { m_bKillCurrentListener = true; } else { ListenerIterator it; it = find(m_Listeners.begin(), m_Listeners.end(), pListener); AVG_ASSERT(it != m_Listeners.end()); m_Listeners.erase(it); } } template void Signal::emit() { ListenerIterator it; for (it=m_Listeners.begin(); it != m_Listeners.end();) { m_pCurrentListener = *it; ((*it)->*m_pFunc)(); // This is the actual call to the listener. if (m_bKillCurrentListener) { it = m_Listeners.erase(it); m_bKillCurrentListener = false; } else { ++it; } } m_pCurrentListener = 0; } template int Signal::getNumListeners() const { return m_Listeners.size(); } } #endif libavg-1.8.2/src/base/StandardLogSink.cpp000066400000000000000000000031421236127404500202260ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de #include "StandardLogSink.h" #include "Logger.h" #include #include using namespace std; namespace avg { StandardLogSink::StandardLogSink() { } StandardLogSink::~StandardLogSink() { } void StandardLogSink::logMessage(const tm* pTime, unsigned millis, const category_t& category, severity_t severity, const UTF8String& sMsg) { char timeString[256]; strftime(timeString, sizeof(timeString), "%y-%m-%d %H:%M:%S", pTime); cerr << "[" << timeString << "." << setw(3) << setfill('0') << millis << setw(0) << "]["; cerr << setw(4) << setfill('.') << Logger::severityToString(severity) << "]["; cerr << setw(9) << setfill('.') << category << "] : " << sMsg << endl; cerr.flush(); } } libavg-1.8.2/src/base/StandardLogSink.h000066400000000000000000000023431236127404500176750ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de #ifndef _StandardLogSink_H_ #define _StandardLogSink_H_ #include "ILogSink.h" namespace avg{ class StandardLogSink: public ILogSink { public: StandardLogSink(); virtual ~StandardLogSink (); virtual void logMessage(const tm* pTime, unsigned millis, const category_t& category, severity_t severity, const UTF8String& sMsg); }; } #endif libavg-1.8.2/src/base/StringHelper.cpp000066400000000000000000000067641236127404500176220ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "StringHelper.h" #include #include #include #include #include using namespace std; namespace avg { bool isWhitespace(const string& s) { return s.find_first_not_of(" \n\r\t") == s.npos; } void skipWhitespace(std::istream& is) { string sWhitespace(" \n\r\t"); bool bWhitespace; do { int i = is.peek(); if (i == EOF) { bWhitespace = false; } else { bWhitespace = (sWhitespace.find(char(i)) != sWhitespace.npos); } if (bWhitespace) { is.ignore(); } } while (bWhitespace); } void skipToken(std::istream& is, char token) { skipWhitespace(is); int i = is.peek(); if (i == token) { is.ignore(); } else { is.setstate(ios::failbit); } } int stringToInt(const string& s) { int i; fromString(s, i); return i; } float stringToFloat(const string& s) { float d; fromString(s, d); return d; } bool stringToBool(const string& s) { // avg usually wants xml attributes in lowercase, but python only // sees 'True' as true, so we'll accept that too. Also, python 2.3 // has 1 as true, so that has to be ok too. if (s == "True" || s == "true" || s == "1") { return true; } if (s == "False" || s == "false" || s == "0") { return false; } throw (Exception(AVG_ERR_TYPE, string("Could not convert ")+s+" to bool.")); } std::string removeStartEndSpaces(const string& s) { string sResult = s; while (sResult.size() > 0 && (sResult[0] == ' ' || sResult[0] == '\n' || sResult[0] == '\r' || sResult[0] == '\t')) { sResult.erase(0, 1); } if (sResult.size() == 0) { return sResult; } char c = sResult[sResult.length()-1]; while (c == ' ' || c == '\n' || c == '\r' || c == '\t') { sResult.erase(sResult.length()-1, 1); c = sResult[sResult.length()-1]; } return sResult; } string toLowerCase(const string& s) { string sResult; for (unsigned i=0; i #include #include #include #include #ifdef __GNUC__ #include #endif namespace avg { bool AVG_API isWhitespace(const std::string& s); void AVG_API skipWhitespace(std::istream& is); void AVG_API skipToken(std::istream& is, char token); template std::istream& operator >>(std::istream& is, std::vector& v) { skipToken(is, '('); skipWhitespace(is); int c = is.peek(); if (c == ')') { is.ignore(); return is; } bool bDone = false; do { T elem; is >> elem; v.push_back(elem); skipWhitespace(is); int c = is.peek(); switch(c) { case ',': is.ignore(); break; case ')': bDone = true; is.ignore(); break; default: is.setstate(std::ios::failbit); bDone = true; } } while (!bDone); return is; } int AVG_API stringToInt(const std::string& s); float AVG_API stringToFloat(const std::string& s); bool AVG_API stringToBool(const std::string& s); std::string AVG_API removeStartEndSpaces(const std::string& s); std::string AVG_API toLowerCase(const std::string& s); bool AVG_API equalIgnoreCase(const std::string& s1, const std::string& s2); template std::string toString(const T& i) { std::stringstream stream; stream << i; return stream.str(); } std::string AVG_API toString(const bool& b); template std::string getFriendlyTypeName(const T& dummy) { std::string sTypeName = typeid(T).name(); #ifdef __GNUC__ int status; char* const pClearName = abi::__cxa_demangle (sTypeName.c_str(), 0, 0, &status); if (status == 0) { sTypeName = pClearName; } #endif return sTypeName; } template void fromString(const std::string& s, T& result) { std::stringstream stream(s); bool bOk = (stream >> result) != 0; if (bOk) { std::string sLeftover; stream >> sLeftover; bOk = isWhitespace(sLeftover); } if (!bOk) { std::string sTypeName = getFriendlyTypeName(result); throw (Exception(AVG_ERR_TYPE, std::string("Could not convert '")+s + "' to "+sTypeName+".")); } } } #endif libavg-1.8.2/src/base/Test.cpp000066400000000000000000000046641236127404500161300ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "Test.h" #include "../base/OSHelper.h" #include #include using namespace std; namespace avg { string Test::s_sSrcDirName; Test::Test(const string & sName, int indentLevel) : m_IndentLevel(indentLevel), m_NumSucceeded(0), m_NumFailed(0), m_sName(sName) { } Test::~Test() { } void Test::test(bool b, const char * pszFile, int line) { if (b) { m_NumSucceeded++; } else { cerr << string(m_IndentLevel, ' ') << " ---->> failed at " << pszFile << ", " << line << endl; m_NumFailed++; } } bool Test::isOk() { return m_NumFailed == 0; } void Test::setFailed() { m_NumFailed++; } int Test::getNumSucceeded() const { return m_NumSucceeded; } int Test::getNumFailed() const { return m_NumFailed; } const std::string& Test::getName() const { return m_sName; } void Test::aggregateStatistics(const Test& ChildTest) { m_NumSucceeded += ChildTest.getNumSucceeded(); m_NumFailed += ChildTest.getNumFailed(); } void Test::printResults() { if (m_NumFailed == 0) { cerr << string(m_IndentLevel, ' ') << m_sName << " succeeded." << endl; } else { cerr << string(m_IndentLevel, ' ') << "######## " << m_sName << " failed. ########" << endl; } } const string& Test::getSrcDirName() { if (s_sSrcDirName == "") { bool bInEnviron = getEnv("srcdir", s_sSrcDirName); if (!bInEnviron) { s_sSrcDirName = "."; } s_sSrcDirName += "/"; } return s_sSrcDirName; } } libavg-1.8.2/src/base/Test.h000066400000000000000000000043571236127404500155740ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _Test_H_ #define _Test_H_ #include "../api.h" #include #include #include #include namespace avg { class AVG_API Test { public: Test(const std::string & sName, int indentLevel); virtual ~Test(); bool isOk(); virtual void runTests() = 0; void test(bool b, const char * pszFile, int line); void setFailed(); int getNumSucceeded() const; int getNumFailed() const; const std::string& getName() const; void aggregateStatistics(const Test& childTest); virtual void printResults(); protected: static const std::string& getSrcDirName(); static std::string s_sSrcDirName; int m_IndentLevel; private: int m_NumSucceeded; int m_NumFailed; std::string m_sName; }; typedef boost::shared_ptr TestPtr; #define TEST_FAILED(s) \ cerr << string(m_IndentLevel+6, ' ') << s << endl; \ test(false, __FILE__, __LINE__); #define TEST(b) \ cerr << string(m_IndentLevel+4, ' ') << " TEST(" << #b << ")" << endl; \ test(b, __FILE__, __LINE__); #define QUIET_TEST(b) \ if(!(b)) { \ cerr << string(m_IndentLevel+4, ' ') << " TEST(" << #b << ")" << endl; \ } \ test(b, __FILE__, __LINE__); } #endif libavg-1.8.2/src/base/TestSuite.cpp000066400000000000000000000040601236127404500171300ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "TestSuite.h" #include "Exception.h" using namespace std; namespace avg { TestSuite::TestSuite(const string& sName) : Test(sName, 0) { } TestSuite::~TestSuite() { } void TestSuite::addTest(TestPtr pNewTest) { m_Tests.push_back(pNewTest); } void TestSuite::runTests() { cerr << string(m_IndentLevel, ' ') << "Running suite " << getName() << endl; for (unsigned i = 0; i < m_Tests.size(); ++i) { cerr << string(m_IndentLevel, ' ') << " Running " << m_Tests[i]->getName() << endl; try { m_Tests[i]->runTests(); aggregateStatistics(*m_Tests[i]); m_Tests[i]->printResults(); } catch (Exception& ex) { cerr << string(m_IndentLevel, ' ') << ex.getStr() << endl; setFailed(); } catch (std::exception& ex) { cerr << string(m_IndentLevel, ' ') << " ---->> failed, std::exception: " << ex.what() << endl; setFailed(); } catch (...) { cerr << string(m_IndentLevel, ' ') << " ---->> failed, exception caught" << endl; setFailed(); } } printResults(); } } libavg-1.8.2/src/base/TestSuite.h000066400000000000000000000024151236127404500165770ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _TestSuite_H_ #define _TestSuite_H_ #include "../api.h" #include "Test.h" #include #include #include namespace avg { class AVG_API TestSuite: public Test { public: TestSuite(const std::string& sName); virtual ~TestSuite(); void addTest(TestPtr pNewTest); virtual void runTests(); private: std::vector m_Tests; }; } #endif libavg-1.8.2/src/base/ThreadHelper.cpp000066400000000000000000000054241236127404500175530ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "ThreadHelper.h" #include "OSHelper.h" #ifdef _WIN32 #include #endif namespace avg { void setAffinityMask(bool bIsMainThread) { // The main thread gets the first processor to itself. All other threads share the // rest of the processors available, unless, of course, there is only one processor // in the machine. #ifdef linux static cpu_set_t allProcessors; static bool bInitialized = false; if (!bInitialized) { int rc = sched_getaffinity(0, sizeof(allProcessors), &allProcessors); AVG_ASSERT(rc == 0); // cerr << "All processors: "; // printAffinityMask(allProcessors); bInitialized = true; } cpu_set_t mask; if (bIsMainThread) { CPU_ZERO(&mask); CPU_SET(0, &mask); // cerr << "Main Thread: "; } else { mask = allProcessors; if (CPU_COUNT(&mask) > 1) { CPU_CLR(0, &mask); } // cerr << "Aux Thread: "; } // printAffinityMask(mask); int rc = sched_setaffinity(0, sizeof(mask), &mask); AVG_ASSERT(rc == 0); #elif defined _WIN32 DWORD processAffinityMask; DWORD systemAffinityMask; BOOL rc = GetProcessAffinityMask(GetCurrentProcess(), &processAffinityMask, &systemAffinityMask); AVG_ASSERT(rc == TRUE); DWORD mainThreadMask = 1 << getLowestBitSet(processAffinityMask); DWORD mask; if (bIsMainThread) { mask = mainThreadMask; } else { mask = processAffinityMask & ~mainThreadMask; if (mask == 0) { mask = processAffinityMask; } } DWORD_PTR pPrevMask = SetThreadAffinityMask(GetCurrentThread(), mask); AVG_ASSERT_MSG(pPrevMask != 0, getWinErrMsg(GetLastError()).c_str()); #endif } unsigned getLowestBitSet(unsigned val) { AVG_ASSERT(val != 0); // Doh unsigned pos = 0; while (!(val & 1)) { val >>= 1; ++pos; } return pos; } } libavg-1.8.2/src/base/ThreadHelper.h000066400000000000000000000022551236127404500172170ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _ThreadHelper_H_ #define _ThreadHelper_H_ #include "Exception.h" #include #include namespace avg { void AVG_API setAffinityMask(bool bIsMainThread); typedef boost::lock_guard lock_guard; unsigned getLowestBitSet(unsigned val); } #endif libavg-1.8.2/src/base/ThreadProfiler.cpp000066400000000000000000000114221236127404500201110ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "ThreadProfiler.h" #include "Logger.h" #include "Exception.h" #include "ProfilingZone.h" #include "ScopeTimer.h" #include #include #include using namespace std; using namespace boost; namespace avg { thread_specific_ptr ThreadProfiler::s_pInstance; ThreadProfiler* ThreadProfiler::get() { if (s_pInstance.get() == 0) { s_pInstance.reset(new (ThreadProfiler*)); *s_pInstance = new ThreadProfiler(); } return *s_pInstance; } void ThreadProfiler::kill() { delete *s_pInstance; s_pInstance.reset(); } ThreadProfiler::ThreadProfiler() : m_sName(""), m_LogCategory(Logger::category::PROFILE) { m_bRunning = false; ScopeTimer::enableTimers(Logger::get()->shouldLog(m_LogCategory, Logger::severity::INFO)); } ThreadProfiler::~ThreadProfiler() { } void ThreadProfiler::setLogCategory(category_t category) { AVG_ASSERT(!m_bRunning); m_LogCategory = category; } void ThreadProfiler::start() { m_bRunning = true; } void ThreadProfiler::restart() { ZoneVector::iterator it; for (it = m_Zones.begin(); it != m_Zones.end(); ++it) { (*it)->restart(); } } void ThreadProfiler::startZone(const ProfilingZoneID& zoneID) { ZoneMap::iterator it = m_ZoneMap.find(&zoneID); // Duplicated code to avoid instantiating a new smart pointer when it's not // necessary. if (it == m_ZoneMap.end()) { ProfilingZonePtr pZone = addZone(zoneID); pZone->start(); m_ActiveZones.push_back(pZone); } else { ProfilingZonePtr& pZone = it->second; pZone->start(); m_ActiveZones.push_back(pZone); } } void ThreadProfiler::stopZone(const ProfilingZoneID& zoneID) { ZoneMap::iterator it = m_ZoneMap.find(&zoneID); ProfilingZonePtr& pZone = it->second; pZone->stop(); m_ActiveZones.pop_back(); } void ThreadProfiler::dumpStatistics() { if (!m_Zones.empty()) { AVG_TRACE(m_LogCategory, Logger::severity::INFO, "Thread " << m_sName); AVG_TRACE(m_LogCategory, Logger::severity::INFO, "Zone name Avg. time"); AVG_TRACE(m_LogCategory, Logger::severity::INFO, "--------- ---------"); ZoneVector::iterator it; for (it = m_Zones.begin(); it != m_Zones.end(); ++it) { AVG_TRACE(m_LogCategory, Logger::severity::INFO, std::setw(35) << std::left << ((*it)->getIndentString()+(*it)->getName()) << std::setw(9) << std::right << (*it)->getAvgUSecs()); } AVG_TRACE(m_LogCategory, Logger::severity::INFO, ""); } } void ThreadProfiler::reset() { ZoneVector::iterator it; for (it = m_Zones.begin(); it != m_Zones.end(); ++it) { (*it)->reset(); } } int ThreadProfiler::getNumZones() { return m_Zones.size(); } const std::string& ThreadProfiler::getName() const { return m_sName; } void ThreadProfiler::setName(const std::string& sName) { m_sName = sName; } ProfilingZonePtr ThreadProfiler::addZone(const ProfilingZoneID& zoneID) { ProfilingZonePtr pZone(new ProfilingZone(zoneID)); m_ZoneMap[&zoneID] = pZone; ZoneVector::iterator it; int parentIndent = -2; if (m_ActiveZones.empty()) { it = m_Zones.end(); } else { ProfilingZonePtr pActiveZone = m_ActiveZones.back(); bool bParentFound = false; for (it = m_Zones.begin(); it != m_Zones.end(); ++it) { if (pActiveZone == *it) { bParentFound = true; break; } } AVG_ASSERT(bParentFound); parentIndent = pActiveZone->getIndentLevel(); ++it; for (; it != m_Zones.end() && (*it)->getIndentLevel() > parentIndent; ++it) {}; } m_Zones.insert(it, pZone); pZone->setIndentLevel(parentIndent+2); return pZone; } } libavg-1.8.2/src/base/ThreadProfiler.h000066400000000000000000000047251236127404500175660ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _ThreadProfiler_H_ #define _ThreadProfiler_H_ #include "../api.h" #include "ILogSink.h" #include #include #include #include #include #if defined(_WIN32) || defined(_LIBCPP_VERSION) #include #else #include #endif namespace avg { class ThreadProfiler; typedef boost::shared_ptr ThreadProfilerPtr; class ProfilingZone; typedef boost::shared_ptr ProfilingZonePtr; class ProfilingZoneID; class AVG_API ThreadProfiler { public: static ThreadProfiler* get(); static void kill(); ThreadProfiler(); virtual ~ThreadProfiler(); void setLogCategory(category_t category); void start(); void restart(); void startZone(const ProfilingZoneID& zoneID); void stopZone(const ProfilingZoneID& zoneID); void dumpStatistics(); void reset(); int getNumZones(); const std::string& getName() const; void setName(const std::string& sName); private: ProfilingZonePtr addZone(const ProfilingZoneID& zoneID); std::string m_sName; #if defined(_WIN32) || defined(_LIBCPP_VERSION) typedef std::unordered_map ZoneMap; #else typedef std::tr1::unordered_map ZoneMap; #endif typedef std::vector ZoneVector; ZoneMap m_ZoneMap; ZoneVector m_ActiveZones; ZoneVector m_Zones; bool m_bRunning; category_t m_LogCategory; static boost::thread_specific_ptr s_pInstance; }; } #endif libavg-1.8.2/src/base/TimeSource.cpp000066400000000000000000000055001236127404500172560ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "TimeSource.h" #include "Logger.h" #include "Exception.h" #ifdef _WIN32 #include #include #include #include #else #include #endif #include #include #include #include #include #include #include using namespace std; namespace avg { TimeSource* TimeSource::m_pTimeSource = 0; TimeSource * TimeSource::get() { if (!m_pTimeSource) { #ifdef _WIN32 TIMECAPS tc; UINT wTimerRes; MMRESULT err = timeGetDevCaps(&tc, sizeof(TIMECAPS)); AVG_ASSERT(err == TIMERR_NOERROR); wTimerRes = max(tc.wPeriodMin, 1); timeBeginPeriod(wTimerRes); #endif m_pTimeSource = new TimeSource; } return m_pTimeSource; } TimeSource::TimeSource() { #ifdef __APPLE__ mach_timebase_info(&m_TimebaseInfo); #endif } TimeSource::~TimeSource() { } long long TimeSource::getCurrentMillisecs() { return getCurrentMicrosecs()/1000; } long long TimeSource::getCurrentMicrosecs() { #ifdef _WIN32 return (long long)(timeGetTime())*1000; #else #ifdef __APPLE__ long long systemTime = mach_absolute_time(); return (systemTime * m_TimebaseInfo.numer/m_TimebaseInfo.denom)/1000; #else struct timespec now; int rc = clock_gettime(CLOCK_MONOTONIC, &now); assert(rc == 0); return ((long long)now.tv_sec)*1000000+now.tv_nsec/1000; #endif #endif } void TimeSource::sleepUntil(long long targetTime) { long long now = getCurrentMillisecs(); #ifdef __APPLE__ if (targetTime > now) { msleep(targetTime-now); } #else while (now #endif namespace avg { // This class is a monotonic time source with an undefined start time. Time is guarranteed // to increase monotonically. The time source has no jumps and does not go backwards, // even if system time is changed. class AVG_API TimeSource { public: static TimeSource* get(); virtual ~TimeSource(); long long getCurrentMillisecs(); long long getCurrentMicrosecs(); void sleepUntil(long long targetTime); private: TimeSource(); #ifdef __APPLE__ mach_timebase_info_data_t m_TimebaseInfo; #endif static TimeSource* m_pTimeSource; }; void AVG_API msleep(int millisecs); } #endif libavg-1.8.2/src/base/Triangle.cpp000066400000000000000000000051221236127404500167440ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "Triangle.h" #include "GLMHelper.h" #include namespace avg { Triangle::Triangle(const glm::vec2& P0, const glm::vec2& P1, const glm::vec2& P2) : p0(P0), p1(P1), p2(P2) { } Triangle::Triangle() { } bool Triangle::operator ==(const Triangle & tri) const { return (p0 == tri.p0 && p1 == tri.p1 && p2 == tri.p2); } bool Triangle::isInside(const glm::vec2& pt) const { /* Slower func that only works for cw triangles. glm::vec2 a = p2-p1; glm::vec2 bp = pt-p1; float aCROSSbp = a.x*bp.y - a.y*bp.x; if (aCROSSbp < 0.0) { return false; } glm::vec2 b = p0-p2; glm::vec2 cp = pt-p2; float bCROSScp = b.x*cp.y - b.y*cp.x; if (bCROSScp < 0.0) { return false; } glm::vec2 c = p1-p0; glm::vec2 ap = pt-p0; float cCROSSap = c.x*ap.y - c.y*ap.x; return cCROSSap >= 0.0; */ glm::vec2 v0 = p2 - p0; glm::vec2 v1 = p1 - p0; glm::vec2 v2 = pt - p0; float dot00 = glm::dot(v0, v0); float dot01 = glm::dot(v0, v1); float dot02 = glm::dot(v0, v2); float dot11 = glm::dot(v1, v1); float dot12 = glm::dot(v1, v2); float invDenom = 1 / (dot00 * dot11 - dot01 * dot01); float u = (dot11 * dot02 - dot01 * dot12) * invDenom; float v = (dot00 * dot12 - dot01 * dot02) * invDenom; return (u > 0) && (v > 0) && (u + v < 1); } float Triangle::getArea() const { return fabs((((p1.x-p0.x)*(p2.y-p0.y)) - ((p1.y-p0.y)*(p2.x-p0.x)))/2); } bool Triangle::isClockwise() const { return ((p1.x-p0.x)*(p2.y-p0.y)) - ((p1.y-p0.y)*(p2.x-p0.x)) < 0; } std::ostream& operator<<(std::ostream& os, const Triangle& tri) { os << "(" << tri.p0 << "," << tri.p1 << "," << tri.p2 << ")"; return os; } } libavg-1.8.2/src/base/Triangle.h000066400000000000000000000026421236127404500164150ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _Triangle_H_ #define _Triangle_H_ #include "../api.h" #include "../glm/glm.hpp" #include namespace avg { struct AVG_API Triangle { public: glm::vec2 p0; glm::vec2 p1; glm::vec2 p2; Triangle(const glm::vec2& P0, const glm::vec2& P1, const glm::vec2& P2); Triangle(); bool operator ==(const Triangle & tri) const; bool isInside(const glm::vec2& pt) const; float getArea() const; bool isClockwise() const; }; std::ostream& operator<<(std::ostream& os, const Triangle& tri); } #endif libavg-1.8.2/src/base/UTF8String.cpp000066400000000000000000000027071236127404500171220ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "UTF8String.h" #include using namespace std; namespace avg { UTF8String::UTF8String() { } UTF8String::UTF8String(const string& s) : string(s) { } UTF8String::UTF8String(const char * psz) : string(psz) { } UTF8String& UTF8String::operator =(const string& s) { *dynamic_cast(this) = s; return *this; } UTF8String& UTF8String::operator =(const char* psz) { *dynamic_cast(this) = psz; return *this; } std::size_t hash_value(const avg::UTF8String& x) { boost::hash hasher; return hasher(x); }; } libavg-1.8.2/src/base/UTF8String.h000066400000000000000000000025031236127404500165610ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _UTF8String_H_ #define _UTF8String_H_ #include "../api.h" #include #include namespace avg { class AVG_TEMPLATE_API UTF8String: public std::string { public: UTF8String(); UTF8String(const std::string& s); UTF8String(const char * psz); UTF8String& operator =(const std::string& s); UTF8String& operator =(const char * psz); }; std::size_t hash_value(const avg::UTF8String& x); } #endif libavg-1.8.2/src/base/WideLine.cpp000066400000000000000000000026661236127404500167110ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "WideLine.h" #include "GLMHelper.h" namespace avg { WideLine::WideLine(const glm::vec2& p0, const glm::vec2& p1, float width) : pt0(p0), pt1(p1) { glm::vec2 m = glm::normalize(pt1-pt0); glm::vec2 w = glm::vec2(m.y, -m.x)*(width/2); pl0 = p0-w; pr0 = p0+w; pl1 = p1-w; pr1 = p1+w; dir = glm::vec2(w.y, -w.x); } float WideLine::getLen() const { return glm::length(pt1-pt0); } std::ostream& operator<<(std::ostream& os, const WideLine& line) { os << "(" << line.pt0 << "," << line.pt1 << ")"; return os; } } libavg-1.8.2/src/base/WideLine.h000066400000000000000000000024751236127404500163540ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _WideLine_H_ #define _WideLine_H_ #include "../api.h" #include "../glm/glm.hpp" #include namespace avg { struct AVG_API WideLine { WideLine(const glm::vec2& p0, const glm::vec2& p1, float width); float getLen() const; glm::vec2 pt0, pt1; glm::vec2 pl0, pl1; glm::vec2 pr0, pr1; glm::vec2 dir; }; std::ostream& operator<<(std::ostream& os, const WideLine& line); } #endif libavg-1.8.2/src/base/WorkerThread.cpp000066400000000000000000000021701236127404500176000ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "WorkerThread.h" #include "OSHelper.h" namespace avg { using namespace std; #ifdef linux void printAffinityMask(cpu_set_t& mask) { for (int i=0; i<32; ++i) { cerr << int(CPU_ISSET(i, &mask)); } cerr << endl; } #endif } libavg-1.8.2/src/base/WorkerThread.h000066400000000000000000000102341236127404500172450ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _WorkerThread_H_ #define _WorkerThread_H_ #include "../api.h" #include "Command.h" #include "Exception.h" #include "Logger.h" #include "Queue.h" #include "ThreadHelper.h" #include "ThreadProfiler.h" #include "CmdQueue.h" #include #include namespace avg { template class AVG_TEMPLATE_API WorkerThread { public: typedef Command Cmd; typedef typename boost::shared_ptr CmdPtr; typedef CmdQueue CQueue; typedef typename boost::shared_ptr CQueuePtr; WorkerThread(const std::string& sName, CQueue& CmdQ, category_t logCategory=Logger::category::PROFILE); WorkerThread(WorkerThread const& other); virtual ~WorkerThread(); void operator()(); void waitForCommand(); void stop(); protected: int getNumCmdsInQueue() const; private: virtual bool init(); virtual bool work() = 0; virtual void deinit() {}; void processCommands(); std::string m_sName; bool m_bShouldStop; CQueue& m_CmdQ; category_t m_LogCategory; }; template WorkerThread::WorkerThread(const std::string& sName, CQueue& CmdQ, category_t logCategory) : m_sName(sName), m_bShouldStop(false), m_CmdQ(CmdQ), m_LogCategory(logCategory) { } template WorkerThread::WorkerThread(WorkerThread const& other) : m_CmdQ(other.m_CmdQ) { m_sName = other.m_sName; m_bShouldStop = other.m_bShouldStop; m_LogCategory = other.m_LogCategory; } template WorkerThread::~WorkerThread() { } template void WorkerThread::operator()() { try { setAffinityMask(false); ThreadProfiler* pProfiler = ThreadProfiler::get(); pProfiler->setName(m_sName); pProfiler->setLogCategory(m_LogCategory); bool bOK; bOK = init(); if (!bOK) { return; } pProfiler->start(); while (!m_bShouldStop) { bOK = work(); if (!bOK) { m_bShouldStop = true; } if (!m_bShouldStop) { processCommands(); } } deinit(); pProfiler->dumpStatistics(); pProfiler->kill(); } catch (const Exception& e) { AVG_LOG_ERROR("Uncaught exception in thread " << m_sName << ": " << e.getStr()); throw; } } template void WorkerThread::waitForCommand() { CmdPtr pCmd = m_CmdQ.pop(true); pCmd->execute(dynamic_cast(this)); } template void WorkerThread::stop() { m_bShouldStop = true; } template int WorkerThread::getNumCmdsInQueue() const { return m_CmdQ.size(); } template bool WorkerThread::init() { return true; } template void WorkerThread::processCommands() { CmdPtr pCmd = m_CmdQ.pop(false); while (pCmd && !m_bShouldStop) { pCmd->execute(dynamic_cast(this)); if (!m_bShouldStop) { pCmd = m_CmdQ.pop(false); } } } } #endif libavg-1.8.2/src/base/XMLHelper.cpp000066400000000000000000000134731236127404500170070ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "XMLHelper.h" #include "Exception.h" #include "Logger.h" #include #include #include using namespace std; namespace avg { string getXmlChildrenAsString(const xmlDocPtr xmlDoc, const xmlNodePtr& xmlNode) { string s; xmlBufferPtr pBuffer = xmlBufferCreate(); xmlNodeDump(pBuffer, xmlDoc, xmlNode, 0, 0); s = (const char *)xmlBufferContent(pBuffer); size_t StartPos = s.find('>')+1; size_t EndPos = s.rfind('<')-1; if (StartPos > EndPos) { s = ""; } else { s = s.substr(StartPos, EndPos-StartPos+1); } xmlBufferFree(pBuffer); return s; } static xmlExternalEntityLoader DefaultLoaderProc = 0; static std::map g_DTDMap; xmlParserInputPtr DTDExternalEntityLoader(const char *pURL, const char *pID, xmlParserCtxtPtr ctxt) { xmlParserInputPtr ret; /* lookup for the fileID depending on ID */ std::map::iterator it = g_DTDMap.find(pURL); if (it != g_DTDMap.end()) { ret = xmlNewStringInputStream(ctxt, (const xmlChar *)(it->second.c_str())); return(ret); } else { ret = DefaultLoaderProc(pURL, pID, ctxt); return(ret); } } void registerDTDEntityLoader(const string& sID, const string& sDTD) { g_DTDMap[sID] = sDTD; if (!DefaultLoaderProc) { DefaultLoaderProc = xmlGetExternalEntityLoader(); } xmlSetExternalEntityLoader(DTDExternalEntityLoader); } XMLParser::XMLParser() : m_SchemaParserCtxt(0), m_Schema(0), m_SchemaValidCtxt(0), m_DTD(0), m_DTDValidCtxt(0), m_Doc(0) { xmlPedanticParserDefault(1); xmlSetGenericErrorFunc(this, errorOutputFunc); xmlDoValidityCheckingDefaultValue = 0; } XMLParser::~XMLParser() { if (m_Schema) { xmlSchemaFree(m_Schema); } if (m_SchemaParserCtxt) { xmlSchemaFreeParserCtxt(m_SchemaParserCtxt); } if (m_SchemaValidCtxt) { xmlSchemaFreeValidCtxt(m_SchemaValidCtxt); } if (m_DTD) { xmlFreeDtd(m_DTD); } if (m_DTDValidCtxt) { xmlFreeValidCtxt(m_DTDValidCtxt); } if (m_Doc) { xmlFreeDoc(m_Doc); } xmlSetGenericErrorFunc(0, 0); } void XMLParser::setSchema(const string& sSchema, const string& sSchemaName) { AVG_ASSERT(!m_SchemaParserCtxt); AVG_ASSERT(!m_Schema); AVG_ASSERT(!m_SchemaValidCtxt); AVG_ASSERT(!m_DTD); AVG_ASSERT(!m_DTDValidCtxt); m_SchemaParserCtxt = xmlSchemaNewMemParserCtxt(sSchema.c_str(), sSchema.length()); checkError(!m_SchemaParserCtxt, sSchemaName); m_Schema = xmlSchemaParse(m_SchemaParserCtxt); checkError(!m_Schema, sSchemaName); m_SchemaValidCtxt = xmlSchemaNewValidCtxt(m_Schema); checkError(!m_SchemaValidCtxt, sSchemaName); } void XMLParser::setDTD(const std::string& sDTD, const std::string& sDTDName) { AVG_ASSERT(!m_SchemaParserCtxt); AVG_ASSERT(!m_Schema); AVG_ASSERT(!m_SchemaValidCtxt); AVG_ASSERT(!m_DTD); AVG_ASSERT(!m_DTDValidCtxt); registerDTDEntityLoader("memory.dtd", sDTD.c_str()); string sDTDFName = "memory.dtd"; m_DTD = xmlParseDTD(NULL, (const xmlChar*) sDTDFName.c_str()); checkError(!m_DTD, sDTDName); m_DTDValidCtxt = xmlNewValidCtxt(); checkError(!m_DTDValidCtxt, sDTDName); m_DTDValidCtxt->error = xmlParserValidityError; m_DTDValidCtxt->warning = xmlParserValidityWarning; } void XMLParser::parse(const string& sXML, const string& sXMLName) { if (m_Doc) { xmlFreeDoc(m_Doc); } m_Doc = xmlParseMemory(sXML.c_str(), int(sXML.length())); checkError(!m_Doc, sXMLName); bool bOK = true; if (m_SchemaValidCtxt) { int err = xmlSchemaValidateDoc(m_SchemaValidCtxt, m_Doc); AVG_ASSERT(err != -1); bOK = (err == 0); } if (m_DTD) { int err = xmlValidateDtd(m_DTDValidCtxt, m_Doc, m_DTD); bOK = (err != 0); } if (!bOK) { xmlFreeDoc(m_Doc); m_Doc = 0; checkError(true, sXMLName); } } xmlDocPtr XMLParser::getDoc() { AVG_ASSERT(m_Doc); return m_Doc; } xmlNodePtr XMLParser::getRootNode() { AVG_ASSERT(m_Doc); return xmlDocGetRootElement(m_Doc); } void XMLParser::errorOutputFunc(void * ctx, const char * msg, ...) { va_list args; va_start(args, msg); ((XMLParser*)ctx)->internalErrorHandler(msg, args); va_end(args); } void XMLParser::internalErrorHandler(const char * msg, va_list args) { char psz[1024]; vsnprintf(psz, 1024, msg, args); m_sError += psz; } void XMLParser::checkError(bool bError, const string& sXMLName) { if (bError) { string sError = "Error parsing "+sXMLName+".\n"; sError += m_sError; m_sError = ""; throw (Exception(AVG_ERR_XML_PARSE, sError)); } } void validateXml(const string& sXML, const string& sSchema, const string& sXMLName, const string& sSchemaName) { XMLParser parser; parser.setSchema(sSchema, sSchemaName); parser.parse(sXML, sXMLName); } } libavg-1.8.2/src/base/XMLHelper.h000066400000000000000000000042561236127404500164530ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef _XMLHelper_H_ #define _XMLHelper_H_ #include "../api.h" #include #include #include #include #include #include namespace avg { std::string getXmlChildrenAsString(const xmlDocPtr xmlDoc, const xmlNodePtr& xmlNode); void registerDTDEntityLoader(const std::string& sID, const std::string& sDTD); class XMLParser { public: XMLParser(); virtual ~XMLParser(); void setSchema(const std::string& sSchema, const std::string& sSchemaName); void setDTD(const std::string& sDTD, const std::string& sDTDName); void parse(const std::string& sXML, const std::string& sXMLName); xmlDocPtr getDoc(); xmlNodePtr getRootNode(); private: static void errorOutputFunc(void * ctx, const char * msg, ...); void internalErrorHandler(const char * msg, va_list args); void checkError(bool bError, const std::string& sXMLName); xmlSchemaParserCtxtPtr m_SchemaParserCtxt; xmlSchemaPtr m_Schema; xmlSchemaValidCtxtPtr m_SchemaValidCtxt; xmlDtdPtr m_DTD; xmlValidCtxtPtr m_DTDValidCtxt; xmlDocPtr m_Doc; std::string m_sError; }; void validateXml(const std::string& sXML, const std::string& sSchema, const std::string& sXMLName, const std::string& sSchemaName); } #endif libavg-1.8.2/src/base/testbase.cpp000066400000000000000000000635421236127404500170230ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #include "DAG.h" #include "Queue.h" #include "Command.h" #include "WorkerThread.h" #include "ObjectCounter.h" #include "triangulate/Triangulate.h" #include "GLMHelper.h" #include "GeomHelper.h" #include "OSHelper.h" #include "FileHelper.h" #include "StringHelper.h" #include "MathHelper.h" #include "CubicSpline.h" #include "BezierCurve.h" #include "Signal.h" #include "Backtrace.h" #include "WideLine.h" #include "Rect.h" #include "Triangle.h" #include "TestSuite.h" #include "TimeSource.h" #include "XMLHelper.h" #include "Logger.h" #include #include #include #include #include #include using namespace avg; using namespace std; using namespace boost; class DAGTest: public Test { public: DAGTest() : Test("DAGTest", 2) { } void runTests() { { DAG dag; dag.addNode(1, set()); long outgoing2[] = {1}; dag.addNode(0, makeOutgoing(1, outgoing2)); long expected[] = {0, 1}; checkResults(&dag, expected); } { DAG dag; dag.addNode(2, set()); long outgoing2[] = {1}; dag.addNode(0, makeOutgoing(1, outgoing2)); long outgoing3[] = {2}; dag.addNode(1, makeOutgoing(1, outgoing3)); long expected[] = {0, 1, 2}; checkResults(&dag, expected); } { DAG dag; long outgoing2[] = {1}; dag.addNode(0, makeOutgoing(1, outgoing2)); dag.addNode(2, set()); long outgoing3[] = {2}; dag.addNode(1, makeOutgoing(1, outgoing3)); long expected[] = {0, 1, 2}; checkResults(&dag, expected); } { DAG dag; dag.addNode(2, set()); long outgoing2[] = {1, 2}; dag.addNode(0, makeOutgoing(1, outgoing2)); long outgoing3[] = {2}; dag.addNode(1, makeOutgoing(1, outgoing3)); long expected[] = {0, 1, 2}; checkResults(&dag, expected); } { DAG dag; long outgoing2[] = {1}; dag.addNode(0, makeOutgoing(1, outgoing2)); long outgoing3[] = {0}; dag.addNode(1, makeOutgoing(1, outgoing3)); bool bExceptionThrown = false; long expected[] = {0, 1, 2}; try { checkResults(&dag, expected); } catch (const Exception&) { bExceptionThrown = true; } TEST(bExceptionThrown); } } private: set makeOutgoing(int n, long ids[]) { set v; for (int i=0; i results; pDAG->sort(results); for (unsigned i=0; i::QElementPtr ElemPtr; void runSingleThreadTests() { Queue q; typedef Queue::QElementPtr ElemPtr; TEST(q.empty()); q.push(ElemPtr(new string("1"))); TEST(q.size() == 1); TEST(!q.empty()); q.push(ElemPtr(new string("2"))); q.push(ElemPtr(new string("3"))); TEST(q.size() == 3); TEST(*q.pop() == "1"); TEST(*q.pop() == "2"); q.push(ElemPtr(new string("4"))); TEST(*q.pop() == "3"); TEST(*q.peek() == "4"); TEST(*q.pop() == "4"); TEST(q.empty()); ElemPtr pElem = q.pop(false); TEST(!pElem); } void runMultiThreadTests() { { Queue q(10); thread pusher(boost::bind(&pushThread, &q, 100)); thread popper(boost::bind(&popThread, &q, 100)); pusher.join(); popper.join(); TEST(q.empty()); } { Queue q(10); thread pusher1(boost::bind(&pushThread, &q, 100)); thread pusher2(boost::bind(&pushThread, &q, 100)); thread popper(boost::bind(&popThread, &q, 200)); pusher1.join(); pusher2.join(); popper.join(); TEST(q.empty()); } { Queue q(10); thread pusher(boost::bind(&pushClearThread, &q, 100)); thread popper(boost::bind(&popClearThread, &q)); pusher.join(); popper.join(); TEST(q.empty()); } } static void pushThread(Queue* pq, int numPushes) { for (int i=0; ipush(ElemPtr(new int(i))); msleep(1); } } static void popThread(Queue* pq, int numPops) { for (int i=0; ipeek(); pq->pop(); msleep(3); } } static void pushClearThread(Queue* pq, int numPushes) { typedef Queue::QElementPtr ElemPtr; for (int i=0; ipush(ElemPtr(new int(i))); if (i%7 == 0) { pq->clear(); } msleep(1); } pq->push(ElemPtr(new int(-1))); } static void popClearThread(Queue* pq) { ElemPtr pElem; do { pElem = pq->pop(); } while (*pElem != -1); } }; class TestWorkerThread: public WorkerThread { public: TestWorkerThread(CQueue& cmdQ, int* pNumFuncCalls, int* pIntParam, string* pStringParam) : WorkerThread("Thread1", cmdQ), m_pNumFuncCalls(pNumFuncCalls), m_pIntParam(pIntParam), m_pStringParam(pStringParam) { } bool init() { (*m_pNumFuncCalls)++; return true; } bool work() { (*m_pNumFuncCalls)++; waitForCommand(); return true; } void deinit() { (*m_pNumFuncCalls)++; } void doSomething(int i, std::string s) { *m_pIntParam = i; *m_pStringParam = s; } private: int * m_pNumFuncCalls; int * m_pIntParam; std::string * m_pStringParam; }; class WorkerThreadTest: public Test { public: WorkerThreadTest() : Test("WorkerThreadTest", 2) { } void runTests() { typedef TestWorkerThread::CmdPtr CmdPtr; TestWorkerThread::CQueue cmdQ; boost::thread* pTestThread; int numFuncCalls = 0; int intParam = 0; std::string stringParam; cmdQ.pushCmd(boost::bind(&TestWorkerThread::doSomething, _1, 23, "foo")); cmdQ.pushCmd(boost::bind(&TestWorkerThread::stop, _1)); pTestThread = new boost::thread(TestWorkerThread(cmdQ, &numFuncCalls, &intParam, &stringParam)); pTestThread->join(); delete pTestThread; TEST(numFuncCalls == 3); TEST(intParam == 23); TEST(stringParam == "foo"); } }; class DummyClass { public: DummyClass() { ObjectCounter::get()->incRef(&typeid(*this)); } virtual ~DummyClass() { ObjectCounter::get()->decRef(&typeid(*this)); } int i; }; class ObjectCounterTest: public Test { public: ObjectCounterTest() : Test("ObjectCounterTest", 2) { } void runTests() { TEST(ObjectCounter::get()->getCount(&typeid(DummyClass)) == 0); { DummyClass dummy1; DummyClass dummy2; TEST(ObjectCounter::get()->getCount(&typeid(dummy1)) == 2); } TEST(ObjectCounter::get()->getCount(&typeid(DummyClass)) == 0); } }; // The following pragmas avoid a compiler warning (potential division by 0) #ifdef _MSC_VER #pragma optimize("", off) #pragma warning(push) #pragma warning(disable:4723) #endif class GeomTest: public Test { public: GeomTest() : Test("GeomTest", 2) { } void runTests() { // TODO: Move to a separate math test once we're done here. TEST(almostEqual(invSqrt(1), 1)); TEST(almostEqual(invSqrt(4), 0.5)); { LineSegment l1(glm::vec2(0,0), glm::vec2(2,2)); LineSegment l2(glm::vec2(2,0), glm::vec2(0,2)); TEST(lineSegmentsIntersect(l1, l2)); TEST(lineSegmentsIntersect(l2, l1)); } { LineSegment l1(glm::vec2(0,0), glm::vec2(0,2)); LineSegment l2(glm::vec2(2,0), glm::vec2(2,2)); TEST(!lineSegmentsIntersect(l1, l2)); } { LineSegment l1(glm::vec2(0,0), glm::vec2(2,0)); LineSegment l2(glm::vec2(0,2), glm::vec2(2,2)); TEST(!lineSegmentsIntersect(l1, l2)); } { LineSegment l1(glm::vec2(0,0), glm::vec2(2,0)); TEST(l1.isPointOver(glm::vec2(1,23))); TEST(l1.isPointOver(glm::vec2(1.9,-5))); TEST(!l1.isPointOver(glm::vec2(-1,1))); TEST(!l1.isPointOver(glm::vec2(3,-1))); } { glm::vec2 pt0(glm::vec2(1,1)); glm::vec2 pt1(glm::vec2(1,3)); glm::vec2 pt2(glm::vec2(1,-2)); vector poly; poly.push_back(glm::vec2(0,0)); poly.push_back(glm::vec2(2,0)); poly.push_back(glm::vec2(2,2)); poly.push_back(glm::vec2(0,2)); TEST(pointInPolygon(pt0, poly)); TEST(!pointInPolygon(pt1, poly)); TEST(!pointInPolygon(pt2, poly)); poly.push_back(glm::vec2(2,1)); TEST(!pointInPolygon(pt0, poly)); } { glm::vec2 p1(glm::vec2(0,0)); glm::vec2 v1(glm::vec2(1,1)); glm::vec2 p2(glm::vec2(2,1)); glm::vec2 v2(glm::vec2(1,0)); TEST(getLineLineIntersection(p1, v1, p2, v2) == glm::vec2(1,1)); } TEST(almostEqual(getRotatedPivot(glm::vec2(10,0), M_PI, glm::vec2(15,5)), glm::vec2(20,10))); TEST(almostEqual(getRotatedPivot(glm::vec2(10,0), M_PI*0.5, glm::vec2(15,5)), glm::vec2(20,0))); TEST(almostEqual(getRotatedPivot(glm::vec2(10,0), M_PI*1.5, glm::vec2(15,5)), glm::vec2(10,10))); TEST(almostEqual(getRotatedPivot(glm::vec2(10,0), M_PI*2, glm::vec2(15,5)), glm::vec2(10,0))); TEST(almostEqual(getRotatedPivot(glm::vec2(23,0), M_PI*0.5), glm::vec2(0,23))); { // TODO: More tests FRect(0,0,10,10); } } }; #ifdef _MSC_VER #pragma warning(pop) #pragma optimize("", on) #endif class TriangleTest: public Test { public: TriangleTest() : Test("TriangleTest", 2) { } void runTests() { Triangle tri(glm::vec2(0,0), glm::vec2(4,4), glm::vec2(4,8)); TEST(tri.isInside(glm::vec2(3,4))); TEST(!tri.isInside(glm::vec2(1,4))); TEST(!tri.isInside(glm::vec2(2,1))); TEST(!tri.isInside(glm::vec2(-2,5))); TEST(!tri.isInside(glm::vec2(5,5))); tri = Triangle(glm::vec2(0,0), glm::vec2(4,8), glm::vec2(4,4)); TEST(tri.isInside(glm::vec2(3,4))); glm::vec2 polyArray[] = {glm::vec2(0,0), glm::vec2(8,2), glm::vec2(9,0), glm::vec2(9,3), glm::vec2(1,1), glm::vec2(0,3)}; Vec2Vector poly = vectorFromCArray(6, polyArray); vector triangulation; triangulatePolygon(triangulation, poly); TEST(triangulation.size() == 4*3); unsigned int baselineIndexes[] = {5,0,4, 1,4,0, 4,1,3, 1,2,3}; TEST(triangulation == vectorFromCArray(12, baselineIndexes)); /* for (unsigned int i=0; i v; fromString("(1,2,3,4,5)", v); TEST(v.size() == 5 && v[0] == 1 && v[4] == 5); v.clear(); fromString("()", v); TEST(v.size() == 0); } }; class SplineTest: public Test { public: SplineTest() : Test("SplineTest", 2) { } void runTests() { { float xd[] = {0,1,2,3}; vector x = vectorFromCArray(4, xd); float yd[] = {3,2,1,0}; vector y = vectorFromCArray(4, yd); CubicSpline spline(x, y); TEST(almostEqual(spline.interpolate(-1), 4)); TEST(almostEqual(spline.interpolate(0), 3)); TEST(almostEqual(spline.interpolate(0.5), 2.5)); TEST(almostEqual(spline.interpolate(3), 0)); TEST(almostEqual(spline.interpolate(3.5), -0.5)); } { float xd[] = {2,4,6,8}; vector x = vectorFromCArray(4, xd); float yd[] = {0,1,3,6}; vector y = vectorFromCArray(4, yd); CubicSpline spline(x, y); TEST(almostEqual(spline.interpolate(0), -1)); TEST(almostEqual(spline.interpolate(2), 0)); TEST(spline.interpolate(3) < 0.5); TEST(spline.interpolate(3) > 0); TEST(spline.interpolate(7) > 4); TEST(spline.interpolate(7) < 5); TEST(almostEqual(spline.interpolate(8), 6)); TEST(almostEqual(spline.interpolate(10), 9)); } { float xd[] = {0,1,1}; vector x = vectorFromCArray(3, xd); float yd[] = {1,2,1}; vector y = vectorFromCArray(3, yd); bool bExceptionThrown = false; try { CubicSpline spline(x, y); } catch (const Exception&) { bExceptionThrown = true; } TEST(bExceptionThrown); } /* { float xd[] = {0,1,2}; vector x = vectorFromCArray(3, xd); float yd[] = {1,2,1}; vector y = vectorFromCArray(3, yd); CubicSpline spline(x, y, true); TEST(almostEqual(spline.interpolate(0), 1)); TEST(almostEqual(spline.interpolate(0.5), 1.5)); TEST(almostEqual(spline.interpolate(2), 1)); TEST(almostEqual(spline.interpolate(3), 2)); } */ } }; class BezierCurveTest: public Test { public: BezierCurveTest() : Test("BezierCurveTest", 2) { } void runTests() { BezierCurve curve(glm::vec2(0,0), glm::vec2(1,0), glm::vec2(1,1), glm::vec2(0,1)); TEST(almostEqual(curve.interpolate(0), glm::vec2(0,0))); TEST(almostEqual(curve.getDeriv(0), glm::vec2(3, 0))); TEST(almostEqual(curve.interpolate(1), glm::vec2(0,1))); TEST(almostEqual(curve.getDeriv(1), glm::vec2(-3, 0))); TEST(almostEqual(curve.interpolate(0.5), glm::vec2(0.75,0.5))); } }; class WideLineTest: public Test { public: WideLineTest() : Test("WideLineTest", 2) { } void runTests() { WideLine line(glm::vec2(0,0), glm::vec2(4,3), 2); TEST(almostEqual(line.getLen(), 5)); } }; class Listener { public: Listener(Signal& signal) : m_Signal(signal), m_bFuncCalled(false) { } virtual ~Listener() {} virtual void func() { m_bFuncCalled = true; } bool funcCalled() const { return m_bFuncCalled; } void reset() { m_bFuncCalled = false; } protected: Signal& m_Signal; private: bool m_bFuncCalled; }; class DisconnectingSelfListener: public Listener { public: DisconnectingSelfListener(Signal& signal) : Listener(signal) { } virtual void func() { Listener::func(); m_Signal.disconnect(this); } }; class DisconnectingOtherListener: public Listener { public: DisconnectingOtherListener(Signal& signal, Listener* pOther) : Listener(signal), m_pOther(pOther) { } virtual void func() { Listener::func(); if (m_pOther) { m_Signal.disconnect(m_pOther); m_pOther = 0; } } private: Listener* m_pOther; }; class ConnectingOtherListener: public Listener { public: ConnectingOtherListener(Signal& signal, Listener* pOther) : Listener(signal), m_pOther(pOther) { } virtual void func() { Listener::func(); if (m_pOther) { m_Signal.connect(m_pOther); m_pOther = 0; } } private: Listener* m_pOther; }; class SignalTest: public Test { public: SignalTest() : Test("SignalTest", 2) { } void runTests() { Signal s(&Listener::func); Listener l1(s); Listener l2(s); s.connect(&l1); s.connect(&l2); s.emit(); TEST(l1.funcCalled() && l2.funcCalled()); l1.reset(); l2.reset(); s.disconnect(&l1); s.emit(); TEST(!(l1.funcCalled()) && l2.funcCalled()); l2.reset(); { DisconnectingSelfListener disconnecter(s); s.connect(&disconnecter); s.emit(); TEST(l2.funcCalled() && disconnecter.funcCalled()); TEST(s.getNumListeners() == 1); l2.reset(); disconnecter.reset(); s.emit(); TEST(l2.funcCalled() && !(disconnecter.funcCalled())); l2.reset(); } { DisconnectingOtherListener disconnecter(s, &l2); s.connect(&disconnecter); s.emit(); TEST(l2.funcCalled() && disconnecter.funcCalled()); TEST(s.getNumListeners() == 1); l2.reset(); disconnecter.reset(); s.emit(); TEST(!(l2.funcCalled()) && disconnecter.funcCalled()); s.disconnect(&disconnecter); } { ConnectingOtherListener connecter(s, &l2); s.connect(&connecter); s.emit(); TEST(l2.funcCalled() && connecter.funcCalled()); TEST(s.getNumListeners() == 2); l2.reset(); connecter.reset(); s.emit(); TEST(l2.funcCalled() && connecter.funcCalled()); } } }; class BacktraceTest: public Test { public: BacktraceTest() : Test("BacktraceTest", 2) { } void runTests() { vector sFuncs; getBacktrace(sFuncs); #ifndef _WIN32 TEST(sFuncs[0].find("runTests") != string::npos); #endif } }; class PolygonTest: public Test { public: PolygonTest() : Test("PolygonTest", 2) { } void runTests() { glm::vec2 polyArray[] = {glm::vec2(30,0), glm::vec2(40,20), glm::vec2(60,30), glm::vec2(40,40), glm::vec2(30,60), glm::vec2(20,40), glm::vec2(0,30), glm::vec2(20,20)}; Vec2Vector poly = vectorFromCArray(8, polyArray); vector triangulation; triangulatePolygon(triangulation, poly); TEST(triangulation.size() == 6*3); unsigned int baselineIndexes[] = {6,7,5, 5,7,1, 7,0,1, 5,1,3, 3,1,2, 4,5,3}; TEST(triangulation == vectorFromCArray(18, baselineIndexes)); /* for (unsigned int i=0; i" "" " John Smith" ""; { string sSchema = "" "" "" " " " " " " " " " " " " "" ""; XMLParser parser; parser.setSchema(sSchema, "shiporder.xsd"); parser.parse(sXmlString, "shiporder.xml"); } { string sDTD = "" "" ""; XMLParser parser; parser.setDTD(sDTD, "shiporder.dtd"); parser.parse(sXmlString, "shiporder.xml"); } } }; class StandardLoggerTest: public Test { public: StandardLoggerTest() : Test("StandardLoggerTest", 2) { } void runTests() { std::stringstream buffer; std::streambuf *sbuf = std::cerr.rdbuf(); Logger *logger = Logger::get(); { std::cerr.rdbuf(buffer.rdbuf()); string msg("Test log message"); AVG_TRACE(Logger::category::NONE, Logger::severity::WARNING, msg); std::cerr.rdbuf(sbuf); TEST(buffer.str().find(msg) != string::npos); buffer.str(string()); std::cerr.rdbuf(buffer.rdbuf()); AVG_TRACE(Logger::category::NONE, Logger::severity::DEBUG, msg); std::cerr.rdbuf(sbuf); std::cout << buffer.str(); TEST(buffer.str().find(msg) == string::npos); buffer.str(string()); } { std::cerr.rdbuf(buffer.rdbuf()); category_t CUSTOM_CAT = logger->configureCategory("CUSTOM_CAT 1"); string msg("CUSTOM_CAT LOG"); AVG_TRACE(CUSTOM_CAT, Logger::severity::WARNING, msg); std::cerr.rdbuf(sbuf); TEST(buffer.str().find(msg) != string::npos); buffer.str(string()); } { std::cerr.rdbuf(buffer.rdbuf()); category_t CUSTOM_CAT = logger->configureCategory("CUSTOM_CAT 1", Logger::severity::CRITICAL); string msg_info("CUSTOM_CAT LOG INFO"); AVG_TRACE(CUSTOM_CAT, Logger::severity::WARNING, msg_info); std::cerr.rdbuf(sbuf); TEST(buffer.str().find(msg_info) == string::npos); buffer.str(string()); std::cerr.rdbuf(buffer.rdbuf()); string msg_critical("CUSTOM_CAT LOG CRITICAL"); AVG_TRACE(CUSTOM_CAT, Logger::severity::CRITICAL, msg_critical); std::cerr.rdbuf(sbuf); TEST(buffer.str().find(msg_critical) != string::npos); buffer.str(string()); } } }; class BaseTestSuite: public TestSuite { public: BaseTestSuite() : TestSuite("BaseTestSuite") { addTest(TestPtr(new DAGTest)); addTest(TestPtr(new QueueTest)); addTest(TestPtr(new WorkerThreadTest)); addTest(TestPtr(new ObjectCounterTest)); addTest(TestPtr(new GeomTest)); addTest(TestPtr(new TriangleTest)); addTest(TestPtr(new FileTest)); addTest(TestPtr(new OSTest)); addTest(TestPtr(new StringTest)); addTest(TestPtr(new SplineTest)); addTest(TestPtr(new BezierCurveTest)); addTest(TestPtr(new SignalTest)); addTest(TestPtr(new BacktraceTest)); addTest(TestPtr(new PolygonTest)); addTest(TestPtr(new XmlParserTest)); addTest(TestPtr(new StandardLoggerTest)); } }; int main(int nargs, char** args) { BaseTestSuite suite; suite.runTests(); bool bOK = suite.isOk(); if (bOK) { return 0; } else { return 1; } } libavg-1.8.2/src/base/triangulate/000077500000000000000000000000001236127404500170125ustar00rootroot00000000000000libavg-1.8.2/src/base/triangulate/AdvancingFront.cpp000066400000000000000000000053551236127404500224310ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // // // Based on Poly2Tri algorithm. // Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors // http://code.google.com/p/poly2tri/ // #include "AdvancingFront.h" namespace avg { AdvancingFront::AdvancingFront(Node& head, Node& tail) { m_Head = &head; m_Tail = &tail; m_SearchNode = &head; } Node* AdvancingFront::locateNode(const double& x) { Node* node = m_SearchNode; if (x < node->m_Value) { while ((node = node->m_Prev) != NULL) { if (x >= node->m_Value) { m_SearchNode = node; return node; } } } else { while ((node = node->m_Next) != NULL) { if (x < node->m_Value) { m_SearchNode = node->m_Prev; return node->m_Prev; } } } return NULL; } Node* AdvancingFront::findSearchNode(const double& x) { // TO DO: implement BST index return m_SearchNode; } Node* AdvancingFront::locatePoint(const Point* point) { const double px = point->m_X; Node* node = findSearchNode(px); const double nx = node->m_Point->m_X; if (px == nx) { if (point != node->m_Point) { // We might have two nodes with same x value for a short time if (point == node->m_Prev->m_Point) { node = node->m_Prev; } else if (point == node->m_Next->m_Point) { node = node->m_Next; } else { assert(0); } } } else if (px < nx) { while ((node = node->m_Prev) != NULL) { if (point == node->m_Point) { break; } } } else { while ((node = node->m_Next) != NULL) { if (point == node->m_Point) break; } } if (node) m_SearchNode = node; return node; } AdvancingFront::~AdvancingFront() {} } libavg-1.8.2/src/base/triangulate/AdvancingFront.h000066400000000000000000000045541236127404500220760ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // // // Based on Poly2Tri algorithm. // Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors // http://code.google.com/p/poly2tri/ // #ifndef ADVANCED_FRONT_H #define ADVANCED_FRONT_H #include "Shapes.h" namespace avg { struct Node; struct Node { Point* m_Point; TriangulationTriangle* m_Triangle; Node* m_Next; Node* m_Prev; double m_Value; Node() : m_Point(NULL), m_Triangle(NULL), m_Next(NULL), m_Prev(NULL), m_Value(0) {} Node(Point& p) : m_Point(&p), m_Triangle(NULL), m_Next(NULL), m_Prev(NULL), m_Value(p.m_X) {} Node(Point& p, TriangulationTriangle& t) : m_Point(&p), m_Triangle(&t), m_Next(NULL), m_Prev(NULL), m_Value(p.m_X) {} }; class AdvancingFront { public: AdvancingFront(Node& head, Node& tail); ~AdvancingFront(); Node* head(); void setHead(Node* node); Node* tail(); void setTail(Node* node); Node* search(); void setSearch(Node* node); /// Locate insertion point along advancing front Node* locateNode(const double& x); Node* locatePoint(const Point* point); private: Node* m_Head, *m_Tail, *m_SearchNode; Node* findSearchNode(const double& x); }; inline Node* AdvancingFront::head() { return m_Head; } inline void AdvancingFront::setHead(Node* node) { m_Head = node; } inline Node* AdvancingFront::tail() { return m_Tail; } inline void AdvancingFront::setTail(Node* node) { m_Tail = node; } inline Node* AdvancingFront::search() { return m_SearchNode; } inline void AdvancingFront::setSearch(Node* node) { m_SearchNode = node; } } #endif libavg-1.8.2/src/base/triangulate/Makefile.am000066400000000000000000000004651236127404500210530ustar00rootroot00000000000000AM_CPPFLAGS = -I.. @XML2_CFLAGS@ @PTHREAD_CFLAGS@ ALL_H = Triangulate.h Shapes.h Utils.h \ AdvancingFront.h Sweep.h SweepContext.h noinst_LTLIBRARIES = libtriangulate.la libtriangulate_la_SOURCES = Triangulate.cpp Shapes.cpp \ AdvancingFront.cpp Sweep.cpp SweepContext.cpp \ $(ALL_H) libavg-1.8.2/src/base/triangulate/Shapes.cpp000066400000000000000000000221631236127404500207450ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // // // Based on Poly2Tri algorithm. // Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors // http://code.google.com/p/poly2tri/ // #include "Shapes.h" #include namespace avg { TriangulationTriangle::TriangulationTriangle(Point& a, Point& b, Point& c) { m_Points[0] = &a; m_Points[1] = &b; m_Points[2] = &c; m_Neighbors[0] = NULL; m_Neighbors[1] = NULL; m_Neighbors[2] = NULL; m_ConstrainedEdge[0] = m_ConstrainedEdge[1] = m_ConstrainedEdge[2] = false; m_DelaunayEdge[0] = m_DelaunayEdge[1] = m_DelaunayEdge[2] = false; m_Interior = false; } // Update neighbor pointers void TriangulationTriangle::markNeighbor(Point* p1, Point* p2, TriangulationTriangle* t) { if ((p1 == m_Points[2] && p2 == m_Points[1]) || (p1 == m_Points[1] && p2 == m_Points[2])) { m_Neighbors[0] = t; } else if ((p1 == m_Points[0] && p2 == m_Points[2]) || (p1 == m_Points[2] && p2 == m_Points[0])) { m_Neighbors[1] = t; } else if ((p1 == m_Points[0] && p2 == m_Points[1]) || (p1 == m_Points[1] && p2 == m_Points[0])) { m_Neighbors[2] = t; } else { assert(0); } } // Exhaustive search to update neighbor pointers void TriangulationTriangle::markNeighbor(TriangulationTriangle& t) { if (t.contains(m_Points[1], m_Points[2])) { m_Neighbors[0] = &t; t.markNeighbor(m_Points[1], m_Points[2], this); } else if (t.contains(m_Points[0], m_Points[2])) { m_Neighbors[1] = &t; t.markNeighbor(m_Points[0], m_Points[2], this); } else if (t.contains(m_Points[0], m_Points[1])) { m_Neighbors[2] = &t; t.markNeighbor(m_Points[0], m_Points[1], this); } } void TriangulationTriangle::clear() { TriangulationTriangle *t; for (int i = 0; i < 3; i++) { t = m_Neighbors[i]; if (t != NULL) { t->clearNeighbor(this); } } clearNeighbors(); m_Points[0] = m_Points[1] = m_Points[2] = NULL; } void TriangulationTriangle::clearNeighbor(TriangulationTriangle *triangle) { if (m_Neighbors[0] == triangle) { m_Neighbors[0] = NULL; } else if (m_Neighbors[1] == triangle) { m_Neighbors[1] = NULL; } else { m_Neighbors[2] = NULL; } } void TriangulationTriangle::clearNeighbors() { m_Neighbors[0] = NULL; m_Neighbors[1] = NULL; m_Neighbors[2] = NULL; } void TriangulationTriangle::clearDelunayEdges() { m_DelaunayEdge[0] = m_DelaunayEdge[1] = m_DelaunayEdge[2] = false; } Point* TriangulationTriangle::oppositePoint(TriangulationTriangle& t, Point& p) { Point *cw = t.pointCW(p); return pointCW(*cw); } // Legalized triangle by rotating clockwise around point(0) void TriangulationTriangle::legalize(Point& point) { m_Points[1] = m_Points[0]; m_Points[0] = m_Points[2]; m_Points[2] = &point; } // Legalize triagnle by rotating clockwise around oPoint void TriangulationTriangle::legalize(Point& opoint, Point& npoint) { if (&opoint == m_Points[0]) { m_Points[1] = m_Points[0]; m_Points[0] = m_Points[2]; m_Points[2] = &npoint; } else if (&opoint == m_Points[1]) { m_Points[2] = m_Points[1]; m_Points[1] = m_Points[0]; m_Points[0] = &npoint; } else if (&opoint == m_Points[2]) { m_Points[0] = m_Points[2]; m_Points[2] = m_Points[1]; m_Points[1] = &npoint; } else { assert(0); } } unsigned int TriangulationTriangle::index(const Point* p) { if (p == m_Points[0]) { return 0; } else if (p == m_Points[1]) { return 1; } else if (p == m_Points[2]) { return 2; } assert(0); return 0; } unsigned int TriangulationTriangle::edgeIndex(const Point* p1, const Point* p2) { if (m_Points[0] == p1) { if (m_Points[1] == p2) { return 2; } else if (m_Points[2] == p2) { return 1; } } else if (m_Points[1] == p1) { if (m_Points[2] == p2) { return 0; } else if (m_Points[0] == p2) { return 2; } } else if (m_Points[2] == p1) { if (m_Points[0] == p2) { return 1; } else if (m_Points[1] == p2) { return 0; } } return -1; } void TriangulationTriangle::markConstrainedEdge(const int index) { m_ConstrainedEdge[index] = true; } void TriangulationTriangle::markConstrainedEdge(Edge& edge) { markConstrainedEdge(edge.m_P, edge.m_Q); } void TriangulationTriangle::markConstrainedEdge(Point* p, Point* q) { if ((q == m_Points[0] && p == m_Points[1]) || (q == m_Points[1] && p == m_Points[0])) { m_ConstrainedEdge[2] = true; } else if ((q == m_Points[0] && p == m_Points[2]) || (q == m_Points[2] && p == m_Points[0])) { m_ConstrainedEdge[1] = true; } else if ((q == m_Points[1] && p == m_Points[2]) || (q == m_Points[2] && p == m_Points[1])) { m_ConstrainedEdge[0] = true; } } // The point counter-clockwise to given point Point* TriangulationTriangle::pointCW(Point& point) { if (&point == m_Points[0]) { return m_Points[2]; } else if (&point == m_Points[1]) { return m_Points[0]; } else if (&point == m_Points[2]) { return m_Points[1]; } assert(0); return 0; // Silence compiler warning } Point* TriangulationTriangle::pointCCW(Point& point) { if (&point == m_Points[0]) { return m_Points[1]; } else if (&point == m_Points[1]) { return m_Points[2]; } else if (&point == m_Points[2]) { return m_Points[0]; } assert(0); return 0; // Silence compiler warning } TriangulationTriangle* TriangulationTriangle::neighborCW(Point& point) { if (&point == m_Points[0]) { return m_Neighbors[1]; } else if (&point == m_Points[1]) { return m_Neighbors[2]; } return m_Neighbors[0]; } TriangulationTriangle* TriangulationTriangle::neighborCCW(Point& point) { if (&point == m_Points[0]) { return m_Neighbors[2]; } else if (&point == m_Points[1]) { return m_Neighbors[0]; } return m_Neighbors[1]; } bool TriangulationTriangle::getConstrainedEdgeCCW(Point& p) { if (&p == m_Points[0]) { return m_ConstrainedEdge[2]; } else if (&p == m_Points[1]) { return m_ConstrainedEdge[0]; } return m_ConstrainedEdge[1]; } bool TriangulationTriangle::getConstrainedEdgeCW(Point& p) { if (&p == m_Points[0]) { return m_ConstrainedEdge[1]; } else if (&p == m_Points[1]) { return m_ConstrainedEdge[2]; } return m_ConstrainedEdge[0]; } void TriangulationTriangle::setConstrainedEdgeCCW(Point& p, bool ce) { if (&p == m_Points[0]) { m_ConstrainedEdge[2] = ce; } else if (&p == m_Points[1]) { m_ConstrainedEdge[0] = ce; } else { m_ConstrainedEdge[1] = ce; } } void TriangulationTriangle::setConstrainedEdgeCW(Point& p, bool ce) { if (&p == m_Points[0]) { m_ConstrainedEdge[1] = ce; } else if (&p == m_Points[1]) { m_ConstrainedEdge[2] = ce; } else { m_ConstrainedEdge[0] = ce; } } bool TriangulationTriangle::getDelunayEdgeCCW(Point& p) { if (&p == m_Points[0]) { return m_DelaunayEdge[2]; } else if (&p == m_Points[1]) { return m_DelaunayEdge[0]; } return m_DelaunayEdge[1]; } bool TriangulationTriangle::getDelunayEdgeCW(Point& p) { if (&p == m_Points[0]) { return m_DelaunayEdge[1]; } else if (&p == m_Points[1]) { return m_DelaunayEdge[2]; } return m_DelaunayEdge[0]; } void TriangulationTriangle::setDelunayEdgeCCW(Point& p, bool e) { if (&p == m_Points[0]) { m_DelaunayEdge[2] = e; } else if (&p == m_Points[1]) { m_DelaunayEdge[0] = e; } else { m_DelaunayEdge[1] = e; } } void TriangulationTriangle::setDelunayEdgeCW(Point& p, bool e) { if (&p == m_Points[0]) { m_DelaunayEdge[1] = e; } else if (&p == m_Points[1]) { m_DelaunayEdge[2] = e; } else { m_DelaunayEdge[0] = e; } } TriangulationTriangle& TriangulationTriangle::neighborAcross(Point& opoint) { if (&opoint == m_Points[0]) { return *m_Neighbors[0]; } else if (&opoint == m_Points[1]) { return *m_Neighbors[1]; } return *m_Neighbors[2]; } } libavg-1.8.2/src/base/triangulate/Shapes.h000066400000000000000000000150351236127404500204120ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // // // Based on Poly2Tri algorithm. // Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors // http://code.google.com/p/poly2tri/ // #ifndef SHAPES_H #define SHAPES_H #include #include #include #include namespace avg { struct Edge; struct Point { double m_X, m_Y; int m_Index; /// The edges this point constitutes an upper ending point std::vector m_EdgeList; /// Default constructor does nothing (for performance). Point() { m_X = 0.0; m_Y = 0.0; m_Index = 0; } Point(double x, double y, int index) : m_X(x), m_Y(y), m_Index(index) {} void set_zero() { m_X = 0.0; m_Y = 0.0; } void set(double x_, double y_) { m_X = x_; m_Y = y_; } Point operator -() const { Point v; v.set(-m_X, -m_Y); return v; } void operator +=(const Point& v) { m_X += v.m_X; m_Y += v.m_Y; } void operator -=(const Point& v) { m_X -= v.m_X; m_Y -= v.m_Y; } void operator *=(double a) { m_X *= a; m_Y *= a; } double length() const { return sqrt(m_X * m_X + m_Y * m_Y); } /// Convert this point into a unit point. Returns the Length. double normalize() { double len = length(); m_X /= len; m_Y /= len; return len; } }; // Represents a simple polygon's edge struct Edge { Point* m_P, *m_Q; Edge(Point& p1, Point& p2) :m_P(&p1), m_Q(&p2) { if (p1.m_Y > p2.m_Y) { m_Q = &p1; m_P = &p2; } else if (p1.m_Y == p2.m_Y) { if (p1.m_X > p2.m_X) { m_Q = &p1; m_P = &p2; } else if (p1.m_X == p2.m_X) { // Repeat points assert(false); } } m_Q->m_EdgeList.push_back(this); } }; class TriangulationTriangle { public: TriangulationTriangle(Point& a, Point& b, Point& c); /// Flags to determine if an edge is a Constrained edge bool m_ConstrainedEdge[3]; /// Flags to determine if an edge is a Delauney edge bool m_DelaunayEdge[3]; Point* getPoint(const int& index); Point* pointCW(Point& point); Point* pointCCW(Point& point); Point* oppositePoint(TriangulationTriangle& t, Point& p); TriangulationTriangle* getNeighbor(const int& index); void markNeighbor(Point* p1, Point* p2, TriangulationTriangle* t); void markNeighbor(TriangulationTriangle& t); void markConstrainedEdge(const int index); void markConstrainedEdge(Edge& edge); void markConstrainedEdge(Point* p, Point* q); unsigned int index(const Point* p); unsigned int edgeIndex(const Point* p1, const Point* p2); TriangulationTriangle* neighborCW(Point& point); TriangulationTriangle* neighborCCW(Point& point); bool getConstrainedEdgeCCW(Point& p); bool getConstrainedEdgeCW(Point& p); void setConstrainedEdgeCCW(Point& p, bool ce); void setConstrainedEdgeCW(Point& p, bool ce); bool getDelunayEdgeCCW(Point& p); bool getDelunayEdgeCW(Point& p); void setDelunayEdgeCCW(Point& p, bool e); void setDelunayEdgeCW(Point& p, bool e); bool contains(Point* p); bool contains(const Edge& e); bool contains(Point* p, Point* q); void legalize(Point& point); void legalize(Point& opoint, Point& npoint); void clear(); void clearNeighbor(TriangulationTriangle *triangle); void clearNeighbors(); void clearDelunayEdges(); inline bool isInterior(); inline void isInterior(bool b); TriangulationTriangle& neighborAcross(Point& opoint); private: Point* m_Points[3]; TriangulationTriangle* m_Neighbors[3]; bool m_Interior; }; inline bool cmp(const Point* a, const Point* b) { if (a->m_Y < b->m_Y) { return true; } else if (a->m_Y == b->m_Y) { // Make sure q is point with greater x value if (a->m_X < b->m_X) { return true; } } return false; } /* inline Point operator +(const Point& a, const Point& b) { return Point(a.x + b.x, a.y + b.y); } inline Point operator -(const Point& a, const Point& b) { return Point(a.x - b.x, a.y - b.y); } inline Point operator *(double s, const Point& a) { return Point(s * a.x, s * a.y, a.index); } */ inline bool operator ==(const Point& a, const Point& b) { return a.m_X == b.m_X && a.m_Y == b.m_Y; } inline bool operator !=(const Point& a, const Point& b) { return a.m_X != b.m_X && a.m_Y != b.m_Y; } inline double dot(const Point& a, const Point& b) { return a.m_X * b.m_X + a.m_Y * b.m_Y; } inline double cross(const Point& a, const Point& b) { return a.m_X * b.m_Y - a.m_Y * b.m_X; } inline Point cross(const Point& a, double s) { return Point(s * a.m_Y, -s * a.m_X, a.m_Index); } inline Point cross(const double s, const Point& a) { return Point(-s * a.m_Y, s * a.m_X, a.m_Index); } inline Point* TriangulationTriangle::getPoint(const int& index) { return m_Points[index]; } inline TriangulationTriangle* TriangulationTriangle::getNeighbor( const int& index) { return m_Neighbors[index]; } inline bool TriangulationTriangle::contains(Point* p) { return p == m_Points[0] || p == m_Points[1] || p == m_Points[2]; } inline bool TriangulationTriangle::contains(const Edge& e) { return contains(e.m_P) && contains(e.m_Q); } inline bool TriangulationTriangle::contains(Point* p, Point* q) { return contains(p) && contains(q); } inline bool TriangulationTriangle::isInterior() { return m_Interior; } inline void TriangulationTriangle::isInterior(bool b) { m_Interior = b; } } #endif libavg-1.8.2/src/base/triangulate/Sweep.cpp000066400000000000000000000617321236127404500206120ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // // // Based on Poly2Tri algorithm. // Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors // http://code.google.com/p/poly2tri/ // #include #include "Sweep.h" #include "SweepContext.h" #include "AdvancingFront.h" #include "Utils.h" namespace avg { void Sweep::Triangulate(SweepContext& sc) { arrayCount = 0; for (unsigned int i = 0; i < (unsigned)sc.pointCount(); i++) { m_Nodes.push_back(new Node()); } sc.initTriangulation(); sc.createAdvancingFront(); // Sweep points; build mesh sweepPoints(sc); // Clean up finalizationPolygon(sc); } void Sweep::sweepPoints(SweepContext& sc) { for (int i = 1; i < sc.pointCount(); i++) { Point& point = *sc.getPoint(i); Node* node = &pointEvent(sc, point); for (unsigned int i = 0; i < point.m_EdgeList.size(); i++) { edgeEvent(sc, point.m_EdgeList[i], node); } } } void Sweep::finalizationPolygon(SweepContext& sc) { // Get an Internal triangle to start with TriangulationTriangle* t = sc.front()->head()->m_Next->m_Triangle; Point* p = sc.front()->head()->m_Next->m_Point; while (!t->getConstrainedEdgeCW(*p)) { t = t->neighborCCW(*p); } // Collect interior triangles constrained by edges sc.meshClean(*t); } Node& Sweep::pointEvent(SweepContext& sc, Point& point) { Node& node = sc.locateNode(point); Node& new_node = newFrontTriangle(sc, point, node); // Only need to check +epsilon since point never have smaller // x value than node due to how we fetch nodes from the front if (point.m_X <= node.m_Point->m_X + EPSILON) { fill(sc, node); } //tcx.AddNode(new_node); fillAdvancingFront(sc, new_node); return new_node; } void Sweep::edgeEvent(SweepContext& sc, Edge* edge, Node* node) { sc.m_EdgeEvent.m_ConstrainedEdge = edge; sc.m_EdgeEvent.m_Right = (edge->m_P->m_X > edge->m_Q->m_X); if (isEdgeSideOfTriangle(*node->m_Triangle, *edge->m_P, *edge->m_Q)) { return; } // to do: integrate with flip process might give some better performance // but for now this avoid the issue with cases that needs both flips and fills fillEdgeEvent(sc, edge, node); edgeEvent(sc, *edge->m_P, *edge->m_Q, node->m_Triangle, *edge->m_Q); } void Sweep::edgeEvent(SweepContext& sc, Point& ep, Point& eq, TriangulationTriangle* triangle, Point& point) { if (isEdgeSideOfTriangle(*triangle, ep, eq)) { return; } Point* p1 = triangle->pointCCW(point); Orientation o1 = orient2d(eq, *p1, ep); if (o1 == COLLINEAR) { if (triangle->contains(&eq, p1)) { triangle->markConstrainedEdge(&eq, p1); // We are modifying the constraint maybe it would be better to // not change the given constraint and just keep a variable for the new constraint sc.m_EdgeEvent.m_ConstrainedEdge->m_Q = p1; triangle = &triangle->neighborAcross(point); edgeEvent(sc, ep, *p1, triangle, *p1); } else { std::runtime_error("EdgeEvent - collinear points not supported"); assert(0); } return; } Point* p2 = triangle->pointCW(point); Orientation o2 = orient2d(eq, *p2, ep); if (o2 == COLLINEAR) { if (triangle->contains(&eq, p2)) { triangle->markConstrainedEdge(&eq, p2); // We are modifying the constraint maybe it would be better to // not change the given constraint and just keep a variable for the new constraint sc.m_EdgeEvent.m_ConstrainedEdge->m_Q = p2; triangle = &triangle->neighborAcross(point); edgeEvent(sc, ep, *p2, triangle, *p2); } else { std::runtime_error("EdgeEvent - collinear points not supported"); assert(0); } return; } if (o1 == o2) { // Need to decide if we are rotating CW or CCW to get to a triangle // that will cross edge if (o1 == CW) { triangle = triangle->neighborCCW(point); } else { triangle = triangle->neighborCW(point); } edgeEvent(sc, ep, eq, triangle, point); } else { // This triangle crosses constraint so lets flippin start! flipEdgeEvent(sc, ep, eq, triangle, point); } } bool Sweep::isEdgeSideOfTriangle(TriangulationTriangle& triangle, Point& ep, Point& eq) { int index = triangle.edgeIndex(&ep, &eq); if (index != -1) { triangle.markConstrainedEdge(index); TriangulationTriangle* t = triangle.getNeighbor(index); if (t) { t->markConstrainedEdge(&ep, &eq); } return true; } return false; } Node& Sweep::newFrontTriangle(SweepContext& sc, Point& point, Node& node) { TriangulationTriangle* triangle = new TriangulationTriangle(point, *node.m_Point, *node.m_Next->m_Point); triangle->markNeighbor(*node.m_Triangle); sc.addToMap(triangle); Node* newNode = m_Nodes[arrayCount++]; //new Node(point); newNode->m_Point = &point; newNode->m_Value = point.m_X; // m_Nodes.push_back(newNode); newNode->m_Next = node.m_Next; newNode->m_Prev = &node; node.m_Next->m_Prev = newNode; node.m_Next = newNode; if (!legalize(sc, *triangle)) { sc.mapTriangleToNodes(*triangle); } return *newNode; } void Sweep::fill(SweepContext& sc, Node& node) { TriangulationTriangle* triangle = new TriangulationTriangle( *node.m_Prev->m_Point, *node.m_Point, *node.m_Next->m_Point); // TO DO: should copy the constrained_edge value from neighbor triangles // for now constrained_edge values are copied during the legalize triangle->markNeighbor(*node.m_Prev->m_Triangle); triangle->markNeighbor(*node.m_Triangle); sc.addToMap(triangle); // Update the advancing front node.m_Prev->m_Next = node.m_Next; node.m_Next->m_Prev = node.m_Prev; // If it was legalized the triangle has already been mapped if (!legalize(sc, *triangle)) { sc.mapTriangleToNodes(*triangle); } } void Sweep::fillAdvancingFront(SweepContext& sc, Node& n) { Node* node = n.m_Next; while (node->m_Next) { double angle = holeAngle(*node); if (angle > M_PI_2 || angle < -M_PI_2) break; // ---------- LEAK FIX -------------- // Fill(tcx, *node); // node = node->m_next; Node *tmp = node; node = node->m_Next; fill(sc, *tmp); // ---------------------------------- } node = n.m_Prev; while (node->m_Prev) { double angle = holeAngle(*node); if (angle > M_PI_2 || angle < -M_PI_2) break; fill(sc, *node); node = node->m_Prev; } if (n.m_Next && n.m_Next->m_Next) { double angle = basinAngle(n); if (angle < PI_3div4) { fillBasin(sc, n); } } } double Sweep::basinAngle(Node& node) { double ax = node.m_Point->m_X - node.m_Next->m_Next->m_Point->m_X; double ay = node.m_Point->m_Y - node.m_Next->m_Next->m_Point->m_Y; return atan2(ay, ax); } double Sweep::holeAngle(Node& node) { /* Complex plane * ab = cosA +i*sinA * ab = (ax + ay*i)(bx + by*i) = (ax*bx + ay*by) + i(ax*by-ay*bx) * atan2(y,x) computes the principal value of the argument function * applied to the complex number x+iy * Where x = ax*bx + ay*by * y = ax*by - ay*bx */ double ax = node.m_Next->m_Point->m_X - node.m_Point->m_X; double ay = node.m_Next->m_Point->m_Y - node.m_Point->m_Y; double bx = node.m_Prev->m_Point->m_X - node.m_Point->m_X; double by = node.m_Prev->m_Point->m_Y - node.m_Point->m_Y; return atan2(ax * by - ay * bx, ax * bx + ay * by); } bool Sweep::legalize(SweepContext& sc, TriangulationTriangle& t) { // To legalize a triangle we start by finding if any of the three edges // violate the Delaunay condition for (int i = 0; i < 3; i++) { if (t.m_DelaunayEdge[i]) continue; TriangulationTriangle* ot = t.getNeighbor(i); if (ot) { Point* p = t.getPoint(i); Point* op = ot->oppositePoint(t, *p); int oi = ot->index(op); // If this is a Constrained Edge or a Delaunay Edge(only during recursive legalization) // then we should not try to legalize if (ot->m_ConstrainedEdge[oi] || ot->m_DelaunayEdge[oi]) { t.m_ConstrainedEdge[i] = ot->m_ConstrainedEdge[oi]; continue; } bool inside = incircle(*p, *t.pointCCW(*p), *t.pointCW(*p), *op); if (inside) { // Lets mark this shared edge as Delaunay t.m_DelaunayEdge[i] = true; ot->m_DelaunayEdge[oi] = true; // Lets rotate shared edge one vertex CW to legalize it rotateTrianglePair(t, *p, *ot, *op); // We now got one valid Delaunay Edge shared by two triangles // This gives us 4 new edges to check for Delaunay // Make sure that triangle to node mapping is done only one time for a specific triangle bool notLegalized = !legalize(sc, t); if (notLegalized) { sc.mapTriangleToNodes(t); } notLegalized = !legalize(sc, *ot); if (notLegalized) sc.mapTriangleToNodes(*ot); // Reset the Delaunay edges, since they only are valid Delaunay edges // until we add a new triangle or point. // XX X: need to think about this. Can these edges be tried after we // return to previous recursive level? t.m_DelaunayEdge[i] = false; ot->m_DelaunayEdge[oi] = false; // If triangle have been legalized no need to check the other edges since // the recursive legalization will handles those so we can end here. return true; } } } return false; } bool Sweep::incircle(Point& pa, Point& pb, Point& pc, Point& pd) { double adx = pa.m_X - pd.m_X; double ady = pa.m_Y - pd.m_Y; double bdx = pb.m_X - pd.m_X; double bdy = pb.m_Y - pd.m_Y; double adxbdy = adx * bdy; double bdxady = bdx * ady; double oabd = adxbdy - bdxady; if (oabd <= 0) { return false; } double cdx = pc.m_X - pd.m_X; double cdy = pc.m_Y - pd.m_Y; double cdxady = cdx * ady; double adxcdy = adx * cdy; double ocad = cdxady - adxcdy; if (ocad <= 0) { return false; } double bdxcdy = bdx * cdy; double cdxbdy = cdx * bdy; double alift = adx * adx + ady * ady; double blift = bdx * bdx + bdy * bdy; double clift = cdx * cdx + cdy * cdy; double det = alift * (bdxcdy - cdxbdy) + blift * ocad + clift * oabd; return det > 0; } void Sweep::rotateTrianglePair(TriangulationTriangle& t, Point& p, TriangulationTriangle& ot, Point& op) { TriangulationTriangle* n1, *n2, *n3, *n4; n1 = t.neighborCCW(p); n2 = t.neighborCW(p); n3 = ot.neighborCCW(op); n4 = ot.neighborCW(op); bool ce1, ce2, ce3, ce4; ce1 = t.getConstrainedEdgeCCW(p); ce2 = t.getConstrainedEdgeCW(p); ce3 = ot.getConstrainedEdgeCCW(op); ce4 = ot.getConstrainedEdgeCW(op); bool de1, de2, de3, de4; de1 = t.getDelunayEdgeCCW(p); de2 = t.getDelunayEdgeCW(p); de3 = ot.getDelunayEdgeCCW(op); de4 = ot.getDelunayEdgeCW(op); t.legalize(p, op); ot.legalize(op, p); // Remap delaunay_edge ot.setDelunayEdgeCCW(p, de1); t.setDelunayEdgeCW(p, de2); t.setDelunayEdgeCCW(op, de3); ot.setDelunayEdgeCW(op, de4); // Remap constrained_edge ot.setConstrainedEdgeCCW(p, ce1); t.setConstrainedEdgeCW(p, ce2); t.setConstrainedEdgeCCW(op, ce3); ot.setConstrainedEdgeCW(op, ce4); // Remap neighbors // XX X: might optimize the markNeighbor by keeping track of // what side should be assigned to what neighbor after the // rotation. Now mark neighbor does lots of testing to find // the right side. t.clearNeighbors(); ot.clearNeighbors(); if (n1) { ot.markNeighbor(*n1); } if (n2) { t.markNeighbor(*n2); } if (n3) { t.markNeighbor(*n3); } if (n4) { ot.markNeighbor(*n4); } t.markNeighbor(ot); } void Sweep::fillBasin(SweepContext& sc, Node& node) { if (orient2d(*node.m_Point, *node.m_Next->m_Point, *node.m_Next->m_Next->m_Point) == CCW) { sc.m_Basin.m_LeftNode = node.m_Next->m_Next; } else { sc.m_Basin.m_LeftNode = node.m_Next; } // Find the bottom and right node sc.m_Basin.m_BottomNode = sc.m_Basin.m_LeftNode; while (sc.m_Basin.m_BottomNode->m_Next && sc.m_Basin.m_BottomNode->m_Point->m_Y >= sc.m_Basin.m_BottomNode->m_Next->m_Point->m_Y) { sc.m_Basin.m_BottomNode = sc.m_Basin.m_BottomNode->m_Next; } if (sc.m_Basin.m_BottomNode == sc.m_Basin.m_LeftNode) { // No valid basin return; } sc.m_Basin.m_RightNode = sc.m_Basin.m_BottomNode; while (sc.m_Basin.m_RightNode->m_Next && sc.m_Basin.m_RightNode->m_Point->m_Y < sc.m_Basin.m_RightNode->m_Next->m_Point->m_Y) { sc.m_Basin.m_RightNode = sc.m_Basin.m_RightNode->m_Next; } if (sc.m_Basin.m_RightNode == sc.m_Basin.m_BottomNode) { // No valid basins return; } sc.m_Basin.m_Width = sc.m_Basin.m_RightNode->m_Point->m_X - sc.m_Basin.m_LeftNode->m_Point->m_X; sc.m_Basin.m_LeftHighest = sc.m_Basin.m_LeftNode->m_Point->m_Y > sc.m_Basin.m_RightNode->m_Point->m_Y; fillBasinReq(sc, sc.m_Basin.m_BottomNode); } void Sweep::fillBasinReq(SweepContext& sc, Node* node) { // if shallow stop filling if (isShallow(sc, *node)) { return; } fill(sc, *node); if (node->m_Prev == sc.m_Basin.m_LeftNode && node->m_Next == sc.m_Basin.m_RightNode) { return; } else if (node->m_Prev == sc.m_Basin.m_LeftNode) { Orientation o = orient2d(*node->m_Point, *node->m_Next->m_Point, *node->m_Next->m_Next->m_Point); if (o == CW) { return; } node = node->m_Next; } else if (node->m_Next == sc.m_Basin.m_RightNode) { Orientation o = orient2d(*node->m_Point, *node->m_Prev->m_Point, *node->m_Prev->m_Prev->m_Point); if (o == CCW) { return; } node = node->m_Prev; } else { // Continue with the neighbor node with lowest Y value if (node->m_Prev->m_Point->m_Y < node->m_Next->m_Point->m_Y) { node = node->m_Prev; } else { node = node->m_Next; } } fillBasinReq(sc, node); } bool Sweep::isShallow(SweepContext& sc, Node& node) { double height; if (sc.m_Basin.m_LeftHighest) { height = sc.m_Basin.m_LeftNode->m_Point->m_Y - node.m_Point->m_Y; } else { height = sc.m_Basin.m_RightNode->m_Point->m_Y - node.m_Point->m_Y; } // if shallow stop filling if (sc.m_Basin.m_Width > height) { return true; } return false; } void Sweep::fillEdgeEvent(SweepContext& sc, Edge* edge, Node* node) { if (sc.m_EdgeEvent.m_Right) { fillRightAboveEdgeEvent(sc, edge, node); } else { fillLeftAboveEdgeEvent(sc, edge, node); } } void Sweep::fillRightAboveEdgeEvent(SweepContext& sc, Edge* edge, Node* node) { while (node->m_Next->m_Point->m_X < edge->m_P->m_X) { // Check if next node is below the edge if (orient2d(*edge->m_Q, *node->m_Next->m_Point, *edge->m_P) == CCW) { fillRightBelowEdgeEvent(sc, edge, *node); } else { node = node->m_Next; } } } void Sweep::fillRightBelowEdgeEvent(SweepContext& sc, Edge* edge, Node& node) { if (node.m_Point->m_X < edge->m_P->m_X) { if (orient2d(*node.m_Point, *node.m_Next->m_Point, *node.m_Next->m_Next->m_Point) == CCW) { // Concave fillRightConcaveEdgeEvent(sc, edge, node); } else { // Convex fillRightConvexEdgeEvent(sc, edge, node); // Retry this one fillRightBelowEdgeEvent(sc, edge, node); } } } void Sweep::fillRightConcaveEdgeEvent(SweepContext& sc, Edge* edge, Node& node) { fill(sc, *node.m_Next); if (node.m_Next->m_Point != edge->m_P) { // Next above or below edge? if (orient2d(*edge->m_Q, *node.m_Next->m_Point, *edge->m_P) == CCW) { // Below if (orient2d(*node.m_Point, *node.m_Next->m_Point, *node.m_Next->m_Next->m_Point) == CCW) { // Next is concave fillRightConcaveEdgeEvent(sc, edge, node); } else { // Next is convex } } } } void Sweep::fillRightConvexEdgeEvent(SweepContext& sc, Edge* edge, Node& node) { // Next concave or convex? if (orient2d(*node.m_Next->m_Point, *node.m_Next->m_Next->m_Point, *node.m_Next->m_Next->m_Next->m_Point) == CCW) { // Concave fillRightConcaveEdgeEvent(sc, edge, *node.m_Next); } else { // Convex // Next above or below edge? if (orient2d(*edge->m_Q, *node.m_Next->m_Next->m_Point, *edge->m_P) == CCW) { // Below fillRightConvexEdgeEvent(sc, edge, *node.m_Next); } else { // Above } } } void Sweep::fillLeftAboveEdgeEvent(SweepContext& sc, Edge* edge, Node* node) { while (node->m_Prev->m_Point->m_X > edge->m_P->m_X) { // Check if next node is below the edge if (orient2d(*edge->m_Q, *node->m_Prev->m_Point, *edge->m_P) == CW) { fillLeftBelowEdgeEvent(sc, edge, *node); } else { node = node->m_Prev; } } } void Sweep::fillLeftBelowEdgeEvent(SweepContext& sc, Edge* edge, Node& node) { if (node.m_Point->m_X > edge->m_P->m_X) { if (orient2d(*node.m_Point, *node.m_Prev->m_Point, *node.m_Prev->m_Prev->m_Point) == CW) { // Concave fillLeftConcaveEdgeEvent(sc, edge, node); } else { // Convex fillLeftConvexEdgeEvent(sc, edge, node); // Retry this one fillLeftBelowEdgeEvent(sc, edge, node); } } } void Sweep::fillLeftConvexEdgeEvent(SweepContext& sc, Edge* edge, Node& node) { // Next concave or convex? if (orient2d(*node.m_Prev->m_Point, *node.m_Prev->m_Prev->m_Point, *node.m_Prev->m_Prev->m_Prev->m_Point) == CW) { // Concave fillLeftConcaveEdgeEvent(sc, edge, *node.m_Prev); } else { // Convex // Next above or below edge? if (orient2d(*edge->m_Q, *node.m_Prev->m_Prev->m_Point, *edge->m_P) == CW) { // Below fillLeftConvexEdgeEvent(sc, edge, *node.m_Prev); } else { // Above } } } void Sweep::fillLeftConcaveEdgeEvent(SweepContext& sc, Edge* edge, Node& node) { fill(sc, *node.m_Prev); if (node.m_Prev->m_Point != edge->m_P) { // Next above or below edge? if (orient2d(*edge->m_Q, *node.m_Prev->m_Point, *edge->m_P) == CW) { // Below if (orient2d(*node.m_Point, *node.m_Prev->m_Point, *node.m_Prev->m_Prev->m_Point) == CW) { // Next is concave fillLeftConcaveEdgeEvent(sc, edge, node); } else { // Next is convex } } } } void Sweep::flipEdgeEvent(SweepContext& sc, Point& ep, Point& eq, TriangulationTriangle* t, Point& p) { TriangulationTriangle& ot = t->neighborAcross(p); Point& op = *ot.oppositePoint(*t, p); if (&ot == NULL) { // If we want to integrate the fillEdgeEvent do it here // With current implementation we should never get here //throw new RuntimeException( "[BUG:FIXM E] FLIP failed due to missing triangle"); assert(0); } if (inScanArea(p, *t->pointCCW(p), *t->pointCW(p), op)) { // Lets rotate shared edge one vertex CW rotateTrianglePair(*t, p, ot, op); sc.mapTriangleToNodes(*t); sc.mapTriangleToNodes(ot); if (p == eq && op == ep) { if (eq == *sc.m_EdgeEvent.m_ConstrainedEdge->m_Q && ep == *sc.m_EdgeEvent.m_ConstrainedEdge->m_P) { t->markConstrainedEdge(&ep, &eq); ot.markConstrainedEdge(&ep, &eq); legalize(sc, *t); legalize(sc, ot); } else { // One of the triangles should be legalized here? } } else { Orientation o = orient2d(eq, op, ep); t = &nextFlipTriangle(sc, (int) o, *t, ot, p, op); flipEdgeEvent(sc, ep, eq, t, p); } } else { Point& newP = nextFlipPoint(ep, eq, ot, op); flipScanEdgeEvent(sc, ep, eq, *t, ot, newP); edgeEvent(sc, ep, eq, t, p); } } TriangulationTriangle& Sweep::nextFlipTriangle(SweepContext& sc, int o, TriangulationTriangle& t, TriangulationTriangle& ot, Point& p, Point& op) { if (o == CCW) { // ot is not crossing edge after flip int edgeIndex = ot.edgeIndex(&p, &op); ot.m_DelaunayEdge[edgeIndex] = true; legalize(sc, ot); ot.clearDelunayEdges(); return t; } // t is not crossing edge after flip int edgeIndex = t.edgeIndex(&p, &op); t.m_DelaunayEdge[edgeIndex] = true; legalize(sc, t); t.clearDelunayEdges(); return ot; } Point& Sweep::nextFlipPoint(Point& ep, Point& eq, TriangulationTriangle& ot, Point& op) { Orientation o2d = orient2d(eq, op, ep); if (o2d == CW) { // Right return *ot.pointCCW(op); } else if (o2d == CCW) { // Left return *ot.pointCW(op); } else { //throw new RuntimeException("[Unsupported] Opposing point on constrained edge"); assert(0); return ep; // Silence compiler warning. } } void Sweep::flipScanEdgeEvent(SweepContext& sc, Point& ep, Point& eq, TriangulationTriangle& flipTriangle, TriangulationTriangle& t, Point& p) { TriangulationTriangle& ot = t.neighborAcross(p); Point& op = *ot.oppositePoint(t, p); if (&t.neighborAcross(p) == NULL) { // If we want to integrate the fillEdgeEvent do it here // With current implementation we should never get here //throw new RuntimeException( "[BUG:FIXM E] FLIP failed due to missing triangle"); assert(0); } if (inScanArea(eq, *flipTriangle.pointCCW(eq), *flipTriangle.pointCW(eq), op)) { // flip with new edge op->eq flipEdgeEvent(sc, eq, op, &ot, op); // To do: Actually I just figured out that it should be possible to // improve this by getting the next ot and op before the the above // flip and continue the flipScanEdgeEvent here // set new ot and op here and loop back to inScanArea test // also need to set a new flip_triangle first // Turns out at first glance that this is somewhat complicated // so it will have to wait. } else { Point& newP = nextFlipPoint(ep, eq, ot, op); flipScanEdgeEvent(sc, ep, eq, flipTriangle, ot, newP); } } Sweep::~Sweep() { for (unsigned int i = 0; i < m_Nodes.size(); i++) { delete m_Nodes[i]; } } } libavg-1.8.2/src/base/triangulate/Sweep.h000066400000000000000000000141751236127404500202560ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // // // Based on Poly2Tri algorithm. // Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors // http://code.google.com/p/poly2tri/ // #ifndef SWEEP_H #define SWEEP_H #include namespace avg { class SweepContext; struct Node; struct Point; struct Edge; class TriangulationTriangle; class Sweep { public: void Triangulate(SweepContext& sc); ~Sweep(); private: void sweepPoints(SweepContext& sc); Node& pointEvent(SweepContext& sc, Point& point); void edgeEvent(SweepContext& sc, Edge* edge, Node* node); void edgeEvent(SweepContext& sc, Point& ep, Point& eq, TriangulationTriangle* triangle, Point& point); Node& newFrontTriangle(SweepContext& sc, Point& point, Node& node); void fill(SweepContext& sc, Node& node); bool legalize(SweepContext& sc, TriangulationTriangle& t); /** * Requirement:
* 1. a,b and c form a triangle.
* 2. a and d is know to be on opposite side of bc
*
     *                a
     *                +
     *               / \
     *              /   \
     *            b/     \c
     *            +-------+
     *           /    d    \
     *          /           \
     * 
* Fact: d has to be in area B to have a chance to be inside the circle formed by * a,b and c
* d is outside B if orient2d(a,b,d) or orient2d(c,a,d) is CW
* This preknowledge gives us a way to optimize the incircle test * @param a - triangle point, opposite d * @param b - triangle point * @param c - triangle point * @param d - point opposite a * @return true if d is inside circle, false if on circle edge */ bool incircle(Point& pa, Point& pb, Point& pc, Point& pd); /** * Rotates a triangle pair one vertex CW *
     *       n2                    n2
     *  P +-----+             P +-----+
     *    | t  /|               |\  t |
     *    |   / |               | \   |
     *  n1|  /  |n3           n1|  \  |n3
     *    | /   |    after CW   |   \ |
     *    |/ oT |               | oT \|
     *    +-----+ oP            +-----+
     *       n4                    n4
     * 
*/ void rotateTrianglePair(TriangulationTriangle& t, Point& p, TriangulationTriangle& ot, Point& op); void fillAdvancingFront(SweepContext& sc, Node& n); double holeAngle(Node& node); /** * The basin angle is decided against the horizontal line [1,0] */ double basinAngle(Node& node); void fillBasin(SweepContext& sc, Node& node); void fillBasinReq(SweepContext& sc, Node* node); bool isShallow(SweepContext& sc, Node& node); bool isEdgeSideOfTriangle(TriangulationTriangle& triangle, Point& ep, Point& eq); void fillEdgeEvent(SweepContext& sc, Edge* edge, Node* node); void fillRightAboveEdgeEvent(SweepContext& sc, Edge* edge, Node* node); void fillRightBelowEdgeEvent(SweepContext& sc, Edge* edge, Node& node); void fillRightConcaveEdgeEvent(SweepContext& sc, Edge* edge, Node& node); void fillRightConvexEdgeEvent(SweepContext& sc, Edge* edge, Node& node); void fillLeftAboveEdgeEvent(SweepContext& sc, Edge* edge, Node* node); void fillLeftBelowEdgeEvent(SweepContext& sc, Edge* edge, Node& node); void fillLeftConcaveEdgeEvent(SweepContext& sc, Edge* edge, Node& node); void fillLeftConvexEdgeEvent(SweepContext& sc, Edge* edge, Node& node); void flipEdgeEvent(SweepContext& sc, Point& ep, Point& eq, TriangulationTriangle* t, Point& p); /** * After a flip we have two triangles and know that only one will still be * intersecting the edge. So decide which to contiune with and legalize the other * * @param sc * @param o - should be the result of an orient2d( eq, op, ep ) * @param t - triangle 1 * @param ot - triangle 2 * @param p - a point shared by both triangles * @param op - another point shared by both triangles * @return returns the triangle still intersecting the edge */ TriangulationTriangle& nextFlipTriangle(SweepContext& sc, int o, TriangulationTriangle& t, TriangulationTriangle& ot, Point& p, Point& op); /** * When we need to traverse from one triangle to the next we need * the point in current triangle that is the opposite point to the next * triangle. * * @param ep * @param eq * @param ot * @param op * @return */ Point& nextFlipPoint(Point& ep, Point& eq, TriangulationTriangle& ot, Point& op); /** * Scan part of the FlipScan algorithm
* When a triangle pair isn't flippable we will scan for the next * point that is inside the flip triangle scan area. When found * we generate a new flipEdgeEvent * * @param sc * @param ep - last point on the edge we are traversing * @param eq - first point on the edge we are traversing * @param flipTriangle - the current triangle sharing the point eq with edge * @param t * @param p */ void flipScanEdgeEvent(SweepContext& sc, Point& ep, Point& eq, TriangulationTriangle& flip_triangle, TriangulationTriangle& t, Point& p); void finalizationPolygon(SweepContext& sc); std::vector m_Nodes; unsigned int arrayCount; }; } #endif libavg-1.8.2/src/base/triangulate/SweepContext.cpp000066400000000000000000000114241236127404500221500ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // // // Based on Poly2Tri algorithm. // Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors // http://code.google.com/p/poly2tri/ // #include "SweepContext.h" #include #include "AdvancingFront.h" namespace avg { SweepContext::SweepContext(std::vector polyline) { m_Basin = Basin(); m_EdgeEvent = EdgeEvent(); m_Points = polyline; initEdges(m_Points); } void SweepContext::addHole(std::vector polyline) { initEdges(polyline); for (unsigned int i = 0; i < polyline.size(); i++) { m_Points.push_back(polyline[i]); } } void SweepContext::addPoint(Point* point) { m_Points.push_back(point); } std::vector& SweepContext::getTriangles() { return m_Triangles; } void SweepContext::initTriangulation() { double xmax(m_Points[0]->m_X), xmin(m_Points[0]->m_X); double ymax(m_Points[0]->m_Y), ymin(m_Points[0]->m_Y); // Calculate bounds. for (unsigned int i = 0; i < m_Points.size(); i++) { Point& p = *m_Points[i]; if (p.m_X > xmax) { xmax = p.m_X; } if (p.m_X < xmin) { xmin = p.m_X; } if (p.m_Y > ymax) { ymax = p.m_Y; } if (p.m_Y < ymin) { ymin = p.m_Y; } } double dx = kAlpha * (xmax - xmin); double dy = kAlpha * (ymax - ymin); m_Head = new Point(xmax + dx, ymin - dy, 0); m_Tail = new Point(xmin - dx, ymin - dy, 0); // Sort along y-axis std::sort(m_Points.begin(), m_Points.end(), cmp); } void SweepContext::initEdges(std::vector polyline) { int numPoints = polyline.size(); for (int i = 0; i < numPoints; i++) { int j = i < numPoints - 1 ? i + 1 : 0; m_EdgeList.push_back(new Edge(*polyline[i], *polyline[j])); } } Point* SweepContext::getPoint(const int& index) { return m_Points[index]; } void SweepContext::addToMap(TriangulationTriangle* triangle) { m_Map.push_back(triangle); } Node& SweepContext::locateNode(Point& point) { // TO DO implement search tree return *m_Front->locateNode(point.m_X); } void SweepContext::createAdvancingFront() { // Initial triangle TriangulationTriangle* triangle = new TriangulationTriangle(*m_Points[0], *m_Tail, *m_Head); m_Map.push_back(triangle); m_AfHead = new Node(*triangle->getPoint(1), *triangle); m_AfMiddle = new Node(*triangle->getPoint(0), *triangle); m_AfTail = new Node(*triangle->getPoint(2)); m_Front = new AdvancingFront(*m_AfHead, *m_AfTail); m_AfHead->m_Next = m_AfMiddle; m_AfMiddle->m_Next = m_AfTail; m_AfMiddle->m_Prev = m_AfHead; m_AfTail->m_Prev = m_AfMiddle; } void SweepContext::removeNode(Node* node) { delete node; } void SweepContext::mapTriangleToNodes(TriangulationTriangle& t) { for (int i = 0; i < 3; i++) { if (!t.getNeighbor(i)) { Node* n = m_Front->locatePoint(t.pointCW(*t.getPoint(i))); if (n) { n->m_Triangle = &t; } } } } void SweepContext::removeFromMap(TriangulationTriangle* triangle) { m_Map.remove(triangle); } void SweepContext::meshClean(TriangulationTriangle& triangle) { if (&triangle != NULL && !triangle.isInterior()) { triangle.isInterior(true); m_Triangles.push_back(&triangle); for (int i = 0; i < 3; i++) { if (!triangle.m_ConstrainedEdge[i]) meshClean(*triangle.getNeighbor(i)); } } } SweepContext::~SweepContext() { delete m_Head; delete m_Tail; delete m_Front; delete m_AfHead; delete m_AfMiddle; delete m_AfTail; typedef std::list type_list; for (type_list::iterator iter = m_Map.begin(); iter != m_Map.end(); ++iter) { TriangulationTriangle* ptr = *iter; delete ptr; } for (unsigned int i = 0; i < m_EdgeList.size(); i++) { delete m_EdgeList[i]; } } } libavg-1.8.2/src/base/triangulate/SweepContext.h000066400000000000000000000074251236127404500216230ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // // // Based on Poly2Tri algorithm. // Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors // http://code.google.com/p/poly2tri/ // #ifndef SWEEP_CONTEXT_H #define SWEEP_CONTEXT_H #include #include #include namespace avg { // Inital triangle factor, seed triangle will extend 30% of // PointSet width to both left and right. const double kAlpha = 0.3; struct Point; class TriangulationTriangle; struct Node; struct Edge; class AdvancingFront; class SweepContext { public: SweepContext(std::vector polyline); ~SweepContext(); void setHead(Point* p1); Point* head(); void setTail(Point* p1); Point* tail(); int pointCount(); Node& locateNode(Point& point); void removeNode(Node* node); void createAdvancingFront(); /// Try to map a node to all sides of this triangle that don't have a neighbor void mapTriangleToNodes(TriangulationTriangle& t); void addToMap(TriangulationTriangle* triangle); Point* getPoint(const int& index); Point* GetPoints(); void removeFromMap(TriangulationTriangle* triangle); void addHole(std::vector polyline); void addPoint(Point* point); AdvancingFront* front(); void meshClean(TriangulationTriangle& triangle); std::vector& getTriangles(); std::vector m_EdgeList; struct Basin { Node* m_LeftNode; Node* m_BottomNode; Node* m_RightNode; double m_Width; bool m_LeftHighest; Basin() { clear(); } void clear() { m_LeftNode = NULL; m_BottomNode = NULL; m_RightNode = NULL; m_Width = 0.0; m_LeftHighest = false; } }; struct EdgeEvent { Edge* m_ConstrainedEdge; bool m_Right; EdgeEvent() : m_ConstrainedEdge(NULL), m_Right(false) { } }; Basin m_Basin; EdgeEvent m_EdgeEvent; private: friend class Sweep; std::vector m_Triangles; std::list m_Map; std::vector m_Points; AdvancingFront* m_Front; Point* m_Head; Point* m_Tail; Node *m_AfHead, *m_AfMiddle, *m_AfTail; void initTriangulation(); void initEdges(std::vector polyline); }; inline AdvancingFront* SweepContext::front() { return m_Front; } inline int SweepContext::pointCount() { return m_Points.size(); } inline void SweepContext::setHead(Point* p1) { m_Head = p1; } inline Point* SweepContext::head() { return m_Head; } inline void SweepContext::setTail(Point* p1) { m_Tail = p1; } inline Point* SweepContext::tail() { return m_Tail; } } #endif libavg-1.8.2/src/base/triangulate/Triangulate.cpp000066400000000000000000000054601236127404500220020ustar00rootroot00000000000000// // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // // // Based on Poly2Tri algorithm. // Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors // http://code.google.com/p/poly2tri/ // #include "Triangulate.h" #include "Sweep.h" #include "SweepContext.h" #include "Shapes.h" using namespace std; namespace avg { void triangulatePolygon(std::vector& dest, const Vec2Vector& points, const std::vector& holeIndexes) { std::vector polyline; std::vector holeLine; unsigned int contourEnd; if (holeIndexes.size() > 0) { contourEnd = holeIndexes[0]; } else { contourEnd = points.size(); } for (unsigned int i = 0; i < contourEnd; i++) { polyline.push_back(new Point(points[i].x, points[i].y, i)); } SweepContext* sweepContext = new SweepContext(polyline); Sweep* sweep = new Sweep; if (holeIndexes.size() > 0) { for (unsigned int i = 0; i < holeIndexes.size(); i++) { if ( i < holeIndexes.size()-1) { for (unsigned int j = holeIndexes[i]; j < points.size() && j < holeIndexes[i+1]; j++) { holeLine.push_back(new Point(points[j].x, points[j].y, j)); } } else { for (unsigned int j = holeIndexes[i]; j < points.size(); j++) { holeLine.push_back(new Point(points[j].x, points[j].y, j)); } } sweepContext->addHole(holeLine); holeLine.clear(); } } sweep->Triangulate(*sweepContext); std::vector& triangles = sweepContext->getTriangles(); for (unsigned int i = 0; i < triangles.size(); ++i) { dest.push_back(triangles[i]->getPoint(0)->m_Index); dest.push_back(triangles[i]->getPoint(1)->m_Index); dest.push_back(triangles[i]->getPoint(2)->m_Index); } delete sweep; delete sweepContext; for (unsigned int i = 0; i < polyline.size(); i++) { delete polyline[i]; } } } libavg-1.8.2/src/base/triangulate/Triangulate.h000066400000000000000000000022521236127404500214430ustar00rootroot00000000000000// // libavg - Media Playback Engine. // Copyright (C) 2003-2014 Ulrich von Zadow // // This library is free software; you can redistribute it and/or // modify it under the terms of the GNU Lesser General Public // License as published by the Free Software Foundation; either // version 2 of the License, or (at your option) any later version. // // This library is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU // Lesser General Public License for more details. // // You should have received a copy of the GNU Lesser General Public // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // // Current versions can be found at www.libavg.de // #ifndef TRIANGULATION_H_ #define TRIANGULATION_H_ #include "../GLMHelper.h" namespace avg { void triangulatePolygon(std::vector& dest, const Vec2Vector& points, const std::vector& holeIndexes = std::vector()); } #endif /* TRIANGULATION_H_ */ libavg-1.8.2/src/base/triangulate/Utils.h000066400000000000000000000070271236127404500202710ustar00rootroot00000000000000/* * Poly2Tri Copyright (c) 2009-2010, Poly2Tri Contributors * http://code.google.com/p/poly2tri/ * * All rights reserved. * * Redistribution and use in source and binary forms, with or without modification, * are permitted provided that the following conditions are met: * * * Redistributions of source code must retain the above copyright notice, * this list of conditions and the following disclaimer. * * Redistributions in binary form must reproduce the above copyright notice, * this list of conditions and the following disclaimer in the documentation * and/or other materials provided with the distribution. * * Neither the name of Poly2Tri nor the names of its contributors may be * used to endorse or promote products derived from this software without specific * prior written permission. * * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING * NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ #ifndef UTILS_H #define UTILS_H // Otherwise #defines like M_PI are undeclared under Visual Studio #define _USE_MATH_DEFINES #include #include namespace avg { const double PI_3div4 = 3 * M_PI / 4; const double EPSILON = 1e-12; enum Orientation { CW, CCW, COLLINEAR }; /** * Forumla to calculate signed area
* Positive if CCW
* Negative if CW
* 0 if collinear
*
 * A[P1,P2,P3]  =  (x1*y2 - y1*x2) + (x2*y3 - y2*x3) + (x3*y1 - y3*x1)
 *              =  (x1-x3)*(y2-y3) - (y1-y3)*(x2-x3)
 * 
*/ Orientation orient2d(Point& pa, Point& pb, Point& pc) { double detleft = (pa.m_X - pc.m_X) * (pb.m_Y - pc.m_Y); double detright = (pa.m_Y - pc.m_Y) * (pb.m_X - pc.m_X); double val = detleft - detright; if (val > -EPSILON && val < EPSILON) { return COLLINEAR; } else if (val > 0) { return CCW; } return CW; } /* bool InScanArea(Point& pa, Point& pb, Point& pc, Point& pd) { double pdx = pd.x; double pdy = pd.y; double adx = pa.x - pdx; double ady = pa.y - pdy; double bdx = pb.x - pdx; double bdy = pb.y - pdy; double adxbdy = adx * bdy; double bdxady = bdx * ady; double oabd = adxbdy - bdxady; if (oabd <= EPSILON) { return false; } double cdx = pc.x - pdx; double cdy = pc.y - pdy; double cdxady = cdx * ady; double adxcdy = adx * cdy; double ocad = cdxady - adxcdy; if (ocad <= EPSILON) { return false; } return true; } */ bool inScanArea(Point& pa, Point& pb, Point& pc, Point& pd) { double oadb = (pa.m_X - pb.m_X) * (pd.m_Y - pb.m_Y) - (pd.m_X - pb.m_X) * (pa.m_Y - pb.m_Y); if (oadb >= -EPSILON) { return false; } double oadc = (pa.m_X - pc.m_X) * (pd.m_Y - pc.m_Y) - (pd.m_X - pc.m_X) * (pa.m_Y - pc.m_Y); if (oadc <= EPSILON) { return false; } return true; } } #endif libavg-1.8.2/src/glm/000077500000000000000000000000001236127404500143405ustar00rootroot00000000000000libavg-1.8.2/src/glm/CMakeLists.txt000066400000000000000000000030361236127404500171020ustar00rootroot00000000000000set(NAME glm) file(GLOB ROOT_SOURCE *.cpp) file(GLOB ROOT_INLINE *.inl) file(GLOB ROOT_HEADER *.hpp) file(GLOB_RECURSE CORE_SOURCE ./core/*.cpp) file(GLOB_RECURSE CORE_INLINE ./core/*.inl) file(GLOB_RECURSE CORE_HEADER ./core/*.hpp) file(GLOB_RECURSE GTC_SOURCE ./gtc/*.cpp) file(GLOB_RECURSE GTC_INLINE ./gtc/*.inl) file(GLOB_RECURSE GTC_HEADER ./gtc/*.hpp) file(GLOB_RECURSE GTX_SOURCE ./gtx/*.cpp) file(GLOB_RECURSE GTX_INLINE ./gtx/*.inl) file(GLOB_RECURSE GTX_HEADER ./gtx/*.hpp) file(GLOB_RECURSE VIRTREV_SOURCE ./virtrev/*.cpp) file(GLOB_RECURSE VIRTREV_INLINE ./virtrev/*.inl) file(GLOB_RECURSE VIRTREV_HEADER ./virtrev/*.hpp) source_group("Core Files" FILES ${CORE_SOURCE}) source_group("Core Files" FILES ${CORE_INLINE}) source_group("Core Files" FILES ${CORE_HEADER}) source_group("GTC Files" FILES ${GTC_SOURCE}) source_group("GTC Files" FILES ${GTC_INLINE}) source_group("GTC Files" FILES ${GTC_HEADER}) source_group("GTX Files" FILES ${GTX_SOURCE}) source_group("GTX Files" FILES ${GTX_INLINE}) source_group("GTX Files" FILES ${GTX_HEADER}) source_group("VIRTREV Files" FILES ${VIRTREV_SOURCE}) source_group("VIRTREV Files" FILES ${VIRTREV_INLINE}) source_group("VIRTREV Files" FILES ${VIRTREV_HEADER}) include_directories(${CMAKE_CURRENT_SOURCE_DIR}/..) add_executable(${NAME} ${ROOT_SOURCE} ${ROOT_INLINE} ${ROOT_HEADER} ${CORE_SOURCE} ${CORE_INLINE} ${CORE_HEADER} ${GTC_SOURCE} ${GTC_INLINE} ${GTC_HEADER} ${GTX_SOURCE} ${GTX_INLINE} ${GTX_HEADER} ${VIRTREV_SOURCE} ${VIRTREV_INLINE} ${VIRTREV_HEADER}) libavg-1.8.2/src/glm/core/000077500000000000000000000000001236127404500152705ustar00rootroot00000000000000libavg-1.8.2/src/glm/core/_detail.hpp000066400000000000000000000162051236127404500174060ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2008-07-24 // Updated : 2008-08-31 // Licence : This source is under MIT License // File : glm/core/_detail.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_core_detail #define glm_core_detail #include "setup.hpp" #include namespace glm{ namespace detail { class thalf; #if(__STDC_VERSION__ >= 199901L) // C99 detected, 64 bit types available typedef int64_t sint64; typedef uint64_t uint64; #elif(GLM_COMPILER & GLM_COMPILER_VC) typedef signed __int64 sint64; typedef unsigned __int64 uint64; #elif(GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC | GLM_COMPILER_CLANG)) __extension__ typedef signed long long sint64; __extension__ typedef unsigned long long uint64; #elif(GLM_COMPILER & GLM_COMPILER_BC) typedef Int64 sint64; typedef Uint64 uint64; #else//unknown compiler typedef signed long long sint64; typedef unsigned long long uint64; #endif//GLM_COMPILER template struct If { template static GLM_FUNC_QUALIFIER T apply(F functor, const T& val) { return functor(val); } }; template<> struct If { template static GLM_FUNC_QUALIFIER T apply(F, const T& val) { return val; } }; //template //struct traits //{ // static const bool is_signed = false; // static const bool is_float = false; // static const bool is_vector = false; // static const bool is_matrix = false; // static const bool is_genType = false; // static const bool is_genIType = false; // static const bool is_genUType = false; //}; //template <> //struct traits //{ // static const bool is_float = true; // static const bool is_genType = true; //}; //template <> //struct traits //{ // static const bool is_float = true; // static const bool is_genType = true; //}; //template <> //struct traits //{ // static const bool is_float = true; // static const bool is_genType = true; //}; //template //struct desc //{ // typedef genType type; // typedef genType * pointer; // typedef genType const* const_pointer; // typedef genType const *const const_pointer_const; // typedef genType *const pointer_const; // typedef genType & reference; // typedef genType const& const_reference; // typedef genType const& param_type; // typedef typename genType::value_type value_type; // typedef typename genType::size_type size_type; // static const typename size_type value_size; //}; //template //const typename desc::size_type desc::value_size = genType::value_size(); union uif32 { GLM_FUNC_QUALIFIER uif32() : i(0) {} GLM_FUNC_QUALIFIER uif32(float f) : f(f) {} GLM_FUNC_QUALIFIER uif32(unsigned int i) : i(i) {} float f; unsigned int i; }; union uif64 { GLM_FUNC_QUALIFIER uif64() : i(0) {} GLM_FUNC_QUALIFIER uif64(double f) : f(f) {} GLM_FUNC_QUALIFIER uif64(uint64 i) : i(i) {} double f; uint64 i; }; typedef uif32 uif; ////////////////// // int template struct is_int { enum is_int_enum { _YES = 0, _NO = 1 }; }; #define GLM_DETAIL_IS_INT(T) \ template <> \ struct is_int \ { \ enum is_int_enum \ { \ _YES = 1, \ _NO = 0 \ }; \ } ////////////////// // uint template struct is_uint { enum is_uint_enum { _YES = 0, _NO = 1 }; }; #define GLM_DETAIL_IS_UINT(T) \ template <> \ struct is_uint \ { \ enum is_uint_enum \ { \ _YES = 1, \ _NO = 0 \ }; \ } //GLM_DETAIL_IS_UINT(unsigned long long) ////////////////// // float template struct is_float { enum is_float_enum { _YES = 0, _NO = 1 }; }; #define GLM_DETAIL_IS_FLOAT(T) \ template <> \ struct is_float \ { \ enum is_float_enum \ { \ _YES = 1, \ _NO = 0 \ }; \ } ////////////////// // bool template struct is_bool { enum is_bool_enum { _YES = 0, _NO = 1 }; }; template <> struct is_bool { enum is_bool_enum { _YES = 1, _NO = 0 }; }; ////////////////// // vector template struct is_vector { enum is_vector_enum { _YES = 0, _NO = 1 }; }; # define GLM_DETAIL_IS_VECTOR(TYPE) \ template \ struct is_vector > \ { \ enum is_vector_enum \ { \ _YES = 1, \ _NO = 0 \ }; \ } ////////////////// // matrix template struct is_matrix { enum is_matrix_enum { _YES = 0, _NO = 1 }; }; #define GLM_DETAIL_IS_MATRIX(T) \ template <> \ struct is_matrix \ { \ enum is_matrix_enum \ { \ _YES = 1, \ _NO = 0 \ }; \ } ////////////////// // type template struct type { enum type_enum { is_float = is_float::_YES, is_int = is_int::_YES, is_uint = is_uint::_YES, is_bool = is_bool::_YES }; }; ////////////////// // type typedef signed char int8; typedef signed short int16; typedef signed int int32; typedef detail::sint64 int64; typedef unsigned char uint8; typedef unsigned short uint16; typedef unsigned int uint32; typedef detail::uint64 uint64; typedef detail::thalf float16; typedef float float32; typedef double float64; }//namespace detail }//namespace glm #if((GLM_COMPILER & GLM_COMPILER_VC) && (GLM_COMPILER >= GLM_COMPILER_VC2005)) # define GLM_DEPRECATED __declspec(deprecated) # define GLM_ALIGN(x) __declspec(align(x)) # define GLM_ALIGNED_STRUCT(x) __declspec(align(x)) struct # define GLM_RESTRICT __declspec(restrict) # define GLM_RESTRICT_VAR __restrict #elif((GLM_COMPILER & (GLM_COMPILER_GCC | GLM_COMPILER_LLVM_GCC)) && (GLM_COMPILER >= GLM_COMPILER_GCC31)) # define GLM_DEPRECATED __attribute__((__deprecated__)) # define GLM_ALIGN(x) __attribute__((aligned(x))) # define GLM_ALIGNED_STRUCT(x) struct __attribute__((aligned(x))) # if(GLM_COMPILER >= GLM_COMPILER_GCC33) # define GLM_RESTRICT __restrict__ # define GLM_RESTRICT_VAR __restrict__ # else # define GLM_RESTRICT # define GLM_RESTRICT_VAR # endif # define GLM_RESTRICT __restrict__ # define GLM_RESTRICT_VAR __restrict__ #else # define GLM_DEPRECATED # define GLM_ALIGN # define GLM_ALIGNED_STRUCT(x) # define GLM_RESTRICT # define GLM_RESTRICT_VAR #endif//GLM_COMPILER #endif//glm_core_detail libavg-1.8.2/src/glm/core/_fixes.hpp000066400000000000000000000012661236127404500172630ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2011-02-21 // Updated : 2011-02-21 // Licence : This source is under MIT License // File : glm/core/_fixes.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// //! Workaround for compatibility with other libraries #ifdef max #undef max #endif //! Workaround for compatibility with other libraries #ifdef min #undef min #endif libavg-1.8.2/src/glm/core/_swizzle.hpp000066400000000000000000001500221236127404500176470ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2006-04-20 // Updated : 2008-08-22 // Licence : This source is under MIT License // File : glm/core/_swizzle.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_core_swizzle #define glm_core_swizzle namespace glm { enum comp { X = 0, R = 0, S = 0, Y = 1, G = 1, T = 1, Z = 2, B = 2, P = 2, W = 3, A = 3, Q = 3 }; }//namespace glm #if(defined(GLM_SWIZZLE_XYZW) || defined(GLM_SWIZZLE)) #define xx swizzle(glm::X, glm::X) #define yx swizzle(glm::Y, glm::X) #define zx swizzle(glm::Z, glm::X) #define wx swizzle(glm::W, glm::X) #define xy swizzle(glm::X, glm::Y) #define yy swizzle(glm::Y, glm::Y) #define zy swizzle(glm::Z, glm::Y) #define wy swizzle(glm::W, glm::Y) #define xz swizzle(glm::X, glm::Z) #define yz swizzle(glm::Y, glm::Z) #define zz swizzle(glm::Z, glm::Z) #define wz swizzle(glm::W, glm::Z) #define xw swizzle(glm::X, glm::W) #define yw swizzle(glm::Y, glm::W) #define zw swizzle(glm::Z, glm::W) #define ww swizzle(glm::W, glm::W) #endif #if(defined(GLM_SWIZZLE_RGBA) || defined(GLM_SWIZZLE)) #define rr swizzle(glm::X, glm::X) #define gr swizzle(glm::Y, glm::X) #define br swizzle(glm::Z, glm::X) #define ar swizzle(glm::W, glm::X) #define rg swizzle(glm::X, glm::Y) #define gg swizzle(glm::Y, glm::Y) #define bg swizzle(glm::Z, glm::Y) #define ag swizzle(glm::W, glm::Y) #define rb swizzle(glm::X, glm::Z) #define gb swizzle(glm::Y, glm::Z) #define bb swizzle(glm::Z, glm::Z) #define ab swizzle(glm::W, glm::Z) #define ra swizzle(glm::X, glm::W) #define ga swizzle(glm::Y, glm::W) #define ba swizzle(glm::Z, glm::W) #define aa swizzle(glm::W, glm::W) #endif #if(defined(GLM_FORCE_SWIZZLE_STPQ) || defined(GLM_SWIZZLE)) #define ss swizzle(glm::X, glm::X) #define ts swizzle(glm::Y, glm::X) #define ps swizzle(glm::Z, glm::X) #define qs swizzle(glm::W, glm::X) #define st swizzle(glm::X, glm::Y) #define tt swizzle(glm::Y, glm::Y) #define pt swizzle(glm::Z, glm::Y) #define qt swizzle(glm::W, glm::Y) #define sp swizzle(glm::X, glm::Z) #define tp swizzle(glm::Y, glm::Z) #define pp swizzle(glm::Z, glm::Z) #define qp swizzle(glm::W, glm::Z) #define sq swizzle(glm::X, glm::W) #define tq swizzle(glm::Y, glm::W) #define pq swizzle(glm::Z, glm::W) #define qq swizzle(glm::W, glm::W) #endif #if(defined(GLM_SWIZZLE_XYZW) || defined(GLM_SWIZZLE)) #define xxx swizzle(glm::X, glm::X, glm::X) #define yxx swizzle(glm::Y, glm::X, glm::X) #define zxx swizzle(glm::Z, glm::X, glm::X) #define wxx swizzle(glm::W, glm::X, glm::X) #define xyx swizzle(glm::X, glm::Y, glm::X) #define yyx swizzle(glm::Y, glm::Y, glm::X) #define zyx swizzle(glm::Z, glm::Y, glm::X) #define wyx swizzle(glm::W, glm::Y, glm::X) #define xzx swizzle(glm::X, glm::Z, glm::X) #define yzx swizzle(glm::Y, glm::Z, glm::X) #define zzx swizzle(glm::Z, glm::Z, glm::X) #define wzx swizzle(glm::W, glm::Z, glm::X) #define xwx swizzle(glm::X, glm::W, glm::X) #define ywx swizzle(glm::Y, glm::W, glm::X) #define zwx swizzle(glm::Z, glm::W, glm::X) #define wwx swizzle(glm::W, glm::W, glm::X) #define xxy swizzle(glm::X, glm::X, glm::Y) #define yxy swizzle(glm::Y, glm::X, glm::Y) #define zxy swizzle(glm::Z, glm::X, glm::Y) #define wxy swizzle(glm::W, glm::X, glm::Y) #define xyy swizzle(glm::X, glm::Y, glm::Y) #define yyy swizzle(glm::Y, glm::Y, glm::Y) #define zyy swizzle(glm::Z, glm::Y, glm::Y) #define wyy swizzle(glm::W, glm::Y, glm::Y) #define xzy swizzle(glm::X, glm::Z, glm::Y) #define yzy swizzle(glm::Y, glm::Z, glm::Y) #define zzy swizzle(glm::Z, glm::Z, glm::Y) #define wzy swizzle(glm::W, glm::Z, glm::Y) #define xwy swizzle(glm::X, glm::W, glm::Y) #define ywy swizzle(glm::Y, glm::W, glm::Y) #define zwy swizzle(glm::Z, glm::W, glm::Y) #define wwy swizzle(glm::W, glm::W, glm::Y) #define xxz swizzle(glm::X, glm::X, glm::Z) #define yxz swizzle(glm::Y, glm::X, glm::Z) #define zxz swizzle(glm::Z, glm::X, glm::Z) #define wxz swizzle(glm::W, glm::X, glm::Z) #define xyz swizzle(glm::X, glm::Y, glm::Z) #define yyz swizzle(glm::Y, glm::Y, glm::Z) #define zyz swizzle(glm::Z, glm::Y, glm::Z) #define wyz swizzle(glm::W, glm::Y, glm::Z) #define xzz swizzle(glm::X, glm::Z, glm::Z) #define yzz swizzle(glm::Y, glm::Z, glm::Z) #define zzz swizzle(glm::Z, glm::Z, glm::Z) #define wzz swizzle(glm::W, glm::Z, glm::Z) #define xwz swizzle(glm::X, glm::W, glm::Z) #define ywz swizzle(glm::Y, glm::W, glm::Z) #define zwz swizzle(glm::Z, glm::W, glm::Z) #define wwz swizzle(glm::W, glm::W, glm::Z) #define xxw swizzle(glm::X, glm::X, glm::W) #define yxw swizzle(glm::Y, glm::X, glm::W) #define zxw swizzle(glm::Z, glm::X, glm::W) #define wxw swizzle(glm::W, glm::X, glm::W) #define xyw swizzle(glm::X, glm::Y, glm::W) #define yyw swizzle(glm::Y, glm::Y, glm::W) #define zyw swizzle(glm::Z, glm::Y, glm::W) #define wyw swizzle(glm::W, glm::Y, glm::W) #define xzw swizzle(glm::X, glm::Z, glm::W) #define yzw swizzle(glm::Y, glm::Z, glm::W) #define zzw swizzle(glm::Z, glm::Z, glm::W) #define wzw swizzle(glm::W, glm::Z, glm::W) #define xww swizzle(glm::X, glm::W, glm::W) #define yww swizzle(glm::Y, glm::W, glm::W) #define zww swizzle(glm::Z, glm::W, glm::W) #define www swizzle(glm::W, glm::W, glm::W) #endif #if(defined(GLM_SWIZZLE_RGBA) || defined(GLM_SWIZZLE)) #define rrr swizzle(glm::X, glm::X, glm::X) #define grr swizzle(glm::Y, glm::X, glm::X) #define brr swizzle(glm::Z, glm::X, glm::X) #define arr swizzle(glm::W, glm::X, glm::X) #define rgr swizzle(glm::X, glm::Y, glm::X) #define ggr swizzle(glm::Y, glm::Y, glm::X) #define bgr swizzle(glm::Z, glm::Y, glm::X) #define agr swizzle(glm::W, glm::Y, glm::X) #define rbr swizzle(glm::X, glm::Z, glm::X) #define gbr swizzle(glm::Y, glm::Z, glm::X) #define bbr swizzle(glm::Z, glm::Z, glm::X) #define abr swizzle(glm::W, glm::Z, glm::X) #define rar swizzle(glm::X, glm::W, glm::X) #define gar swizzle(glm::Y, glm::W, glm::X) #define bar swizzle(glm::Z, glm::W, glm::X) #define aar swizzle(glm::W, glm::W, glm::X) #define rrg swizzle(glm::X, glm::X, glm::Y) #define grg swizzle(glm::Y, glm::X, glm::Y) #define brg swizzle(glm::Z, glm::X, glm::Y) #define arg swizzle(glm::W, glm::X, glm::Y) #define rgg swizzle(glm::X, glm::Y, glm::Y) #define ggg swizzle(glm::Y, glm::Y, glm::Y) #define bgg swizzle(glm::Z, glm::Y, glm::Y) #define agg swizzle(glm::W, glm::Y, glm::Y) #define rbg swizzle(glm::X, glm::Z, glm::Y) #define gbg swizzle(glm::Y, glm::Z, glm::Y) #define bbg swizzle(glm::Z, glm::Z, glm::Y) #define abg swizzle(glm::W, glm::Z, glm::Y) #define rag swizzle(glm::X, glm::W, glm::Y) #define gag swizzle(glm::Y, glm::W, glm::Y) #define bag swizzle(glm::Z, glm::W, glm::Y) #define aag swizzle(glm::W, glm::W, glm::Y) #define rrb swizzle(glm::X, glm::X, glm::Z) #define grb swizzle(glm::Y, glm::X, glm::Z) #define brb swizzle(glm::Z, glm::X, glm::Z) #define arb swizzle(glm::W, glm::X, glm::Z) #define rgb swizzle(glm::X, glm::Y, glm::Z) #define ggb swizzle(glm::Y, glm::Y, glm::Z) #define bgb swizzle(glm::Z, glm::Y, glm::Z) #define agb swizzle(glm::W, glm::Y, glm::Z) #define rbb swizzle(glm::X, glm::Z, glm::Z) #define gbb swizzle(glm::Y, glm::Z, glm::Z) #define bbb swizzle(glm::Z, glm::Z, glm::Z) #define abb swizzle(glm::W, glm::Z, glm::Z) #define rab swizzle(glm::X, glm::W, glm::Z) #define gab swizzle(glm::Y, glm::W, glm::Z) #define bab swizzle(glm::Z, glm::W, glm::Z) #define aab swizzle(glm::W, glm::W, glm::Z) #define rra swizzle(glm::X, glm::X, glm::W) #define gra swizzle(glm::Y, glm::X, glm::W) #define bra swizzle(glm::Z, glm::X, glm::W) #define ara swizzle(glm::W, glm::X, glm::W) #define rga swizzle(glm::X, glm::Y, glm::W) #define gga swizzle(glm::Y, glm::Y, glm::W) #define bga swizzle(glm::Z, glm::Y, glm::W) #define aga swizzle(glm::W, glm::Y, glm::W) #define rba swizzle(glm::X, glm::Z, glm::W) #define gba swizzle(glm::Y, glm::Z, glm::W) #define bba swizzle(glm::Z, glm::Z, glm::W) #define aba swizzle(glm::W, glm::Z, glm::W) #define raa swizzle(glm::X, glm::W, glm::W) #define gaa swizzle(glm::Y, glm::W, glm::W) #define baa swizzle(glm::Z, glm::W, glm::W) #define aaa swizzle(glm::W, glm::W, glm::W) #endif #if(defined(GLM_FORCE_SWIZZLE_STPQ) || defined(GLM_SWIZZLE)) #define sss swizzle(glm::X, glm::X, glm::X) #define tss swizzle(glm::Y, glm::X, glm::X) #define pss swizzle(glm::Z, glm::X, glm::X) #define qss swizzle(glm::W, glm::X, glm::X) #define sts swizzle(glm::X, glm::Y, glm::X) #define tts swizzle(glm::Y, glm::Y, glm::X) #define pts swizzle(glm::Z, glm::Y, glm::X) #define qts swizzle(glm::W, glm::Y, glm::X) #define sps swizzle(glm::X, glm::Z, glm::X) #define tps swizzle(glm::Y, glm::Z, glm::X) #define pps swizzle(glm::Z, glm::Z, glm::X) #define qps swizzle(glm::W, glm::Z, glm::X) #define sqs swizzle(glm::X, glm::W, glm::X) #define tqs swizzle(glm::Y, glm::W, glm::X) #define pqs swizzle(glm::Z, glm::W, glm::X) #define qqs swizzle(glm::W, glm::W, glm::X) #define sst swizzle(glm::X, glm::X, glm::Y) #define tst swizzle(glm::Y, glm::X, glm::Y) #define pst swizzle(glm::Z, glm::X, glm::Y) #define qst swizzle(glm::W, glm::X, glm::Y) #define stt swizzle(glm::X, glm::Y, glm::Y) #define ttt swizzle(glm::Y, glm::Y, glm::Y) #define ptt swizzle(glm::Z, glm::Y, glm::Y) #define qtt swizzle(glm::W, glm::Y, glm::Y) #define spt swizzle(glm::X, glm::Z, glm::Y) #define tpt swizzle(glm::Y, glm::Z, glm::Y) #define ppt swizzle(glm::Z, glm::Z, glm::Y) #define qpt swizzle(glm::W, glm::Z, glm::Y) #define sqt swizzle(glm::X, glm::W, glm::Y) #define tqt swizzle(glm::Y, glm::W, glm::Y) #define pqt swizzle(glm::Z, glm::W, glm::Y) #define qqt swizzle(glm::W, glm::W, glm::Y) #define ssp swizzle(glm::X, glm::X, glm::Z) #define tsp swizzle(glm::Y, glm::X, glm::Z) #define psp swizzle(glm::Z, glm::X, glm::Z) #define qsp swizzle(glm::W, glm::X, glm::Z) #define stp swizzle(glm::X, glm::Y, glm::Z) #define ttp swizzle(glm::Y, glm::Y, glm::Z) #define ptp swizzle(glm::Z, glm::Y, glm::Z) #define qtp swizzle(glm::W, glm::Y, glm::Z) #define spp swizzle(glm::X, glm::Z, glm::Z) #define tpp swizzle(glm::Y, glm::Z, glm::Z) #define ppp swizzle(glm::Z, glm::Z, glm::Z) #define qpp swizzle(glm::W, glm::Z, glm::Z) #define sqp swizzle(glm::X, glm::W, glm::Z) #define tqp swizzle(glm::Y, glm::W, glm::Z) #define pqp swizzle(glm::Z, glm::W, glm::Z) #define qqp swizzle(glm::W, glm::W, glm::Z) #define ssq swizzle(glm::X, glm::X, glm::W) #define tsq swizzle(glm::Y, glm::X, glm::W) #define psq swizzle(glm::Z, glm::X, glm::W) #define qsq swizzle(glm::W, glm::X, glm::W) #define stq swizzle(glm::X, glm::Y, glm::W) #define ttq swizzle(glm::Y, glm::Y, glm::W) #define ptq swizzle(glm::Z, glm::Y, glm::W) #define qtq swizzle(glm::W, glm::Y, glm::W) #define spq swizzle(glm::X, glm::Z, glm::W) #define tpq swizzle(glm::Y, glm::Z, glm::W) #define ppq swizzle(glm::Z, glm::Z, glm::W) #define qpq swizzle(glm::W, glm::Z, glm::W) #define sqq swizzle(glm::X, glm::W, glm::W) #define tqq swizzle(glm::Y, glm::W, glm::W) #define pqq swizzle(glm::Z, glm::W, glm::W) #define qqq swizzle(glm::W, glm::W, glm::W) #endif #if(defined(GLM_SWIZZLE_XYZW) || defined(GLM_SWIZZLE)) #define xxxx swizzle(glm::X, glm::X, glm::X, glm::X) #define yxxx swizzle(glm::Y, glm::X, glm::X, glm::X) #define zxxx swizzle(glm::Z, glm::X, glm::X, glm::X) #define wxxx swizzle(glm::W, glm::X, glm::X, glm::X) #define xyxx swizzle(glm::X, glm::Y, glm::X, glm::X) #define yyxx swizzle(glm::Y, glm::Y, glm::X, glm::X) #define zyxx swizzle(glm::Z, glm::Y, glm::X, glm::X) #define wyxx swizzle(glm::W, glm::Y, glm::X, glm::X) #define xzxx swizzle(glm::X, glm::Z, glm::X, glm::X) #define yzxx swizzle(glm::Y, glm::Z, glm::X, glm::X) #define zzxx swizzle(glm::Z, glm::Z, glm::X, glm::X) #define wzxx swizzle(glm::W, glm::Z, glm::X, glm::X) #define xwxx swizzle(glm::X, glm::W, glm::X, glm::X) #define ywxx swizzle(glm::Y, glm::W, glm::X, glm::X) #define zwxx swizzle(glm::Z, glm::W, glm::X, glm::X) #define wwxx swizzle(glm::W, glm::W, glm::X, glm::X) #define xxyx swizzle(glm::X, glm::X, glm::Y, glm::X) #define yxyx swizzle(glm::Y, glm::X, glm::Y, glm::X) #define zxyx swizzle(glm::Z, glm::X, glm::Y, glm::X) #define wxyx swizzle(glm::W, glm::X, glm::Y, glm::X) #define xyyx swizzle(glm::X, glm::Y, glm::Y, glm::X) #define yyyx swizzle(glm::Y, glm::Y, glm::Y, glm::X) #define zyyx swizzle(glm::Z, glm::Y, glm::Y, glm::X) #define wyyx swizzle(glm::W, glm::Y, glm::Y, glm::X) #define xzyx swizzle(glm::X, glm::Z, glm::Y, glm::X) #define yzyx swizzle(glm::Y, glm::Z, glm::Y, glm::X) #define zzyx swizzle(glm::Z, glm::Z, glm::Y, glm::X) #define wzyx swizzle(glm::W, glm::Z, glm::Y, glm::X) #define xwyx swizzle(glm::X, glm::W, glm::Y, glm::X) #define ywyx swizzle(glm::Y, glm::W, glm::Y, glm::X) #define zwyx swizzle(glm::Z, glm::W, glm::Y, glm::X) #define wwyx swizzle(glm::W, glm::W, glm::Y, glm::X) #define xxzx swizzle(glm::X, glm::X, glm::Z, glm::X) #define yxzx swizzle(glm::Y, glm::X, glm::Z, glm::X) #define zxzx swizzle(glm::Z, glm::X, glm::Z, glm::X) #define wxzx swizzle(glm::W, glm::X, glm::Z, glm::X) #define xyzx swizzle(glm::X, glm::Y, glm::Z, glm::X) #define yyzx swizzle(glm::Y, glm::Y, glm::Z, glm::X) #define zyzx swizzle(glm::Z, glm::Y, glm::Z, glm::X) #define wyzx swizzle(glm::W, glm::Y, glm::Z, glm::X) #define xzzx swizzle(glm::X, glm::Z, glm::Z, glm::X) #define yzzx swizzle(glm::Y, glm::Z, glm::Z, glm::X) #define zzzx swizzle(glm::Z, glm::Z, glm::Z, glm::X) #define wzzx swizzle(glm::W, glm::Z, glm::Z, glm::X) #define xwzx swizzle(glm::X, glm::W, glm::Z, glm::X) #define ywzx swizzle(glm::Y, glm::W, glm::Z, glm::X) #define zwzx swizzle(glm::Z, glm::W, glm::Z, glm::X) #define wwzx swizzle(glm::W, glm::W, glm::Z, glm::X) #define xxwx swizzle(glm::X, glm::X, glm::W, glm::X) #define yxwx swizzle(glm::Y, glm::X, glm::W, glm::X) #define zxwx swizzle(glm::Z, glm::X, glm::W, glm::X) #define wxwx swizzle(glm::W, glm::X, glm::W, glm::X) #define xywx swizzle(glm::X, glm::Y, glm::W, glm::X) #define yywx swizzle(glm::Y, glm::Y, glm::W, glm::X) #define zywx swizzle(glm::Z, glm::Y, glm::W, glm::X) #define wywx swizzle(glm::W, glm::Y, glm::W, glm::X) #define xzwx swizzle(glm::X, glm::Z, glm::W, glm::X) #define yzwx swizzle(glm::Y, glm::Z, glm::W, glm::X) #define zzwx swizzle(glm::Z, glm::Z, glm::W, glm::X) #define wzwx swizzle(glm::W, glm::Z, glm::W, glm::X) #define xwwx swizzle(glm::X, glm::W, glm::W, glm::X) #define ywwx swizzle(glm::Y, glm::W, glm::W, glm::X) #define zwwx swizzle(glm::Z, glm::W, glm::W, glm::X) #define wwwx swizzle(glm::W, glm::W, glm::W, glm::X) #define xxxy swizzle(glm::X, glm::X, glm::X, glm::Y) #define yxxy swizzle(glm::Y, glm::X, glm::X, glm::Y) #define zxxy swizzle(glm::Z, glm::X, glm::X, glm::Y) #define wxxy swizzle(glm::W, glm::X, glm::X, glm::Y) #define xyxy swizzle(glm::X, glm::Y, glm::X, glm::Y) #define yyxy swizzle(glm::Y, glm::Y, glm::X, glm::Y) #define zyxy swizzle(glm::Z, glm::Y, glm::X, glm::Y) #define wyxy swizzle(glm::W, glm::Y, glm::X, glm::Y) #define xzxy swizzle(glm::X, glm::Z, glm::X, glm::Y) #define yzxy swizzle(glm::Y, glm::Z, glm::X, glm::Y) #define zzxy swizzle(glm::Z, glm::Z, glm::X, glm::Y) #define wzxy swizzle(glm::W, glm::Z, glm::X, glm::Y) #define xwxy swizzle(glm::X, glm::W, glm::X, glm::Y) #define ywxy swizzle(glm::Y, glm::W, glm::X, glm::Y) #define zwxy swizzle(glm::Z, glm::W, glm::X, glm::Y) #define wwxy swizzle(glm::W, glm::W, glm::X, glm::Y) #define xxyy swizzle(glm::X, glm::X, glm::Y, glm::Y) #define yxyy swizzle(glm::Y, glm::X, glm::Y, glm::Y) #define zxyy swizzle(glm::Z, glm::X, glm::Y, glm::Y) #define wxyy swizzle(glm::W, glm::X, glm::Y, glm::Y) #define xyyy swizzle(glm::X, glm::Y, glm::Y, glm::Y) #define yyyy swizzle(glm::Y, glm::Y, glm::Y, glm::Y) #define zyyy swizzle(glm::Z, glm::Y, glm::Y, glm::Y) #define wyyy swizzle(glm::W, glm::Y, glm::Y, glm::Y) #define xzyy swizzle(glm::X, glm::Z, glm::Y, glm::Y) #define yzyy swizzle(glm::Y, glm::Z, glm::Y, glm::Y) #define zzyy swizzle(glm::Z, glm::Z, glm::Y, glm::Y) #define wzyy swizzle(glm::W, glm::Z, glm::Y, glm::Y) #define xwyy swizzle(glm::X, glm::W, glm::Y, glm::Y) #define ywyy swizzle(glm::Y, glm::W, glm::Y, glm::Y) #define zwyy swizzle(glm::Z, glm::W, glm::Y, glm::Y) #define wwyy swizzle(glm::W, glm::W, glm::Y, glm::Y) #define xxzy swizzle(glm::X, glm::X, glm::Z, glm::Y) #define yxzy swizzle(glm::Y, glm::X, glm::Z, glm::Y) #define zxzy swizzle(glm::Z, glm::X, glm::Z, glm::Y) #define wxzy swizzle(glm::W, glm::X, glm::Z, glm::Y) #define xyzy swizzle(glm::X, glm::Y, glm::Z, glm::Y) #define yyzy swizzle(glm::Y, glm::Y, glm::Z, glm::Y) #define zyzy swizzle(glm::Z, glm::Y, glm::Z, glm::Y) #define wyzy swizzle(glm::W, glm::Y, glm::Z, glm::Y) #define xzzy swizzle(glm::X, glm::Z, glm::Z, glm::Y) #define yzzy swizzle(glm::Y, glm::Z, glm::Z, glm::Y) #define zzzy swizzle(glm::Z, glm::Z, glm::Z, glm::Y) #define wzzy swizzle(glm::W, glm::Z, glm::Z, glm::Y) #define xwzy swizzle(glm::X, glm::W, glm::Z, glm::Y) #define ywzy swizzle(glm::Y, glm::W, glm::Z, glm::Y) #define zwzy swizzle(glm::Z, glm::W, glm::Z, glm::Y) #define wwzy swizzle(glm::W, glm::W, glm::Z, glm::Y) #define xxwy swizzle(glm::X, glm::X, glm::W, glm::Y) #define yxwy swizzle(glm::Y, glm::X, glm::W, glm::Y) #define zxwy swizzle(glm::Z, glm::X, glm::W, glm::Y) #define wxwy swizzle(glm::W, glm::X, glm::W, glm::Y) #define xywy swizzle(glm::X, glm::Y, glm::W, glm::Y) #define yywy swizzle(glm::Y, glm::Y, glm::W, glm::Y) #define zywy swizzle(glm::Z, glm::Y, glm::W, glm::Y) #define wywy swizzle(glm::W, glm::Y, glm::W, glm::Y) #define xzwy swizzle(glm::X, glm::Z, glm::W, glm::Y) #define yzwy swizzle(glm::Y, glm::Z, glm::W, glm::Y) #define zzwy swizzle(glm::Z, glm::Z, glm::W, glm::Y) #define wzwy swizzle(glm::W, glm::Z, glm::W, glm::Y) #define xwwy swizzle(glm::X, glm::W, glm::W, glm::Y) #define ywwy swizzle(glm::Y, glm::W, glm::W, glm::Y) #define zwwy swizzle(glm::Z, glm::W, glm::W, glm::Y) #define wwwy swizzle(glm::W, glm::W, glm::W, glm::Y) #define xxxz swizzle(glm::X, glm::X, glm::X, glm::Z) #define yxxz swizzle(glm::Y, glm::X, glm::X, glm::Z) #define zxxz swizzle(glm::Z, glm::X, glm::X, glm::Z) #define wxxz swizzle(glm::W, glm::X, glm::X, glm::Z) #define xyxz swizzle(glm::X, glm::Y, glm::X, glm::Z) #define yyxz swizzle(glm::Y, glm::Y, glm::X, glm::Z) #define zyxz swizzle(glm::Z, glm::Y, glm::X, glm::Z) #define wyxz swizzle(glm::W, glm::Y, glm::X, glm::Z) #define xzxz swizzle(glm::X, glm::Z, glm::X, glm::Z) #define yzxz swizzle(glm::Y, glm::Z, glm::X, glm::Z) #define zzxz swizzle(glm::Z, glm::Z, glm::X, glm::Z) #define wzxz swizzle(glm::W, glm::Z, glm::X, glm::Z) #define xwxz swizzle(glm::X, glm::W, glm::X, glm::Z) #define ywxz swizzle(glm::Y, glm::W, glm::X, glm::Z) #define zwxz swizzle(glm::Z, glm::W, glm::X, glm::Z) #define wwxz swizzle(glm::W, glm::W, glm::X, glm::Z) #define xxyz swizzle(glm::X, glm::X, glm::Y, glm::Z) #define yxyz swizzle(glm::Y, glm::X, glm::Y, glm::Z) #define zxyz swizzle(glm::Z, glm::X, glm::Y, glm::Z) #define wxyz swizzle(glm::W, glm::X, glm::Y, glm::Z) #define xyyz swizzle(glm::X, glm::Y, glm::Y, glm::Z) #define yyyz swizzle(glm::Y, glm::Y, glm::Y, glm::Z) #define zyyz swizzle(glm::Z, glm::Y, glm::Y, glm::Z) #define wyyz swizzle(glm::W, glm::Y, glm::Y, glm::Z) #define xzyz swizzle(glm::X, glm::Z, glm::Y, glm::Z) #define yzyz swizzle(glm::Y, glm::Z, glm::Y, glm::Z) #define zzyz swizzle(glm::Z, glm::Z, glm::Y, glm::Z) #define wzyz swizzle(glm::W, glm::Z, glm::Y, glm::Z) #define xwyz swizzle(glm::X, glm::W, glm::Y, glm::Z) #define ywyz swizzle(glm::Y, glm::W, glm::Y, glm::Z) #define zwyz swizzle(glm::Z, glm::W, glm::Y, glm::Z) #define wwyz swizzle(glm::W, glm::W, glm::Y, glm::Z) #define xxzz swizzle(glm::X, glm::X, glm::Z, glm::Z) #define yxzz swizzle(glm::Y, glm::X, glm::Z, glm::Z) #define zxzz swizzle(glm::Z, glm::X, glm::Z, glm::Z) #define wxzz swizzle(glm::W, glm::X, glm::Z, glm::Z) #define xyzz swizzle(glm::X, glm::Y, glm::Z, glm::Z) #define yyzz swizzle(glm::Y, glm::Y, glm::Z, glm::Z) #define zyzz swizzle(glm::Z, glm::Y, glm::Z, glm::Z) #define wyzz swizzle(glm::W, glm::Y, glm::Z, glm::Z) #define xzzz swizzle(glm::X, glm::Z, glm::Z, glm::Z) #define yzzz swizzle(glm::Y, glm::Z, glm::Z, glm::Z) #define zzzz swizzle(glm::Z, glm::Z, glm::Z, glm::Z) #define wzzz swizzle(glm::W, glm::Z, glm::Z, glm::Z) #define xwzz swizzle(glm::X, glm::W, glm::Z, glm::Z) #define ywzz swizzle(glm::Y, glm::W, glm::Z, glm::Z) #define zwzz swizzle(glm::Z, glm::W, glm::Z, glm::Z) #define wwzz swizzle(glm::W, glm::W, glm::Z, glm::Z) #define xxwz swizzle(glm::X, glm::X, glm::W, glm::Z) #define yxwz swizzle(glm::Y, glm::X, glm::W, glm::Z) #define zxwz swizzle(glm::Z, glm::X, glm::W, glm::Z) #define wxwz swizzle(glm::W, glm::X, glm::W, glm::Z) #define xywz swizzle(glm::X, glm::Y, glm::W, glm::Z) #define yywz swizzle(glm::Y, glm::Y, glm::W, glm::Z) #define zywz swizzle(glm::Z, glm::Y, glm::W, glm::Z) #define wywz swizzle(glm::W, glm::Y, glm::W, glm::Z) #define xzwz swizzle(glm::X, glm::Z, glm::W, glm::Z) #define yzwz swizzle(glm::Y, glm::Z, glm::W, glm::Z) #define zzwz swizzle(glm::Z, glm::Z, glm::W, glm::Z) #define wzwz swizzle(glm::W, glm::Z, glm::W, glm::Z) #define xwwz swizzle(glm::X, glm::W, glm::W, glm::Z) #define ywwz swizzle(glm::Y, glm::W, glm::W, glm::Z) #define zwwz swizzle(glm::Z, glm::W, glm::W, glm::Z) #define wwwz swizzle(glm::W, glm::W, glm::W, glm::Z) #define xxxw swizzle(glm::X, glm::X, glm::X, glm::W) #define yxxw swizzle(glm::Y, glm::X, glm::X, glm::W) #define zxxw swizzle(glm::Z, glm::X, glm::X, glm::W) #define wxxw swizzle(glm::W, glm::X, glm::X, glm::W) #define xyxw swizzle(glm::X, glm::Y, glm::X, glm::W) #define yyxw swizzle(glm::Y, glm::Y, glm::X, glm::W) #define zyxw swizzle(glm::Z, glm::Y, glm::X, glm::W) #define wyxw swizzle(glm::W, glm::Y, glm::X, glm::W) #define xzxw swizzle(glm::X, glm::Z, glm::X, glm::W) #define yzxw swizzle(glm::Y, glm::Z, glm::X, glm::W) #define zzxw swizzle(glm::Z, glm::Z, glm::X, glm::W) #define wzxw swizzle(glm::W, glm::Z, glm::X, glm::W) #define xwxw swizzle(glm::X, glm::W, glm::X, glm::W) #define ywxw swizzle(glm::Y, glm::W, glm::X, glm::W) #define zwxw swizzle(glm::Z, glm::W, glm::X, glm::W) #define wwxw swizzle(glm::W, glm::W, glm::X, glm::W) #define xxyw swizzle(glm::X, glm::X, glm::Y, glm::W) #define yxyw swizzle(glm::Y, glm::X, glm::Y, glm::W) #define zxyw swizzle(glm::Z, glm::X, glm::Y, glm::W) #define wxyw swizzle(glm::W, glm::X, glm::Y, glm::W) #define xyyw swizzle(glm::X, glm::Y, glm::Y, glm::W) #define yyyw swizzle(glm::Y, glm::Y, glm::Y, glm::W) #define zyyw swizzle(glm::Z, glm::Y, glm::Y, glm::W) #define wyyw swizzle(glm::W, glm::Y, glm::Y, glm::W) #define xzyw swizzle(glm::X, glm::Z, glm::Y, glm::W) #define yzyw swizzle(glm::Y, glm::Z, glm::Y, glm::W) #define zzyw swizzle(glm::Z, glm::Z, glm::Y, glm::W) #define wzyw swizzle(glm::W, glm::Z, glm::Y, glm::W) #define xwyw swizzle(glm::X, glm::W, glm::Y, glm::W) #define ywyw swizzle(glm::Y, glm::W, glm::Y, glm::W) #define zwyw swizzle(glm::Z, glm::W, glm::Y, glm::W) #define wwyw swizzle(glm::W, glm::W, glm::Y, glm::W) #define xxzw swizzle(glm::X, glm::X, glm::Z, glm::W) #define yxzw swizzle(glm::Y, glm::X, glm::Z, glm::W) #define zxzw swizzle(glm::Z, glm::X, glm::Z, glm::W) #define wxzw swizzle(glm::W, glm::X, glm::Z, glm::W) #define xyzw swizzle(glm::X, glm::Y, glm::Z, glm::W) #define yyzw swizzle(glm::Y, glm::Y, glm::Z, glm::W) #define zyzw swizzle(glm::Z, glm::Y, glm::Z, glm::W) #define wyzw swizzle(glm::W, glm::Y, glm::Z, glm::W) #define xzzw swizzle(glm::X, glm::Z, glm::Z, glm::W) #define yzzw swizzle(glm::Y, glm::Z, glm::Z, glm::W) #define zzzw swizzle(glm::Z, glm::Z, glm::Z, glm::W) #define wzzw swizzle(glm::W, glm::Z, glm::Z, glm::W) #define xwzw swizzle(glm::X, glm::W, glm::Z, glm::W) #define ywzw swizzle(glm::Y, glm::W, glm::Z, glm::W) #define zwzw swizzle(glm::Z, glm::W, glm::Z, glm::W) #define wwzw swizzle(glm::W, glm::W, glm::Z, glm::W) #define xxww swizzle(glm::X, glm::X, glm::W, glm::W) #define yxww swizzle(glm::Y, glm::X, glm::W, glm::W) #define zxww swizzle(glm::Z, glm::X, glm::W, glm::W) #define wxww swizzle(glm::W, glm::X, glm::W, glm::W) #define xyww swizzle(glm::X, glm::Y, glm::W, glm::W) #define yyww swizzle(glm::Y, glm::Y, glm::W, glm::W) #define zyww swizzle(glm::Z, glm::Y, glm::W, glm::W) #define wyww swizzle(glm::W, glm::Y, glm::W, glm::W) #define xzww swizzle(glm::X, glm::Z, glm::W, glm::W) #define yzww swizzle(glm::Y, glm::Z, glm::W, glm::W) #define zzww swizzle(glm::Z, glm::Z, glm::W, glm::W) #define wzww swizzle(glm::W, glm::Z, glm::W, glm::W) #define xwww swizzle(glm::X, glm::W, glm::W, glm::W) #define ywww swizzle(glm::Y, glm::W, glm::W, glm::W) #define zwww swizzle(glm::Z, glm::W, glm::W, glm::W) #define wwww swizzle(glm::W, glm::W, glm::W, glm::W) #endif #if(defined(GLM_SWIZZLE_RGBA) || defined(GLM_SWIZZLE)) #define rrrr swizzle(glm::X, glm::X, glm::X, glm::X) #define grrr swizzle(glm::Y, glm::X, glm::X, glm::X) #define brrr swizzle(glm::Z, glm::X, glm::X, glm::X) #define arrr swizzle(glm::W, glm::X, glm::X, glm::X) #define rgrr swizzle(glm::X, glm::Y, glm::X, glm::X) #define ggrr swizzle(glm::Y, glm::Y, glm::X, glm::X) #define bgrr swizzle(glm::Z, glm::Y, glm::X, glm::X) #define agrr swizzle(glm::W, glm::Y, glm::X, glm::X) #define rbrr swizzle(glm::X, glm::Z, glm::X, glm::X) #define gbrr swizzle(glm::Y, glm::Z, glm::X, glm::X) #define bbrr swizzle(glm::Z, glm::Z, glm::X, glm::X) #define abrr swizzle(glm::W, glm::Z, glm::X, glm::X) #define rarr swizzle(glm::X, glm::W, glm::X, glm::X) #define garr swizzle(glm::Y, glm::W, glm::X, glm::X) #define barr swizzle(glm::Z, glm::W, glm::X, glm::X) #define aarr swizzle(glm::W, glm::W, glm::X, glm::X) #define rrgr swizzle(glm::X, glm::X, glm::Y, glm::X) #define grgr swizzle(glm::Y, glm::X, glm::Y, glm::X) #define brgr swizzle(glm::Z, glm::X, glm::Y, glm::X) #define argr swizzle(glm::W, glm::X, glm::Y, glm::X) #define rggr swizzle(glm::X, glm::Y, glm::Y, glm::X) #define gggr swizzle(glm::Y, glm::Y, glm::Y, glm::X) #define bggr swizzle(glm::Z, glm::Y, glm::Y, glm::X) #define aggr swizzle(glm::W, glm::Y, glm::Y, glm::X) #define rbgr swizzle(glm::X, glm::Z, glm::Y, glm::X) #define gbgr swizzle(glm::Y, glm::Z, glm::Y, glm::X) #define bbgr swizzle(glm::Z, glm::Z, glm::Y, glm::X) #define abgr swizzle(glm::W, glm::Z, glm::Y, glm::X) #define ragr swizzle(glm::X, glm::W, glm::Y, glm::X) #define gagr swizzle(glm::Y, glm::W, glm::Y, glm::X) #define bagr swizzle(glm::Z, glm::W, glm::Y, glm::X) #define aagr swizzle(glm::W, glm::W, glm::Y, glm::X) #define rrbr swizzle(glm::X, glm::X, glm::Z, glm::X) #define grbr swizzle(glm::Y, glm::X, glm::Z, glm::X) #define brbr swizzle(glm::Z, glm::X, glm::Z, glm::X) #define arbr swizzle(glm::W, glm::X, glm::Z, glm::X) #define rgbr swizzle(glm::X, glm::Y, glm::Z, glm::X) #define ggbr swizzle(glm::Y, glm::Y, glm::Z, glm::X) #define bgbr swizzle(glm::Z, glm::Y, glm::Z, glm::X) #define agbr swizzle(glm::W, glm::Y, glm::Z, glm::X) #define rbbr swizzle(glm::X, glm::Z, glm::Z, glm::X) #define gbbr swizzle(glm::Y, glm::Z, glm::Z, glm::X) #define bbbr swizzle(glm::Z, glm::Z, glm::Z, glm::X) #define abbr swizzle(glm::W, glm::Z, glm::Z, glm::X) #define rabr swizzle(glm::X, glm::W, glm::Z, glm::X) #define gabr swizzle(glm::Y, glm::W, glm::Z, glm::X) #define babr swizzle(glm::Z, glm::W, glm::Z, glm::X) #define aabr swizzle(glm::W, glm::W, glm::Z, glm::X) #define rrar swizzle(glm::X, glm::X, glm::W, glm::X) #define grar swizzle(glm::Y, glm::X, glm::W, glm::X) #define brar swizzle(glm::Z, glm::X, glm::W, glm::X) #define arar swizzle(glm::W, glm::X, glm::W, glm::X) #define rgar swizzle(glm::X, glm::Y, glm::W, glm::X) #define ggar swizzle(glm::Y, glm::Y, glm::W, glm::X) #define bgar swizzle(glm::Z, glm::Y, glm::W, glm::X) #define agar swizzle(glm::W, glm::Y, glm::W, glm::X) #define rbar swizzle(glm::X, glm::Z, glm::W, glm::X) #define gbar swizzle(glm::Y, glm::Z, glm::W, glm::X) #define bbar swizzle(glm::Z, glm::Z, glm::W, glm::X) #define abar swizzle(glm::W, glm::Z, glm::W, glm::X) #define raar swizzle(glm::X, glm::W, glm::W, glm::X) #define gaar swizzle(glm::Y, glm::W, glm::W, glm::X) #define baar swizzle(glm::Z, glm::W, glm::W, glm::X) #define aaar swizzle(glm::W, glm::W, glm::W, glm::X) #define rrrg swizzle(glm::X, glm::X, glm::X, glm::Y) #define grrg swizzle(glm::Y, glm::X, glm::X, glm::Y) #define brrg swizzle(glm::Z, glm::X, glm::X, glm::Y) #define arrg swizzle(glm::W, glm::X, glm::X, glm::Y) #define rgrg swizzle(glm::X, glm::Y, glm::X, glm::Y) #define ggrg swizzle(glm::Y, glm::Y, glm::X, glm::Y) #define bgrg swizzle(glm::Z, glm::Y, glm::X, glm::Y) #define agrg swizzle(glm::W, glm::Y, glm::X, glm::Y) #define rbrg swizzle(glm::X, glm::Z, glm::X, glm::Y) #define gbrg swizzle(glm::Y, glm::Z, glm::X, glm::Y) #define bbrg swizzle(glm::Z, glm::Z, glm::X, glm::Y) #define abrg swizzle(glm::W, glm::Z, glm::X, glm::Y) #define rarg swizzle(glm::X, glm::W, glm::X, glm::Y) #define garg swizzle(glm::Y, glm::W, glm::X, glm::Y) #define barg swizzle(glm::Z, glm::W, glm::X, glm::Y) #define aarg swizzle(glm::W, glm::W, glm::X, glm::Y) #define rrgg swizzle(glm::X, glm::X, glm::Y, glm::Y) #define grgg swizzle(glm::Y, glm::X, glm::Y, glm::Y) #define brgg swizzle(glm::Z, glm::X, glm::Y, glm::Y) #define argg swizzle(glm::W, glm::X, glm::Y, glm::Y) #define rggg swizzle(glm::X, glm::Y, glm::Y, glm::Y) #define gggg swizzle(glm::Y, glm::Y, glm::Y, glm::Y) #define bggg swizzle(glm::Z, glm::Y, glm::Y, glm::Y) #define aggg swizzle(glm::W, glm::Y, glm::Y, glm::Y) #define rbgg swizzle(glm::X, glm::Z, glm::Y, glm::Y) #define gbgg swizzle(glm::Y, glm::Z, glm::Y, glm::Y) #define bbgg swizzle(glm::Z, glm::Z, glm::Y, glm::Y) #define abgg swizzle(glm::W, glm::Z, glm::Y, glm::Y) #define ragg swizzle(glm::X, glm::W, glm::Y, glm::Y) #define gagg swizzle(glm::Y, glm::W, glm::Y, glm::Y) #define bagg swizzle(glm::Z, glm::W, glm::Y, glm::Y) #define aagg swizzle(glm::W, glm::W, glm::Y, glm::Y) #define rrbg swizzle(glm::X, glm::X, glm::Z, glm::Y) #define grbg swizzle(glm::Y, glm::X, glm::Z, glm::Y) #define brbg swizzle(glm::Z, glm::X, glm::Z, glm::Y) #define arbg swizzle(glm::W, glm::X, glm::Z, glm::Y) #define rgbg swizzle(glm::X, glm::Y, glm::Z, glm::Y) #define ggbg swizzle(glm::Y, glm::Y, glm::Z, glm::Y) #define bgbg swizzle(glm::Z, glm::Y, glm::Z, glm::Y) #define agbg swizzle(glm::W, glm::Y, glm::Z, glm::Y) #define rbbg swizzle(glm::X, glm::Z, glm::Z, glm::Y) #define gbbg swizzle(glm::Y, glm::Z, glm::Z, glm::Y) #define bbbg swizzle(glm::Z, glm::Z, glm::Z, glm::Y) #define abbg swizzle(glm::W, glm::Z, glm::Z, glm::Y) #define rabg swizzle(glm::X, glm::W, glm::Z, glm::Y) #define gabg swizzle(glm::Y, glm::W, glm::Z, glm::Y) #define babg swizzle(glm::Z, glm::W, glm::Z, glm::Y) #define aabg swizzle(glm::W, glm::W, glm::Z, glm::Y) #define rrag swizzle(glm::X, glm::X, glm::W, glm::Y) #define grag swizzle(glm::Y, glm::X, glm::W, glm::Y) #define brag swizzle(glm::Z, glm::X, glm::W, glm::Y) #define arag swizzle(glm::W, glm::X, glm::W, glm::Y) #define rgag swizzle(glm::X, glm::Y, glm::W, glm::Y) #define ggag swizzle(glm::Y, glm::Y, glm::W, glm::Y) #define bgag swizzle(glm::Z, glm::Y, glm::W, glm::Y) #define agag swizzle(glm::W, glm::Y, glm::W, glm::Y) #define rbag swizzle(glm::X, glm::Z, glm::W, glm::Y) #define gbag swizzle(glm::Y, glm::Z, glm::W, glm::Y) #define bbag swizzle(glm::Z, glm::Z, glm::W, glm::Y) #define abag swizzle(glm::W, glm::Z, glm::W, glm::Y) #define raag swizzle(glm::X, glm::W, glm::W, glm::Y) #define gaag swizzle(glm::Y, glm::W, glm::W, glm::Y) #define baag swizzle(glm::Z, glm::W, glm::W, glm::Y) #define aaag swizzle(glm::W, glm::W, glm::W, glm::Y) #define rrrb swizzle(glm::X, glm::X, glm::X, glm::Z) #define grrb swizzle(glm::Y, glm::X, glm::X, glm::Z) #define brrb swizzle(glm::Z, glm::X, glm::X, glm::Z) #define arrb swizzle(glm::W, glm::X, glm::X, glm::Z) #define rgrb swizzle(glm::X, glm::Y, glm::X, glm::Z) #define ggrb swizzle(glm::Y, glm::Y, glm::X, glm::Z) #define bgrb swizzle(glm::Z, glm::Y, glm::X, glm::Z) #define agrb swizzle(glm::W, glm::Y, glm::X, glm::Z) #define rbrb swizzle(glm::X, glm::Z, glm::X, glm::Z) #define gbrb swizzle(glm::Y, glm::Z, glm::X, glm::Z) #define bbrb swizzle(glm::Z, glm::Z, glm::X, glm::Z) #define abrb swizzle(glm::W, glm::Z, glm::X, glm::Z) #define rarb swizzle(glm::X, glm::W, glm::X, glm::Z) #define garb swizzle(glm::Y, glm::W, glm::X, glm::Z) #define barb swizzle(glm::Z, glm::W, glm::X, glm::Z) #define aarb swizzle(glm::W, glm::W, glm::X, glm::Z) #define rrgb swizzle(glm::X, glm::X, glm::Y, glm::Z) #define grgb swizzle(glm::Y, glm::X, glm::Y, glm::Z) #define brgb swizzle(glm::Z, glm::X, glm::Y, glm::Z) #define argb swizzle(glm::W, glm::X, glm::Y, glm::Z) #define rggb swizzle(glm::X, glm::Y, glm::Y, glm::Z) #define gggb swizzle(glm::Y, glm::Y, glm::Y, glm::Z) #define bggb swizzle(glm::Z, glm::Y, glm::Y, glm::Z) #define aggb swizzle(glm::W, glm::Y, glm::Y, glm::Z) #define rbgb swizzle(glm::X, glm::Z, glm::Y, glm::Z) #define gbgb swizzle(glm::Y, glm::Z, glm::Y, glm::Z) #define bbgb swizzle(glm::Z, glm::Z, glm::Y, glm::Z) #define abgb swizzle(glm::W, glm::Z, glm::Y, glm::Z) #define ragb swizzle(glm::X, glm::W, glm::Y, glm::Z) #define gagb swizzle(glm::Y, glm::W, glm::Y, glm::Z) #define bagb swizzle(glm::Z, glm::W, glm::Y, glm::Z) #define aagb swizzle(glm::W, glm::W, glm::Y, glm::Z) #define rrbb swizzle(glm::X, glm::X, glm::Z, glm::Z) #define grbb swizzle(glm::Y, glm::X, glm::Z, glm::Z) #define brbb swizzle(glm::Z, glm::X, glm::Z, glm::Z) #define arbb swizzle(glm::W, glm::X, glm::Z, glm::Z) #define rgbb swizzle(glm::X, glm::Y, glm::Z, glm::Z) #define ggbb swizzle(glm::Y, glm::Y, glm::Z, glm::Z) #define bgbb swizzle(glm::Z, glm::Y, glm::Z, glm::Z) #define agbb swizzle(glm::W, glm::Y, glm::Z, glm::Z) #define rbbb swizzle(glm::X, glm::Z, glm::Z, glm::Z) #define gbbb swizzle(glm::Y, glm::Z, glm::Z, glm::Z) #define bbbb swizzle(glm::Z, glm::Z, glm::Z, glm::Z) #define abbb swizzle(glm::W, glm::Z, glm::Z, glm::Z) #define rabb swizzle(glm::X, glm::W, glm::Z, glm::Z) #define gabb swizzle(glm::Y, glm::W, glm::Z, glm::Z) #define babb swizzle(glm::Z, glm::W, glm::Z, glm::Z) #define aabb swizzle(glm::W, glm::W, glm::Z, glm::Z) #define rrab swizzle(glm::X, glm::X, glm::W, glm::Z) #define grab swizzle(glm::Y, glm::X, glm::W, glm::Z) #define brab swizzle(glm::Z, glm::X, glm::W, glm::Z) #define arab swizzle(glm::W, glm::X, glm::W, glm::Z) #define rgab swizzle(glm::X, glm::Y, glm::W, glm::Z) #define ggab swizzle(glm::Y, glm::Y, glm::W, glm::Z) #define bgab swizzle(glm::Z, glm::Y, glm::W, glm::Z) #define agab swizzle(glm::W, glm::Y, glm::W, glm::Z) #define rbab swizzle(glm::X, glm::Z, glm::W, glm::Z) #define gbab swizzle(glm::Y, glm::Z, glm::W, glm::Z) #define bbab swizzle(glm::Z, glm::Z, glm::W, glm::Z) #define abab swizzle(glm::W, glm::Z, glm::W, glm::Z) #define raab swizzle(glm::X, glm::W, glm::W, glm::Z) #define gaab swizzle(glm::Y, glm::W, glm::W, glm::Z) #define baab swizzle(glm::Z, glm::W, glm::W, glm::Z) #define aaab swizzle(glm::W, glm::W, glm::W, glm::Z) #define rrra swizzle(glm::X, glm::X, glm::X, glm::W) #define grra swizzle(glm::Y, glm::X, glm::X, glm::W) #define brra swizzle(glm::Z, glm::X, glm::X, glm::W) #define arra swizzle(glm::W, glm::X, glm::X, glm::W) #define rgra swizzle(glm::X, glm::Y, glm::X, glm::W) #define ggra swizzle(glm::Y, glm::Y, glm::X, glm::W) #define bgra swizzle(glm::Z, glm::Y, glm::X, glm::W) #define agra swizzle(glm::W, glm::Y, glm::X, glm::W) #define rbra swizzle(glm::X, glm::Z, glm::X, glm::W) #define gbra swizzle(glm::Y, glm::Z, glm::X, glm::W) #define bbra swizzle(glm::Z, glm::Z, glm::X, glm::W) #define abra swizzle(glm::W, glm::Z, glm::X, glm::W) #define rara swizzle(glm::X, glm::W, glm::X, glm::W) #define gara swizzle(glm::Y, glm::W, glm::X, glm::W) #define bara swizzle(glm::Z, glm::W, glm::X, glm::W) #define aara swizzle(glm::W, glm::W, glm::X, glm::W) #define rrga swizzle(glm::X, glm::X, glm::Y, glm::W) #define grga swizzle(glm::Y, glm::X, glm::Y, glm::W) #define brga swizzle(glm::Z, glm::X, glm::Y, glm::W) #define arga swizzle(glm::W, glm::X, glm::Y, glm::W) #define rgga swizzle(glm::X, glm::Y, glm::Y, glm::W) #define ggga swizzle(glm::Y, glm::Y, glm::Y, glm::W) #define bgga swizzle(glm::Z, glm::Y, glm::Y, glm::W) #define agga swizzle(glm::W, glm::Y, glm::Y, glm::W) #define rbga swizzle(glm::X, glm::Z, glm::Y, glm::W) #define gbga swizzle(glm::Y, glm::Z, glm::Y, glm::W) #define bbga swizzle(glm::Z, glm::Z, glm::Y, glm::W) #define abga swizzle(glm::W, glm::Z, glm::Y, glm::W) #define raga swizzle(glm::X, glm::W, glm::Y, glm::W) #define gaga swizzle(glm::Y, glm::W, glm::Y, glm::W) #define baga swizzle(glm::Z, glm::W, glm::Y, glm::W) #define aaga swizzle(glm::W, glm::W, glm::Y, glm::W) #define rrba swizzle(glm::X, glm::X, glm::Z, glm::W) #define grba swizzle(glm::Y, glm::X, glm::Z, glm::W) #define brba swizzle(glm::Z, glm::X, glm::Z, glm::W) #define arba swizzle(glm::W, glm::X, glm::Z, glm::W) #define rgba swizzle(glm::X, glm::Y, glm::Z, glm::W) #define ggba swizzle(glm::Y, glm::Y, glm::Z, glm::W) #define bgba swizzle(glm::Z, glm::Y, glm::Z, glm::W) #define agba swizzle(glm::W, glm::Y, glm::Z, glm::W) #define rbba swizzle(glm::X, glm::Z, glm::Z, glm::W) #define gbba swizzle(glm::Y, glm::Z, glm::Z, glm::W) #define bbba swizzle(glm::Z, glm::Z, glm::Z, glm::W) #define abba swizzle(glm::W, glm::Z, glm::Z, glm::W) #define raba swizzle(glm::X, glm::W, glm::Z, glm::W) #define gaba swizzle(glm::Y, glm::W, glm::Z, glm::W) #define baba swizzle(glm::Z, glm::W, glm::Z, glm::W) #define aaba swizzle(glm::W, glm::W, glm::Z, glm::W) #define rraa swizzle(glm::X, glm::X, glm::W, glm::W) #define graa swizzle(glm::Y, glm::X, glm::W, glm::W) #define braa swizzle(glm::Z, glm::X, glm::W, glm::W) #define araa swizzle(glm::W, glm::X, glm::W, glm::W) #define rgaa swizzle(glm::X, glm::Y, glm::W, glm::W) #define ggaa swizzle(glm::Y, glm::Y, glm::W, glm::W) #define bgaa swizzle(glm::Z, glm::Y, glm::W, glm::W) #define agaa swizzle(glm::W, glm::Y, glm::W, glm::W) #define rbaa swizzle(glm::X, glm::Z, glm::W, glm::W) #define gbaa swizzle(glm::Y, glm::Z, glm::W, glm::W) #define bbaa swizzle(glm::Z, glm::Z, glm::W, glm::W) #define abaa swizzle(glm::W, glm::Z, glm::W, glm::W) #define raaa swizzle(glm::X, glm::W, glm::W, glm::W) #define gaaa swizzle(glm::Y, glm::W, glm::W, glm::W) #define baaa swizzle(glm::Z, glm::W, glm::W, glm::W) #define aaaa swizzle(glm::W, glm::W, glm::W, glm::W) #endif #if(defined(GLM_FORCE_SWIZZLE_STPQ) || defined(GLM_SWIZZLE)) #define ssss swizzle(glm::X, glm::X, glm::X, glm::X) #define tsss swizzle(glm::Y, glm::X, glm::X, glm::X) #define psss swizzle(glm::Z, glm::X, glm::X, glm::X) #define qsss swizzle(glm::W, glm::X, glm::X, glm::X) #define stss swizzle(glm::X, glm::Y, glm::X, glm::X) #define ttss swizzle(glm::Y, glm::Y, glm::X, glm::X) #define ptss swizzle(glm::Z, glm::Y, glm::X, glm::X) #define qtss swizzle(glm::W, glm::Y, glm::X, glm::X) #define spss swizzle(glm::X, glm::Z, glm::X, glm::X) #define tpss swizzle(glm::Y, glm::Z, glm::X, glm::X) #define ppss swizzle(glm::Z, glm::Z, glm::X, glm::X) #define qpss swizzle(glm::W, glm::Z, glm::X, glm::X) #define sqss swizzle(glm::X, glm::W, glm::X, glm::X) #define tqss swizzle(glm::Y, glm::W, glm::X, glm::X) #define pqss swizzle(glm::Z, glm::W, glm::X, glm::X) #define qqss swizzle(glm::W, glm::W, glm::X, glm::X) #define ssts swizzle(glm::X, glm::X, glm::Y, glm::X) #define tsts swizzle(glm::Y, glm::X, glm::Y, glm::X) #define psts swizzle(glm::Z, glm::X, glm::Y, glm::X) #define qsts swizzle(glm::W, glm::X, glm::Y, glm::X) #define stts swizzle(glm::X, glm::Y, glm::Y, glm::X) #define ttts swizzle(glm::Y, glm::Y, glm::Y, glm::X) #define ptts swizzle(glm::Z, glm::Y, glm::Y, glm::X) #define qtts swizzle(glm::W, glm::Y, glm::Y, glm::X) #define spts swizzle(glm::X, glm::Z, glm::Y, glm::X) #define tpts swizzle(glm::Y, glm::Z, glm::Y, glm::X) #define ppts swizzle(glm::Z, glm::Z, glm::Y, glm::X) #define qpts swizzle(glm::W, glm::Z, glm::Y, glm::X) #define sqts swizzle(glm::X, glm::W, glm::Y, glm::X) #define tqts swizzle(glm::Y, glm::W, glm::Y, glm::X) #define pqts swizzle(glm::Z, glm::W, glm::Y, glm::X) #define qqts swizzle(glm::W, glm::W, glm::Y, glm::X) #define ssps swizzle(glm::X, glm::X, glm::Z, glm::X) #define tsps swizzle(glm::Y, glm::X, glm::Z, glm::X) #define psps swizzle(glm::Z, glm::X, glm::Z, glm::X) #define qsps swizzle(glm::W, glm::X, glm::Z, glm::X) #define stps swizzle(glm::X, glm::Y, glm::Z, glm::X) #define ttps swizzle(glm::Y, glm::Y, glm::Z, glm::X) #define ptps swizzle(glm::Z, glm::Y, glm::Z, glm::X) #define qtps swizzle(glm::W, glm::Y, glm::Z, glm::X) #define spps swizzle(glm::X, glm::Z, glm::Z, glm::X) #define tpps swizzle(glm::Y, glm::Z, glm::Z, glm::X) #define ppps swizzle(glm::Z, glm::Z, glm::Z, glm::X) #define qpps swizzle(glm::W, glm::Z, glm::Z, glm::X) #define sqps swizzle(glm::X, glm::W, glm::Z, glm::X) #define tqps swizzle(glm::Y, glm::W, glm::Z, glm::X) #define pqps swizzle(glm::Z, glm::W, glm::Z, glm::X) #define qqps swizzle(glm::W, glm::W, glm::Z, glm::X) #define ssqs swizzle(glm::X, glm::X, glm::W, glm::X) #define tsqs swizzle(glm::Y, glm::X, glm::W, glm::X) #define psqs swizzle(glm::Z, glm::X, glm::W, glm::X) #define qsqs swizzle(glm::W, glm::X, glm::W, glm::X) #define stqs swizzle(glm::X, glm::Y, glm::W, glm::X) #define ttqs swizzle(glm::Y, glm::Y, glm::W, glm::X) #define ptqs swizzle(glm::Z, glm::Y, glm::W, glm::X) #define qtqs swizzle(glm::W, glm::Y, glm::W, glm::X) #define spqs swizzle(glm::X, glm::Z, glm::W, glm::X) #define tpqs swizzle(glm::Y, glm::Z, glm::W, glm::X) #define ppqs swizzle(glm::Z, glm::Z, glm::W, glm::X) #define qpqs swizzle(glm::W, glm::Z, glm::W, glm::X) #define sqqs swizzle(glm::X, glm::W, glm::W, glm::X) #define tqqs swizzle(glm::Y, glm::W, glm::W, glm::X) #define pqqs swizzle(glm::Z, glm::W, glm::W, glm::X) #define qqqs swizzle(glm::W, glm::W, glm::W, glm::X) #define ssst swizzle(glm::X, glm::X, glm::X, glm::Y) #define tsst swizzle(glm::Y, glm::X, glm::X, glm::Y) #define psst swizzle(glm::Z, glm::X, glm::X, glm::Y) #define qsst swizzle(glm::W, glm::X, glm::X, glm::Y) #define stst swizzle(glm::X, glm::Y, glm::X, glm::Y) #define ttst swizzle(glm::Y, glm::Y, glm::X, glm::Y) #define ptst swizzle(glm::Z, glm::Y, glm::X, glm::Y) #define qtst swizzle(glm::W, glm::Y, glm::X, glm::Y) #define spst swizzle(glm::X, glm::Z, glm::X, glm::Y) #define tpst swizzle(glm::Y, glm::Z, glm::X, glm::Y) #define ppst swizzle(glm::Z, glm::Z, glm::X, glm::Y) #define qpst swizzle(glm::W, glm::Z, glm::X, glm::Y) #define sqst swizzle(glm::X, glm::W, glm::X, glm::Y) #define tqst swizzle(glm::Y, glm::W, glm::X, glm::Y) #define pqst swizzle(glm::Z, glm::W, glm::X, glm::Y) #define qqst swizzle(glm::W, glm::W, glm::X, glm::Y) #define sstt swizzle(glm::X, glm::X, glm::Y, glm::Y) #define tstt swizzle(glm::Y, glm::X, glm::Y, glm::Y) #define pstt swizzle(glm::Z, glm::X, glm::Y, glm::Y) #define qstt swizzle(glm::W, glm::X, glm::Y, glm::Y) #define sttt swizzle(glm::X, glm::Y, glm::Y, glm::Y) #define tttt swizzle(glm::Y, glm::Y, glm::Y, glm::Y) #define pttt swizzle(glm::Z, glm::Y, glm::Y, glm::Y) #define qttt swizzle(glm::W, glm::Y, glm::Y, glm::Y) #define sptt swizzle(glm::X, glm::Z, glm::Y, glm::Y) #define tptt swizzle(glm::Y, glm::Z, glm::Y, glm::Y) #define pptt swizzle(glm::Z, glm::Z, glm::Y, glm::Y) #define qptt swizzle(glm::W, glm::Z, glm::Y, glm::Y) #define sqtt swizzle(glm::X, glm::W, glm::Y, glm::Y) #define tqtt swizzle(glm::Y, glm::W, glm::Y, glm::Y) #define pqtt swizzle(glm::Z, glm::W, glm::Y, glm::Y) #define qqtt swizzle(glm::W, glm::W, glm::Y, glm::Y) #define sspt swizzle(glm::X, glm::X, glm::Z, glm::Y) #define tspt swizzle(glm::Y, glm::X, glm::Z, glm::Y) #define pspt swizzle(glm::Z, glm::X, glm::Z, glm::Y) #define qspt swizzle(glm::W, glm::X, glm::Z, glm::Y) #define stpt swizzle(glm::X, glm::Y, glm::Z, glm::Y) #define ttpt swizzle(glm::Y, glm::Y, glm::Z, glm::Y) #define ptpt swizzle(glm::Z, glm::Y, glm::Z, glm::Y) #define qtpt swizzle(glm::W, glm::Y, glm::Z, glm::Y) #define sppt swizzle(glm::X, glm::Z, glm::Z, glm::Y) #define tppt swizzle(glm::Y, glm::Z, glm::Z, glm::Y) #define pppt swizzle(glm::Z, glm::Z, glm::Z, glm::Y) #define qppt swizzle(glm::W, glm::Z, glm::Z, glm::Y) #define sqpt swizzle(glm::X, glm::W, glm::Z, glm::Y) #define tqpt swizzle(glm::Y, glm::W, glm::Z, glm::Y) #define pqpt swizzle(glm::Z, glm::W, glm::Z, glm::Y) #define qqpt swizzle(glm::W, glm::W, glm::Z, glm::Y) #define ssqt swizzle(glm::X, glm::X, glm::W, glm::Y) #define tsqt swizzle(glm::Y, glm::X, glm::W, glm::Y) #define psqt swizzle(glm::Z, glm::X, glm::W, glm::Y) #define qsqt swizzle(glm::W, glm::X, glm::W, glm::Y) #define stqt swizzle(glm::X, glm::Y, glm::W, glm::Y) #define ttqt swizzle(glm::Y, glm::Y, glm::W, glm::Y) #define ptqt swizzle(glm::Z, glm::Y, glm::W, glm::Y) #define qtqt swizzle(glm::W, glm::Y, glm::W, glm::Y) #define spqt swizzle(glm::X, glm::Z, glm::W, glm::Y) #define tpqt swizzle(glm::Y, glm::Z, glm::W, glm::Y) #define ppqt swizzle(glm::Z, glm::Z, glm::W, glm::Y) #define qpqt swizzle(glm::W, glm::Z, glm::W, glm::Y) #define sqqt swizzle(glm::X, glm::W, glm::W, glm::Y) #define tqqt swizzle(glm::Y, glm::W, glm::W, glm::Y) #define pqqt swizzle(glm::Z, glm::W, glm::W, glm::Y) #define qqqt swizzle(glm::W, glm::W, glm::W, glm::Y) #define sssp swizzle(glm::X, glm::X, glm::X, glm::Z) #define tssp swizzle(glm::Y, glm::X, glm::X, glm::Z) #define pssp swizzle(glm::Z, glm::X, glm::X, glm::Z) #define qssp swizzle(glm::W, glm::X, glm::X, glm::Z) #define stsp swizzle(glm::X, glm::Y, glm::X, glm::Z) #define ttsp swizzle(glm::Y, glm::Y, glm::X, glm::Z) #define ptsp swizzle(glm::Z, glm::Y, glm::X, glm::Z) #define qtsp swizzle(glm::W, glm::Y, glm::X, glm::Z) #define spsp swizzle(glm::X, glm::Z, glm::X, glm::Z) #define tpsp swizzle(glm::Y, glm::Z, glm::X, glm::Z) #define ppsp swizzle(glm::Z, glm::Z, glm::X, glm::Z) #define qpsp swizzle(glm::W, glm::Z, glm::X, glm::Z) #define sqsp swizzle(glm::X, glm::W, glm::X, glm::Z) #define tqsp swizzle(glm::Y, glm::W, glm::X, glm::Z) #define pqsp swizzle(glm::Z, glm::W, glm::X, glm::Z) #define qqsp swizzle(glm::W, glm::W, glm::X, glm::Z) #define sstp swizzle(glm::X, glm::X, glm::Y, glm::Z) #define tstp swizzle(glm::Y, glm::X, glm::Y, glm::Z) #define pstp swizzle(glm::Z, glm::X, glm::Y, glm::Z) #define qstp swizzle(glm::W, glm::X, glm::Y, glm::Z) #define sttp swizzle(glm::X, glm::Y, glm::Y, glm::Z) #define tttp swizzle(glm::Y, glm::Y, glm::Y, glm::Z) #define pttp swizzle(glm::Z, glm::Y, glm::Y, glm::Z) #define qttp swizzle(glm::W, glm::Y, glm::Y, glm::Z) #define sptp swizzle(glm::X, glm::Z, glm::Y, glm::Z) #define tptp swizzle(glm::Y, glm::Z, glm::Y, glm::Z) #define pptp swizzle(glm::Z, glm::Z, glm::Y, glm::Z) #define qptp swizzle(glm::W, glm::Z, glm::Y, glm::Z) #define sqtp swizzle(glm::X, glm::W, glm::Y, glm::Z) #define tqtp swizzle(glm::Y, glm::W, glm::Y, glm::Z) #define pqtp swizzle(glm::Z, glm::W, glm::Y, glm::Z) #define qqtp swizzle(glm::W, glm::W, glm::Y, glm::Z) #define sspp swizzle(glm::X, glm::X, glm::Z, glm::Z) #define tspp swizzle(glm::Y, glm::X, glm::Z, glm::Z) #define pspp swizzle(glm::Z, glm::X, glm::Z, glm::Z) #define qspp swizzle(glm::W, glm::X, glm::Z, glm::Z) #define stpp swizzle(glm::X, glm::Y, glm::Z, glm::Z) #define ttpp swizzle(glm::Y, glm::Y, glm::Z, glm::Z) #define ptpp swizzle(glm::Z, glm::Y, glm::Z, glm::Z) #define qtpp swizzle(glm::W, glm::Y, glm::Z, glm::Z) #define sppp swizzle(glm::X, glm::Z, glm::Z, glm::Z) #define tppp swizzle(glm::Y, glm::Z, glm::Z, glm::Z) #define pppp swizzle(glm::Z, glm::Z, glm::Z, glm::Z) #define qppp swizzle(glm::W, glm::Z, glm::Z, glm::Z) #define sqpp swizzle(glm::X, glm::W, glm::Z, glm::Z) #define tqpp swizzle(glm::Y, glm::W, glm::Z, glm::Z) #define pqpp swizzle(glm::Z, glm::W, glm::Z, glm::Z) #define qqpp swizzle(glm::W, glm::W, glm::Z, glm::Z) #define ssqp swizzle(glm::X, glm::X, glm::W, glm::Z) #define tsqp swizzle(glm::Y, glm::X, glm::W, glm::Z) #define psqp swizzle(glm::Z, glm::X, glm::W, glm::Z) #define qsqp swizzle(glm::W, glm::X, glm::W, glm::Z) #define stqp swizzle(glm::X, glm::Y, glm::W, glm::Z) #define ttqp swizzle(glm::Y, glm::Y, glm::W, glm::Z) #define ptqp swizzle(glm::Z, glm::Y, glm::W, glm::Z) #define qtqp swizzle(glm::W, glm::Y, glm::W, glm::Z) #define spqp swizzle(glm::X, glm::Z, glm::W, glm::Z) #define tpqp swizzle(glm::Y, glm::Z, glm::W, glm::Z) #define ppqp swizzle(glm::Z, glm::Z, glm::W, glm::Z) #define qpqp swizzle(glm::W, glm::Z, glm::W, glm::Z) #define sqqp swizzle(glm::X, glm::W, glm::W, glm::Z) #define tqqp swizzle(glm::Y, glm::W, glm::W, glm::Z) #define pqqp swizzle(glm::Z, glm::W, glm::W, glm::Z) #define qqqp swizzle(glm::W, glm::W, glm::W, glm::Z) #define sssq swizzle(glm::X, glm::X, glm::X, glm::W) #define tssq swizzle(glm::Y, glm::X, glm::X, glm::W) #define pssq swizzle(glm::Z, glm::X, glm::X, glm::W) #define qssq swizzle(glm::W, glm::X, glm::X, glm::W) #define stsq swizzle(glm::X, glm::Y, glm::X, glm::W) #define ttsq swizzle(glm::Y, glm::Y, glm::X, glm::W) #define ptsq swizzle(glm::Z, glm::Y, glm::X, glm::W) #define qtsq swizzle(glm::W, glm::Y, glm::X, glm::W) #define spsq swizzle(glm::X, glm::Z, glm::X, glm::W) #define tpsq swizzle(glm::Y, glm::Z, glm::X, glm::W) #define ppsq swizzle(glm::Z, glm::Z, glm::X, glm::W) #define qpsq swizzle(glm::W, glm::Z, glm::X, glm::W) #define sqsq swizzle(glm::X, glm::W, glm::X, glm::W) #define tqsq swizzle(glm::Y, glm::W, glm::X, glm::W) #define pqsq swizzle(glm::Z, glm::W, glm::X, glm::W) #define qqsq swizzle(glm::W, glm::W, glm::X, glm::W) #define sstq swizzle(glm::X, glm::X, glm::Y, glm::W) #define tstq swizzle(glm::Y, glm::X, glm::Y, glm::W) #define pstq swizzle(glm::Z, glm::X, glm::Y, glm::W) #define qstq swizzle(glm::W, glm::X, glm::Y, glm::W) #define sttq swizzle(glm::X, glm::Y, glm::Y, glm::W) #define tttq swizzle(glm::Y, glm::Y, glm::Y, glm::W) #define pttq swizzle(glm::Z, glm::Y, glm::Y, glm::W) #define qttq swizzle(glm::W, glm::Y, glm::Y, glm::W) #define sptq swizzle(glm::X, glm::Z, glm::Y, glm::W) #define tptq swizzle(glm::Y, glm::Z, glm::Y, glm::W) #define pptq swizzle(glm::Z, glm::Z, glm::Y, glm::W) #define qptq swizzle(glm::W, glm::Z, glm::Y, glm::W) #define sqtq swizzle(glm::X, glm::W, glm::Y, glm::W) #define tqtq swizzle(glm::Y, glm::W, glm::Y, glm::W) #define pqtq swizzle(glm::Z, glm::W, glm::Y, glm::W) #define qqtq swizzle(glm::W, glm::W, glm::Y, glm::W) #define sspq swizzle(glm::X, glm::X, glm::Z, glm::W) #define tspq swizzle(glm::Y, glm::X, glm::Z, glm::W) #define pspq swizzle(glm::Z, glm::X, glm::Z, glm::W) #define qspq swizzle(glm::W, glm::X, glm::Z, glm::W) #define stpq swizzle(glm::X, glm::Y, glm::Z, glm::W) #define ttpq swizzle(glm::Y, glm::Y, glm::Z, glm::W) #define ptpq swizzle(glm::Z, glm::Y, glm::Z, glm::W) #define qtpq swizzle(glm::W, glm::Y, glm::Z, glm::W) #define sppq swizzle(glm::X, glm::Z, glm::Z, glm::W) #define tppq swizzle(glm::Y, glm::Z, glm::Z, glm::W) #define pppq swizzle(glm::Z, glm::Z, glm::Z, glm::W) #define qppq swizzle(glm::W, glm::Z, glm::Z, glm::W) #define sqpq swizzle(glm::X, glm::W, glm::Z, glm::W) #define tqpq swizzle(glm::Y, glm::W, glm::Z, glm::W) #define pqpq swizzle(glm::Z, glm::W, glm::Z, glm::W) #define qqpq swizzle(glm::W, glm::W, glm::Z, glm::W) #define ssqq swizzle(glm::X, glm::X, glm::W, glm::W) #define tsqq swizzle(glm::Y, glm::X, glm::W, glm::W) #define psqq swizzle(glm::Z, glm::X, glm::W, glm::W) #define qsqq swizzle(glm::W, glm::X, glm::W, glm::W) #define stqq swizzle(glm::X, glm::Y, glm::W, glm::W) #define ttqq swizzle(glm::Y, glm::Y, glm::W, glm::W) #define ptqq swizzle(glm::Z, glm::Y, glm::W, glm::W) #define qtqq swizzle(glm::W, glm::Y, glm::W, glm::W) #define spqq swizzle(glm::X, glm::Z, glm::W, glm::W) #define tpqq swizzle(glm::Y, glm::Z, glm::W, glm::W) #define ppqq swizzle(glm::Z, glm::Z, glm::W, glm::W) #define qpqq swizzle(glm::W, glm::Z, glm::W, glm::W) #define sqqq swizzle(glm::X, glm::W, glm::W, glm::W) #define tqqq swizzle(glm::Y, glm::W, glm::W, glm::W) #define pqqq swizzle(glm::Z, glm::W, glm::W, glm::W) #define qqqq swizzle(glm::W, glm::W, glm::W, glm::W) #endif #endif//glm_core_swizzle libavg-1.8.2/src/glm/core/dummy.cpp000066400000000000000000000013211236127404500171240ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2011-01-19 // Updated : 2011-01-19 // Licence : This source is under MIT License // File : glm/setup.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// // GLM is a header only library. There is nothing to compile. // dummy.cpp exist only a wordaround for CMake file. #include "../glm.hpp" #include "../ext.hpp" //#error "GLM is a header only library" int main() { } libavg-1.8.2/src/glm/core/func_common.hpp000066400000000000000000000331201236127404500203030ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2008-03-08 // Updated : 2010-01-26 // Licence : This source is under MIT License // File : glm/core/func_common.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_core_func_common #define glm_core_func_common #include "_fixes.hpp" namespace glm { namespace core{ namespace function{ namespace common{ //!< Define common functions from Section 8.3 of GLSL 1.30.8 specification. Included in glm namespace. /// \addtogroup core_funcs ///@{ //! Returns x if x >= 0; otherwise, it returns -x. //! //! \li
GLSL abs man page //! \li GLSL 1.30.08 specification, section 8.3 template genFIType abs(genFIType const & x); //! Returns 1.0 if x > 0, 0.0 if x == 0, or -1.0 if x < 0. //! //! \li GLSL sign man page //! \li GLSL 1.30.08 specification, section 8.3 template genFIType sign(genFIType const & x); //! Returns a value equal to the nearest integer that is less then or equal to x. //! //! \li GLSL floor man page //! \li GLSL 1.30.08 specification, section 8.3 template genType floor(genType const & x); //! Returns a value equal to the nearest integer to x //! whose absolute value is not larger than the absolute value of x. //! //! \li GLSL trunc man page //! \li GLSL 1.30.08 specification, section 8.3 template genType trunc(genType const & x); //! Returns a value equal to the nearest integer to x. //! The fraction 0.5 will round in a direction chosen by the //! implementation, presumably the direction that is fastest. //! This includes the possibility that round(x) returns the //! same value as roundEven(x) for all values of x. //! //! \li GLSL round man page //! \li GLSL 1.30.08 specification, section 8.3 template genType round(genType const & x); //! Returns a value equal to the nearest integer to x. //! A fractional part of 0.5 will round toward the nearest even //! integer. (Both 3.5 and 4.5 for x will return 4.0.) //! //! \li GLSL roundEven man page //! \li GLSL 1.30.08 specification, section 8.3 template genType roundEven(genType const & x); //! Returns a value equal to the nearest integer //! that is greater than or equal to x. //! //! \li GLSL ceil man page //! \li GLSL 1.30.08 specification, section 8.3 template genType ceil(genType const & x); //! Return x - floor(x). //! //! \li GLSL fract man page //! \li GLSL 1.30.08 specification, section 8.3 template genType fract(genType const & x); //! Modulus. Returns x - y * floor(x / y) //! for each component in x using the floating point value y. //! //! \li GLSL mod man page //! \li GLSL 1.30.08 specification, section 8.3 template genType mod( genType const & x, genType const & y); //! Modulus. Returns x - y * floor(x / y) //! for each component in x using the floating point value y. //! //! \li GLSL mod man page //! \li GLSL 1.30.08 specification, section 8.3 template genType mod( genType const & x, typename genType::value_type const & y); //! Returns the fractional part of x and sets i to the integer //! part (as a whole number floating point value). Both the //! return value and the output parameter will have the same //! sign as x. //! //! \li GLSL modf man page //! \li GLSL 1.30.08 specification, section 8.3 template genType modf( genType const & x, genType & i); //! Returns y if y < x; otherwise, it returns x. //! //! \li GLSL min man page //! \li GLSL 1.30.08 specification, section 8.3 template genType min( genType const & x, genType const & y); template genType min( genType const & x, typename genType::value_type const & y); //! Returns y if x < y; otherwise, it returns x. //! //! \li GLSL max man page //! \li GLSL 1.30.08 specification, section 8.3 template genType max( genType const & x, genType const & y); template genType max( genType const & x, typename genType::value_type const & y); //! Returns min(max(x, minVal), maxVal) for each component in x //! using the floating-point values minVal and maxVal. //! //! \li GLSL clamp man page //! \li GLSL 1.30.08 specification, section 8.3 template genType clamp( genType const & x, genType const & minVal, genType const & maxVal); template genType clamp( genType const & x, typename genType::value_type const & minVal, typename genType::value_type const & maxVal); //! \return If genTypeU is a floating scalar or vector: //! Returns x * (1.0 - a) + y * a, i.e., the linear blend of //! x and y using the floating-point value a. //! The value for a is not restricted to the range [0, 1]. //! //! \return If genTypeU is a boolean scalar or vector: //! Selects which vector each returned component comes //! from. For a component of a that is false, the //! corresponding component of x is returned. For a //! component of a that is true, the corresponding //! component of y is returned. Components of x and y that //! are not selected are allowed to be invalid floating point //! values and will have no effect on the results. Thus, this //! provides different functionality than //! genType mix(genType x, genType y, genType(a)) //! where a is a Boolean vector. //! //! \li GLSL mix man page //! \li GLSL 1.30.08 specification, section 8.3 //! //! \param[in] x Floating point scalar or vector. //! \param[in] y Floating point scalar or vector. //! \param[in] a Floating point or boolean scalar or vector. //! // \todo Test when 'a' is a boolean. template genTypeT mix(genTypeT const & x, genTypeT const & y, genTypeU const & a); //! Returns 0.0 if x < edge, otherwise it returns 1.0. //! //! \li GLSL step man page //! \li GLSL 1.30.08 specification, section 8.3 template genType step( genType const & edge, genType const & x); template genType step( typename genType::value_type const & edge, genType const & x); //! Returns 0.0 if x <= edge0 and 1.0 if x >= edge1 and //! performs smooth Hermite interpolation between 0 and 1 //! when edge0 < x < edge1. This is useful in cases where //! you would want a threshold function with a smooth //! transition. This is equivalent to: //! genType t; //! t = clamp ((x edge0) / (edge1 edge0), 0, 1); //! return t * t * (3 2 * t); //! Results are undefined if edge0 >= edge1. //! //! \li GLSL smoothstep man page //! \li GLSL 1.30.08 specification, section 8.3 template genType smoothstep( genType const & edge0, genType const & edge1, genType const & x); template genType smoothstep( typename genType::value_type const & edge0, typename genType::value_type const & edge1, genType const & x); //! Returns true if x holds a NaN (not a number) //! representation in the underlying implementation's set of //! floating point representations. Returns false otherwise, //! including for implementations with no NaN //! representations. //! //! \li GLSL isnan man page //! \li GLSL 1.30.08 specification, section 8.3 template typename genType::bool_type isnan(genType const & x); //! Returns true if x holds a positive infinity or negative //! infinity representation in the underlying implementation's //! set of floating point representations. Returns false //! otherwise, including for implementations with no infinity //! representations. //! //! \li GLSL isinf man page //! \li GLSL 1.30.08 specification, section 8.3 template typename genType::bool_type isinf(genType const & x); //! Returns a signed integer value representing //! the encoding of a floating-point value. The floatingpoint //! value's bit-level representation is preserved. //! //! \li GLSL floatBitsToInt man page //! \li GLSL 4.00.08 specification, section 8.3 template genIType floatBitsToInt(genType const & value); //! Returns a unsigned integer value representing //! the encoding of a floating-point value. The floatingpoint //! value's bit-level representation is preserved. //! //! \li GLSL floatBitsToUint man page //! \li GLSL 4.00.08 specification, section 8.3 template genUType floatBitsToUint(genType const & value); //! Returns a floating-point value corresponding to a signed //! integer encoding of a floating-point value. //! If an inf or NaN is passed in, it will not signal, and the //! resulting floating point value is unspecified. Otherwise, //! the bit-level representation is preserved. //! //! \li GLSL intBitsToFloat man page //! \li GLSL 4.00.08 specification, section 8.3 template genType intBitsToFloat(genIType const & value); //! Returns a floating-point value corresponding to a //! unsigned integer encoding of a floating-point value. //! If an inf or NaN is passed in, it will not signal, and the //! resulting floating point value is unspecified. Otherwise, //! the bit-level representation is preserved. //! //! \li GLSL uintBitsToFloat man page //! \li GLSL 4.00.08 specification, section 8.3 template genType uintBitsToFloat(genUType const & value); //! Computes and returns a * b + c. //! //! \li GLSL fma man page //! \li GLSL 4.00.08 specification, section 8.3 template genType fma(genType const & a, genType const & b, genType const & c); //! Splits x into a floating-point significand in the range //! [0.5, 1.0) and an integral exponent of two, such that: //! x = significand * exp(2, exponent) //! //! The significand is returned by the function and the //! exponent is returned in the parameter exp. For a //! floating-point value of zero, the significant and exponent //! are both zero. For a floating-point value that is an //! infinity or is not a number, the results are undefined. //! //! \li GLSL frexp man page //! \li GLSL 4.00.08 specification, section 8.3 template genType frexp(genType const & x, genIType & exp); //! Builds a floating-point number from x and the //! corresponding integral exponent of two in exp, returning: //! significand * exp(2, exponent) //! //! If this product is too large to be represented in the //! floating-point type, the result is undefined. //! //! \li GLSL ldexp man page; //! \li GLSL 4.00.08 specification, section 8.3 template genType ldexp(genType const & x, genIType const & exp); ///@} }//namespace common }//namespace function }//namespace core using namespace core::function::common; }//namespace glm #include "func_common.inl" #endif//glm_core_func_common libavg-1.8.2/src/glm/core/func_common.inl000066400000000000000000001120031236127404500202740ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2008-08-03 // Updated : 2010-01-26 // Licence : This source is under MIT License // File : glm/core/func_common.inl /////////////////////////////////////////////////////////////////////////////////////////////////// namespace glm { namespace detail { template struct Abs_ { }; template struct Abs_ { static genFIType get(genFIType const & x) { GLM_STATIC_ASSERT( detail::type::is_float || detail::type::is_int, "'abs' only accept floating-point and integer inputs"); return x >= genFIType(0) ? x : -x; } }; template struct Abs_ { static genFIType get(genFIType const & x) { GLM_STATIC_ASSERT( detail::type::is_uint, "'abs' only accept floating-point and integer inputs"); return x; } }; }//namespace detail namespace core{ namespace function{ namespace common{ // abs template GLM_FUNC_QUALIFIER genFIType abs( genFIType const & x) { return detail::Abs_::is_signed>::get(x); } //template //GLM_FUNC_QUALIFIER detail::tvec1 abs( // detail::tvec1 const & v) //{ // return detail::tvec1( // abs(v.x)); //} template GLM_FUNC_QUALIFIER detail::tvec2 abs( detail::tvec2 const & v) { return detail::tvec2( abs(v.x), abs(v.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 abs( detail::tvec3 const & v) { return detail::tvec3( abs(v.x), abs(v.y), abs(v.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 abs( detail::tvec4 const & v) { return detail::tvec4( abs(v.x), abs(v.y), abs(v.z), abs(v.w)); } // sign //Try something like based on x >> 31 to get the sign bit template GLM_FUNC_QUALIFIER genFIType sign( genFIType const & x) { GLM_STATIC_ASSERT( detail::type::is_float || detail::type::is_int, "'sign' only accept signed inputs"); genFIType result; if(x > genFIType(0)) result = genFIType(1); else if(x < genFIType(0)) result = genFIType(-1); else result = genFIType(0); return result; } template GLM_FUNC_QUALIFIER detail::tvec2 sign( detail::tvec2 const & x) { return detail::tvec2( sign(x.x), sign(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 sign( detail::tvec3 const & x) { return detail::tvec3( sign(x.x), sign(x.y), sign(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 sign( detail::tvec4 const & x) { return detail::tvec4( sign(x.x), sign(x.y), sign(x.z), sign(x.w)); } // floor template <> GLM_FUNC_QUALIFIER detail::thalf floor(detail::thalf const& x) { return detail::thalf(::std::floor(float(x))); } template GLM_FUNC_QUALIFIER genType floor(genType const& x) { GLM_STATIC_ASSERT(detail::type::is_float, "'floor' only accept floating-point inputs"); return ::std::floor(x); } template GLM_FUNC_QUALIFIER detail::tvec2 floor(detail::tvec2 const& x) { return detail::tvec2( floor(x.x), floor(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 floor(detail::tvec3 const& x) { return detail::tvec3( floor(x.x), floor(x.y), floor(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 floor(detail::tvec4 const& x) { return detail::tvec4( floor(x.x), floor(x.y), floor(x.z), floor(x.w)); } // trunc template GLM_FUNC_QUALIFIER genType trunc(genType const & x) { GLM_STATIC_ASSERT(detail::type::is_float, "'trunc' only accept floating-point inputs"); return x < 0 ? -floor(-x) : floor(x); } template GLM_FUNC_QUALIFIER detail::tvec2 trunc(detail::tvec2 const & x) { return detail::tvec2( trunc(x.x), trunc(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 trunc(detail::tvec3 const & x) { return detail::tvec3( trunc(x.x), trunc(x.y), trunc(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 trunc(detail::tvec4 const & x) { return detail::tvec4( trunc(x.x), trunc(x.y), trunc(x.z), trunc(x.w)); } // round template GLM_FUNC_QUALIFIER genType round(genType const& x) { GLM_STATIC_ASSERT(detail::type::is_float, "'round' only accept floating-point inputs"); return genType(int(x + genType(0.5))); } template GLM_FUNC_QUALIFIER detail::tvec2 round(detail::tvec2 const& x) { return detail::tvec2( round(x.x), round(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 round(detail::tvec3 const& x) { return detail::tvec3( round(x.x), round(x.y), round(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 round(detail::tvec4 const& x) { return detail::tvec4( round(x.x), round(x.y), round(x.z), round(x.w)); } // roundEven template GLM_FUNC_QUALIFIER genType roundEven(genType const& x) { GLM_STATIC_ASSERT(detail::type::is_float, "'roundEven' only accept floating-point inputs"); return genType(int(x + genType(int(x) % 2))); } template GLM_FUNC_QUALIFIER detail::tvec2 roundEven(detail::tvec2 const& x) { return detail::tvec2( roundEven(x.x), roundEven(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 roundEven(detail::tvec3 const& x) { return detail::tvec3( roundEven(x.x), roundEven(x.y), roundEven(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 roundEven(detail::tvec4 const& x) { return detail::tvec4( roundEven(x.x), roundEven(x.y), roundEven(x.z), roundEven(x.w)); } // ceil template GLM_FUNC_QUALIFIER genType ceil(genType const & x) { GLM_STATIC_ASSERT(detail::type::is_float, "'ceil' only accept floating-point inputs"); return ::std::ceil(x); } template GLM_FUNC_QUALIFIER detail::tvec2 ceil(detail::tvec2 const & x) { return detail::tvec2( ceil(x.x), ceil(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 ceil(detail::tvec3 const & x) { return detail::tvec3( ceil(x.x), ceil(x.y), ceil(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 ceil(detail::tvec4 const & x) { return detail::tvec4( ceil(x.x), ceil(x.y), ceil(x.z), ceil(x.w)); } // fract template GLM_FUNC_QUALIFIER genType fract ( genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'fract' only accept floating-point inputs"); return x - ::std::floor(x); } template GLM_FUNC_QUALIFIER detail::tvec2 fract ( detail::tvec2 const & x ) { return detail::tvec2( fract(x.x), fract(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 fract ( detail::tvec3 const & x ) { return detail::tvec3( fract(x.x), fract(x.y), fract(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 fract ( detail::tvec4 const & x ) { return detail::tvec4( fract(x.x), fract(x.y), fract(x.z), fract(x.w)); } // mod template GLM_FUNC_QUALIFIER genType mod ( genType const & x, genType const & y ) { GLM_STATIC_ASSERT(detail::type::is_float, "'mod' only accept floating-point inputs"); return x - y * floor(x / y); } template GLM_FUNC_QUALIFIER detail::tvec2 mod ( detail::tvec2 const & x, typename detail::tvec2::value_type const & y ) { return detail::tvec2( mod(x.x, y), mod(x.y, y)); } template GLM_FUNC_QUALIFIER detail::tvec3 mod ( detail::tvec3 const & x, typename detail::tvec3::value_type const & y ) { return detail::tvec3( mod(x.x, y), mod(x.y, y), mod(x.z, y)); } template GLM_FUNC_QUALIFIER detail::tvec4 mod ( detail::tvec4 const & x, typename detail::tvec4::value_type const & y ) { return detail::tvec4( mod(x.x, y), mod(x.y, y), mod(x.z, y), mod(x.w, y)); } template GLM_FUNC_QUALIFIER detail::tvec2 mod ( detail::tvec2 const & x, detail::tvec2 const & y ) { return detail::tvec2( mod(x.x, y.x), mod(x.y, y.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 mod ( detail::tvec3 const & x, detail::tvec3 const & y ) { return detail::tvec3( mod(x.x, y.x), mod(x.y, y.y), mod(x.z, y.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 mod ( detail::tvec4 const & x, detail::tvec4 const & y ) { return detail::tvec4( mod(x.x, y.x), mod(x.y, y.y), mod(x.z, y.z), mod(x.w, y.w)); } // modf template GLM_FUNC_QUALIFIER genType modf ( genType const & x, genType & i ) { GLM_STATIC_ASSERT(detail::type::is_float, "'modf' only accept floating-point inputs"); i = glm::floor(x); return x - i; } template GLM_FUNC_QUALIFIER detail::tvec2 modf ( detail::tvec2 const & x, detail::tvec2 const & y ) { return detail::tvec2( modf(x.x, y.x), modf(x.y, y.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 modf ( detail::tvec3 const & x, detail::tvec3 const & y ) { return detail::tvec3( modf(x.x, y.x), modf(x.y, y.y), modf(x.z, y.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 modf ( detail::tvec4 const & x, detail::tvec4 const & y ) { return detail::tvec4( modf(x.x, y.x), modf(x.y, y.y), modf(x.z, y.z), modf(x.w, y.w)); } //// Only valid if (INT_MIN <= x-y <= INT_MAX) //// min(x,y) //r = y + ((x - y) & ((x - y) >> (sizeof(int) * //CHAR_BIT 1))); //// max(x,y) //r = x - ((x - y) & ((x - y) >> (sizeof(int) * //CHAR_BIT - 1))); // min template GLM_FUNC_QUALIFIER genType min ( genType const & x, genType const & y ) { GLM_STATIC_ASSERT( detail::type::is_float || detail::type::is_int || detail::type::is_uint, "'min' only accept numbers"); return x < y ? x : y; } template GLM_FUNC_QUALIFIER detail::tvec2 min ( detail::tvec2 const & x, typename detail::tvec2::value_type const & y ) { return detail::tvec2( min(x.x, y), min(x.y, y)); } template GLM_FUNC_QUALIFIER detail::tvec3 min ( detail::tvec3 const & x, typename detail::tvec3::value_type const & y ) { return detail::tvec3( min(x.x, y), min(x.y, y), min(x.z, y)); } template GLM_FUNC_QUALIFIER detail::tvec4 min ( detail::tvec4 const & x, typename detail::tvec4::value_type const & y ) { return detail::tvec4( min(x.x, y), min(x.y, y), min(x.z, y), min(x.w, y)); } template GLM_FUNC_QUALIFIER detail::tvec2 min ( detail::tvec2 const & x, detail::tvec2 const & y ) { return detail::tvec2( min(x.x, y.x), min(x.y, y.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 min ( detail::tvec3 const & x, detail::tvec3 const & y ) { return detail::tvec3( min(x.x, y.x), min(x.y, y.y), min(x.z, y.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 min ( detail::tvec4 const & x, detail::tvec4 const & y ) { return detail::tvec4( min(x.x, y.x), min(x.y, y.y), min(x.z, y.z), min(x.w, y.w)); } // max template GLM_FUNC_QUALIFIER genType max ( genType const & x, genType const & y ) { GLM_STATIC_ASSERT( detail::type::is_float || detail::type::is_int || detail::type::is_uint, "'max' only accept numbers"); return x > y ? x : y; } template GLM_FUNC_QUALIFIER detail::tvec2 max ( detail::tvec2 const & x, typename detail::tvec2::value_type y ) { return detail::tvec2( max(x.x, y), max(x.y, y)); } template GLM_FUNC_QUALIFIER detail::tvec3 max ( detail::tvec3 const & x, typename detail::tvec3::value_type y ) { return detail::tvec3( max(x.x, y), max(x.y, y), max(x.z, y)); } template GLM_FUNC_QUALIFIER detail::tvec4 max ( detail::tvec4 const & x, typename detail::tvec4::value_type y ) { return detail::tvec4( max(x.x, y), max(x.y, y), max(x.z, y), max(x.w, y)); } template GLM_FUNC_QUALIFIER detail::tvec2 max ( detail::tvec2 const & x, detail::tvec2 const & y ) { return detail::tvec2( max(x.x, y.x), max(x.y, y.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 max ( detail::tvec3 const & x, detail::tvec3 const & y ) { return detail::tvec3( max(x.x, y.x), max(x.y, y.y), max(x.z, y.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 max ( detail::tvec4 const & x, detail::tvec4 const & y) { return detail::tvec4( max(x.x, y.x), max(x.y, y.y), max(x.z, y.z), max(x.w, y.w)); } // clamp template GLM_FUNC_QUALIFIER valType clamp ( valType const & x, valType const & minVal, valType const & maxVal ) { GLM_STATIC_ASSERT( detail::type::is_float || detail::type::is_int || detail::type::is_uint, "'clamp' only accept numbers"); // Old implementation, less predictable branching //if(x >= maxVal) return maxVal; //if(x <= minVal) return minVal; //return x; return glm::max(glm::min(x, maxVal), minVal); } template GLM_FUNC_QUALIFIER detail::tvec2 clamp ( detail::tvec2 const & x, typename detail::tvec2::value_type const & minVal, typename detail::tvec2::value_type const & maxVal ) { return detail::tvec2( clamp(x.x, minVal, maxVal), clamp(x.y, minVal, maxVal)); } template GLM_FUNC_QUALIFIER detail::tvec3 clamp ( detail::tvec3 const & x, typename detail::tvec3::value_type const & minVal, typename detail::tvec3::value_type const & maxVal ) { return detail::tvec3( clamp(x.x, minVal, maxVal), clamp(x.y, minVal, maxVal), clamp(x.z, minVal, maxVal)); } template GLM_FUNC_QUALIFIER detail::tvec4 clamp ( detail::tvec4 const & x, typename detail::tvec4::value_type const & minVal, typename detail::tvec4::value_type const & maxVal ) { return detail::tvec4( clamp(x.x, minVal, maxVal), clamp(x.y, minVal, maxVal), clamp(x.z, minVal, maxVal), clamp(x.w, minVal, maxVal)); } template GLM_FUNC_QUALIFIER detail::tvec2 clamp ( detail::tvec2 const & x, detail::tvec2 const & minVal, detail::tvec2 const & maxVal ) { return detail::tvec2( clamp(x.x, minVal.x, maxVal.x), clamp(x.y, minVal.y, maxVal.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 clamp ( detail::tvec3 const & x, detail::tvec3 const & minVal, detail::tvec3 const & maxVal ) { return detail::tvec3( clamp(x.x, minVal.x, maxVal.x), clamp(x.y, minVal.y, maxVal.y), clamp(x.z, minVal.z, maxVal.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 clamp ( detail::tvec4 const & x, detail::tvec4 const & minVal, detail::tvec4 const & maxVal ) { return detail::tvec4( clamp(x.x, minVal.x, maxVal.x), clamp(x.y, minVal.y, maxVal.y), clamp(x.z, minVal.z, maxVal.z), clamp(x.w, minVal.w, maxVal.w)); } // mix template GLM_FUNC_QUALIFIER genTypeT mix ( genTypeT const & x, genTypeT const & y, genTypeU const & a ) { // It could be a vector too //GLM_STATIC_ASSERT( // detail::type::is_float && // detail::type::is_float); //return x + a * (y - x); return genTypeT(genTypeU(x) + a * genTypeU(y - x)); } template GLM_FUNC_QUALIFIER detail::tvec2 mix ( detail::tvec2 const & x, detail::tvec2 const & y, valTypeB const & a ) { return detail::tvec2( detail::tvec2(x) + a * detail::tvec2(y - x)); } template GLM_FUNC_QUALIFIER detail::tvec3 mix ( detail::tvec3 const & x, detail::tvec3 const & y, valTypeB const & a ) { return detail::tvec3( detail::tvec3(x) + a * detail::tvec3(y - x)); } template GLM_FUNC_QUALIFIER detail::tvec4 mix ( detail::tvec4 const & x, detail::tvec4 const & y, valTypeB const & a ) { return detail::tvec4( detail::tvec4(x) + a * detail::tvec4(y - x)); } template GLM_FUNC_QUALIFIER detail::tvec2 mix ( detail::tvec2 const & x, detail::tvec2 const & y, detail::tvec2 const & a ) { return detail::tvec2( detail::tvec2(x) + a * detail::tvec2(y - x)); } template GLM_FUNC_QUALIFIER detail::tvec3 mix ( detail::tvec3 const & x, detail::tvec3 const & y, detail::tvec3 const & a ) { return detail::tvec3( detail::tvec3(x) + a * detail::tvec3(y - x)); } template GLM_FUNC_QUALIFIER detail::tvec4 mix ( detail::tvec4 const & x, detail::tvec4 const & y, detail::tvec4 const & a ) { return detail::tvec4( detail::tvec4(x) + a * detail::tvec4(y - x)); } //template //GLM_FUNC_QUALIFIER genTypeT mix //( // genTypeT const & x, // genTypeT const & y, // float const & a //) //{ // // It could be a vector too // //GLM_STATIC_ASSERT( // // detail::type::is_float && // // detail::type::is_float); // return x + a * (y - x); //} template GLM_FUNC_QUALIFIER genType mix ( genType const & x, genType const & y, bool a ) { GLM_STATIC_ASSERT(detail::type::is_float, "'mix' only accept floating-point inputs"); return a ? x : y; } template GLM_FUNC_QUALIFIER detail::tvec2 mix ( detail::tvec2 const & x, detail::tvec2 const & y, typename detail::tvec2::bool_type a ) { GLM_STATIC_ASSERT(detail::type::is_float, "'mix' only accept floating-point inputs"); detail::tvec2 result; for ( typename detail::tvec2::size_type i = 0; i < detail::tvec2::value_size(); ++i ) { result[i] = a[i] ? x[i] : y[i]; } return result; } template GLM_FUNC_QUALIFIER detail::tvec3 mix ( detail::tvec3 const & x, detail::tvec3 const & y, typename detail::tvec3::bool_type a ) { GLM_STATIC_ASSERT(detail::type::is_float, "'mix' only accept floating-point inputs"); detail::tvec3 result; for ( typename detail::tvec3::size_type i = 0; i < detail::tvec3::value_size(); ++i ) { result[i] = a[i] ? x[i] : y[i]; } return result; } template GLM_FUNC_QUALIFIER detail::tvec4 mix ( detail::tvec4 const & x, detail::tvec4 const & y, typename detail::tvec4::bool_type a ) { GLM_STATIC_ASSERT(detail::type::is_float, "'mix' only accept floating-point inputs"); detail::tvec4 result; for ( typename detail::tvec4::size_type i = 0; i < detail::tvec4::value_size(); ++i ) { result[i] = a[i] ? x[i] : y[i]; } return result; } // step template GLM_FUNC_QUALIFIER genType step ( genType const & edge, genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'mix' only accept floating-point inputs"); return x <= edge ? genType(0) : genType(1); } template GLM_FUNC_QUALIFIER detail::tvec2 step ( typename detail::tvec2::value_type const & edge, detail::tvec2 const & x ) { return detail::tvec2( x.x <= edge ? T(0) : T(1), x.y <= edge ? T(0) : T(1)); } template GLM_FUNC_QUALIFIER detail::tvec3 step ( typename detail::tvec3::value_type const & edge, detail::tvec3 const & x ) { return detail::tvec3( x.x <= edge ? T(0) : T(1), x.y <= edge ? T(0) : T(1), x.z <= edge ? T(0) : T(1)); } template GLM_FUNC_QUALIFIER detail::tvec4 step ( typename detail::tvec4::value_type const & edge, detail::tvec4 const & x ) { return detail::tvec4( x.x <= edge ? T(0) : T(1), x.y <= edge ? T(0) : T(1), x.z <= edge ? T(0) : T(1), x.w <= edge ? T(0) : T(1)); } template GLM_FUNC_QUALIFIER detail::tvec2 step ( detail::tvec2 const & edge, detail::tvec2 const & x ) { return detail::tvec2( x.x <= edge.x ? T(0) : T(1), x.y <= edge.y ? T(0) : T(1)); } template GLM_FUNC_QUALIFIER detail::tvec3 step ( detail::tvec3 const & edge, detail::tvec3 const & x ) { return detail::tvec3( x.x <= edge.x ? T(0) : T(1), x.y <= edge.y ? T(0) : T(1), x.z <= edge.z ? T(0) : T(1)); } template GLM_FUNC_QUALIFIER detail::tvec4 step ( detail::tvec4 const & edge, detail::tvec4 const & x ) { return detail::tvec4( x.x <= edge.x ? T(0) : T(1), x.y <= edge.y ? T(0) : T(1), x.z <= edge.z ? T(0) : T(1), x.w <= edge.w ? T(0) : T(1)); } // smoothstep template GLM_FUNC_QUALIFIER genType smoothstep ( genType const & edge0, genType const & edge1, genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'mix' only accept floating-point inputs"); genType tmp = clamp((x - edge0) / (edge1 - edge0), genType(0), genType(1)); return tmp * tmp * (genType(3) - genType(2) * tmp); } template GLM_FUNC_QUALIFIER detail::tvec2 smoothstep ( typename detail::tvec2::value_type const & edge0, typename detail::tvec2::value_type const & edge1, detail::tvec2 const & x ) { return detail::tvec2( smoothstep(edge0, edge1, x.x), smoothstep(edge0, edge1, x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 smoothstep ( typename detail::tvec3::value_type const & edge0, typename detail::tvec3::value_type const & edge1, detail::tvec3 const & x ) { return detail::tvec3( smoothstep(edge0, edge1, x.x), smoothstep(edge0, edge1, x.y), smoothstep(edge0, edge1, x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 smoothstep ( typename detail::tvec4::value_type const & edge0, typename detail::tvec4::value_type const & edge1, detail::tvec4 const & x ) { return detail::tvec4( smoothstep(edge0, edge1, x.x), smoothstep(edge0, edge1, x.y), smoothstep(edge0, edge1, x.z), smoothstep(edge0, edge1, x.w)); } template GLM_FUNC_QUALIFIER detail::tvec2 smoothstep ( detail::tvec2 const & edge0, detail::tvec2 const & edge1, detail::tvec2 const & x ) { return detail::tvec2( smoothstep(edge0.x, edge1.x, x.x), smoothstep(edge0.y, edge1.y, x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 smoothstep ( detail::tvec3 const & edge0, detail::tvec3 const & edge1, detail::tvec3 const & x ) { return detail::tvec3( smoothstep(edge0.x, edge1.x, x.x), smoothstep(edge0.y, edge1.y, x.y), smoothstep(edge0.z, edge1.z, x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 smoothstep ( detail::tvec4 const & edge0, detail::tvec4 const & edge1, detail::tvec4 const & x ) { return detail::tvec4( smoothstep(edge0.x, edge1.x, x.x), smoothstep(edge0.y, edge1.y, x.y), smoothstep(edge0.z, edge1.z, x.z), smoothstep(edge0.w, edge1.w, x.w)); } template GLM_FUNC_QUALIFIER typename genType::bool_type isnan ( genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'mix' only accept floating-point inputs"); #if(GLM_COMPILER & GLM_COMPILER_VC) return typename genType::bool_type(_isnan(x)); #else return typename genType::bool_type(std::isnan(x)); #endif } template GLM_FUNC_QUALIFIER typename detail::tvec2::bool_type isnan ( detail::tvec2 const & x ) { return typename detail::tvec2::bool_type( isnan(x.x), isnan(x.y)); } template GLM_FUNC_QUALIFIER typename detail::tvec3::bool_type isnan ( detail::tvec3 const & x ) { return typename detail::tvec3::bool_type( isnan(x.x), isnan(x.y), isnan(x.z)); } template GLM_FUNC_QUALIFIER typename detail::tvec4::bool_type isnan ( detail::tvec4 const & x ) { return typename detail::tvec4::bool_type( isnan(x.x), isnan(x.y), isnan(x.z), isnan(x.w)); } template GLM_FUNC_QUALIFIER typename genType::bool_type isinf ( genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'isinf' only accept floating-point inputs"); #if(GLM_COMPILER & GLM_COMPILER_VC) return typename genType::bool_type(_fpclass(x) == _FPCLASS_NINF || _fpclass(x) == _FPCLASS_PINF); #else return typename genType::bool_type(std::isinf(x)); #endif } template GLM_FUNC_QUALIFIER typename detail::tvec2::bool_type isinf ( detail::tvec2 const & x ) { return typename detail::tvec2::bool_type( isnan(x.x), isnan(x.y)); } template GLM_FUNC_QUALIFIER typename detail::tvec3::bool_type isinf ( detail::tvec3 const & x ) { return typename detail::tvec3::bool_type( isnan(x.x), isnan(x.y), isnan(x.z)); } template GLM_FUNC_QUALIFIER typename detail::tvec4::bool_type isinf ( detail::tvec4 const & x ) { return typename detail::tvec4::bool_type( isnan(x.x), isnan(x.y), isnan(x.z), isnan(x.w)); } GLM_FUNC_QUALIFIER int floatBitsToInt(float const & value) { union { float f; int i; } fi; fi.f = value; return fi.i; } template GLM_FUNC_QUALIFIER detail::tvec2 floatBitsToInt ( detail::tvec2 const & value ) { return detail::tvec2( floatBitsToInt(value.x), floatBitsToInt(value.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 floatBitsToInt ( detail::tvec3 const & value ) { return detail::tvec3( floatBitsToInt(value.x), floatBitsToInt(value.y)); } template GLM_FUNC_QUALIFIER detail::tvec4 floatBitsToInt ( detail::tvec4 const & value ) { return detail::tvec4( floatBitsToInt(value.x), floatBitsToInt(value.y)); } GLM_FUNC_QUALIFIER uint floatBitsToUint(float const & value) { union { float f; uint u; } fu; fu.f = value; return fu.u; } template GLM_FUNC_QUALIFIER detail::tvec2 floatBitsToUint ( detail::tvec2 const & value ) { return detail::tvec2( floatBitsToUint(value.x), floatBitsToUint(value.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 floatBitsToUint ( detail::tvec3 const & value ) { return detail::tvec3( floatBitsToUint(value.x), floatBitsToUint(value.y)); } template GLM_FUNC_QUALIFIER detail::tvec4 floatBitsToUint ( detail::tvec4 const & value ) { return detail::tvec4( floatBitsToUint(value.x), floatBitsToUint(value.y)); } GLM_FUNC_QUALIFIER float intBitsToFloat(int const & value) { union { float f; int i; } fi; fi.i = value; return fi.f; } template GLM_FUNC_QUALIFIER detail::tvec2 intBitsToFloat ( detail::tvec2 const & value ) { return detail::tvec2( intBitsToFloat(value.x), intBitsToFloat(value.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 intBitsToFloat ( detail::tvec3 const & value ) { return detail::tvec3( intBitsToFloat(value.x), intBitsToFloat(value.y)); } template GLM_FUNC_QUALIFIER detail::tvec4 intBitsToFloat ( detail::tvec4 const & value ) { return detail::tvec4( intBitsToFloat(value.x), intBitsToFloat(value.y)); } GLM_FUNC_QUALIFIER float uintBitsToFloat(uint const & value) { union { float f; uint u; } fu; fu.u = value; return fu.f; } template GLM_FUNC_QUALIFIER detail::tvec2 uintBitsToFloat ( detail::tvec2 const & value ) { return detail::tvec2( uintBitsToFloat(value.x), uintBitsToFloat(value.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 uintBitsToFloat ( detail::tvec3 const & value ) { return detail::tvec3( uintBitsToFloat(value.x), uintBitsToFloat(value.y)); } template GLM_FUNC_QUALIFIER detail::tvec4 uintBitsToFloat ( detail::tvec4 const & value ) { return detail::tvec4( uintBitsToFloat(value.x), uintBitsToFloat(value.y)); } template GLM_FUNC_QUALIFIER genType fma ( genType const & a, genType const & b, genType const & c ) { return a * b + c; } template GLM_FUNC_QUALIFIER genType frexp ( genType const & x, int & exp ) { return std::frexp(x, exp); } template GLM_FUNC_QUALIFIER detail::tvec2 frexp ( detail::tvec2 const & x, detail::tvec2 & exp ) { return std::frexp(x, exp); } template GLM_FUNC_QUALIFIER detail::tvec3 frexp ( detail::tvec3 const & x, detail::tvec3 & exp ) { return std::frexp(x, exp); } template GLM_FUNC_QUALIFIER detail::tvec4 frexp ( detail::tvec4 const & x, detail::tvec4 & exp ) { return std::frexp(x, exp); } template GLM_FUNC_QUALIFIER genType ldexp ( genType const & x, int const & exp ) { return std::frexp(x, exp); } template GLM_FUNC_QUALIFIER detail::tvec2 ldexp ( detail::tvec2 const & x, detail::tvec2 const & exp ) { return std::frexp(x, exp); } template GLM_FUNC_QUALIFIER detail::tvec3 ldexp ( detail::tvec3 const & x, detail::tvec3 const & exp ) { return std::frexp(x, exp); } template GLM_FUNC_QUALIFIER detail::tvec4 ldexp ( detail::tvec4 const & x, detail::tvec4 const & exp ) { return std::frexp(x, exp); } }//namespace common }//namespace function }//namespace core }//namespace glm libavg-1.8.2/src/glm/core/func_exponential.hpp000066400000000000000000000062201236127404500213420ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2008-08-08 // Updated : 2010-02-04 // Licence : This source is under MIT License // File : glm/core/func_exponential.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_core_func_exponential #define glm_core_func_exponential namespace glm { namespace core{ namespace function{ //! Define all exponential functions from Section 8.2 of GLSL 1.30.8 specification. Included in glm namespace. namespace exponential{ /// \addtogroup core_funcs ///@{ //! Returns x raised to the y power. //! //! \li GLSL pow man page //! \li GLSL 1.30.08 specification, section 8.2 template genType pow(genType const & x, genType const & y); //! Returns the natural exponentiation of x, i.e., e^x. //! //! \li GLSL exp man page //! \li GLSL 1.30.08 specification, section 8.2 template genType exp(genType const & x); //! Returns the natural logarithm of x, i.e., //! returns the value y which satisfies the equation x = e^y. //! Results are undefined if x <= 0. //! //! \li GLSL log man page //! \li GLSL 1.30.08 specification, section 8.2 template genType log(genType const & x); //! Returns 2 raised to the x power. //! //! \li GLSL exp2 man page //! \li GLSL 1.30.08 specification, section 8.2 template genType exp2(genType const & x); //! Returns the base 2 log of x, i.e., returns the value y, //! which satisfies the equation x = 2 ^ y. //! //! \li GLSL log2 man page //! \li GLSL 1.30.08 specification, section 8.2 template genType log2(genType const & x); //! Returns the positive square root of x. //! //! \li GLSL sqrt man page //! \li GLSL 1.30.08 specification, section 8.2 template genType sqrt(genType const & x); //! Returns the reciprocal of the positive square root of x. //! //! \li GLSL inversesqrt man page //! \li GLSL 1.30.08 specification, section 8.2 template genType inversesqrt(genType const & x); ///@} }//namespace exponential }//namespace function }//namespace core using namespace core::function::exponential; }//namespace glm #include "func_exponential.inl" #endif//glm_core_func_exponential libavg-1.8.2/src/glm/core/func_exponential.inl000066400000000000000000000172351236127404500213450ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2008-08-03 // Updated : 2010-02-04 // Licence : This source is under MIT License // File : glm/core/func_exponential.inl /////////////////////////////////////////////////////////////////////////////////////////////////// namespace glm { namespace core{ namespace function{ namespace exponential{ // pow template GLM_FUNC_QUALIFIER genType pow ( genType const & x, genType const & y ) { GLM_STATIC_ASSERT(detail::type::is_float, "'pow' only accept floating-point input"); return ::std::pow(x, y); } template GLM_FUNC_QUALIFIER detail::tvec2 pow ( detail::tvec2 const & x, detail::tvec2 const & y ) { return detail::tvec2( pow(x.x, y.x), pow(x.y, y.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 pow ( detail::tvec3 const & x, detail::tvec3 const & y ) { return detail::tvec3( pow(x.x, y.x), pow(x.y, y.y), pow(x.z, y.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 pow ( detail::tvec4 const & x, detail::tvec4 const & y ) { return detail::tvec4( pow(x.x, y.x), pow(x.y, y.y), pow(x.z, y.z), pow(x.w, y.w)); } // exp template GLM_FUNC_QUALIFIER genType exp ( genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'exp' only accept floating-point input"); return ::std::exp(x); } template GLM_FUNC_QUALIFIER detail::tvec2 exp ( detail::tvec2 const & x ) { return detail::tvec2( exp(x.x), exp(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 exp ( detail::tvec3 const & x ) { return detail::tvec3( exp(x.x), exp(x.y), exp(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 exp ( detail::tvec4 const & x ) { return detail::tvec4( exp(x.x), exp(x.y), exp(x.z), exp(x.w)); } // log template GLM_FUNC_QUALIFIER genType log ( genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'log' only accept floating-point input"); return ::std::log(x); } template GLM_FUNC_QUALIFIER detail::tvec2 log ( detail::tvec2 const & x ) { return detail::tvec2( log(x.x), log(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 log ( detail::tvec3 const & x ) { return detail::tvec3( log(x.x), log(x.y), log(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 log ( detail::tvec4 const & x ) { return detail::tvec4( log(x.x), log(x.y), log(x.z), log(x.w)); } //exp2, ln2 = 0.69314718055994530941723212145818f template GLM_FUNC_QUALIFIER genType exp2 ( genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'exp2' only accept floating-point input"); return ::std::exp(genType(0.69314718055994530941723212145818) * x); } template GLM_FUNC_QUALIFIER detail::tvec2 exp2 ( detail::tvec2 const & x ) { return detail::tvec2( exp2(x.x), exp2(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 exp2 ( detail::tvec3 const & x ) { return detail::tvec3( exp2(x.x), exp2(x.y), exp2(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 exp2 ( detail::tvec4 const & x ) { return detail::tvec4( exp2(x.x), exp2(x.y), exp2(x.z), exp2(x.w)); } // log2, ln2 = 0.69314718055994530941723212145818f template GLM_FUNC_QUALIFIER genType log2 ( genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'log2' only accept floating-point input"); return ::std::log(x) / genType(0.69314718055994530941723212145818); } template GLM_FUNC_QUALIFIER detail::tvec2 log2 ( detail::tvec2 const & x ) { return detail::tvec2( log2(x.x), log2(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 log2 ( detail::tvec3 const & x ) { return detail::tvec3( log2(x.x), log2(x.y), log2(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 log2 ( detail::tvec4 const & x ) { return detail::tvec4( log2(x.x), log2(x.y), log2(x.z), log2(x.w)); } // sqrt template GLM_FUNC_QUALIFIER genType sqrt ( genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'sqrt' only accept floating-point input"); return genType(::std::sqrt(x)); } template GLM_FUNC_QUALIFIER detail::tvec2 sqrt ( detail::tvec2 const & x ) { return detail::tvec2( sqrt(x.x), sqrt(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 sqrt ( detail::tvec3 const & x ) { return detail::tvec3( sqrt(x.x), sqrt(x.y), sqrt(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 sqrt ( detail::tvec4 const & x ) { return detail::tvec4( sqrt(x.x), sqrt(x.y), sqrt(x.z), sqrt(x.w)); } template GLM_FUNC_QUALIFIER genType inversesqrt ( genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'inversesqrt' only accept floating-point input"); return genType(1) / ::std::sqrt(x); } template GLM_FUNC_QUALIFIER detail::tvec2 inversesqrt ( detail::tvec2 const & x ) { return detail::tvec2( inversesqrt(x.x), inversesqrt(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 inversesqrt ( detail::tvec3 const & x ) { return detail::tvec3( inversesqrt(x.x), inversesqrt(x.y), inversesqrt(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 inversesqrt ( detail::tvec4 const & x ) { return detail::tvec4( inversesqrt(x.x), inversesqrt(x.y), inversesqrt(x.z), inversesqrt(x.w)); } }//namespace exponential }//namespace function }//namespace core }//namespace glm libavg-1.8.2/src/glm/core/func_geometric.hpp000066400000000000000000000075471236127404500210070ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2008-08-03 // Updated : 2010-02-04 // Licence : This source is under MIT License // File : glm/core/func_geometric.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_core_func_geometric #define glm_core_func_geometric namespace glm { namespace core{ namespace function{ namespace geometric{ //!< Define all geometric functions from Section 8.4 of GLSL 1.30.8 specification. Included in glm namespace. /// \addtogroup core_funcs ///@{ //! Returns the length of x, i.e., sqrt(x * x). //! //! \li GLSL length man page //! \li GLSL 1.30.08 specification, section 8.4 template typename genType::value_type length( genType const & x); //! Returns the distance betwwen p0 and p1, i.e., length(p0 - p1). //! //! \li GLSL distance man page //! \li GLSL 1.30.08 specification, section 8.4 template typename genType::value_type distance( genType const & p0, genType const & p1); //! Returns the dot product of x and y, i.e., result = x * y. //! //! \li GLSL dot man page //! \li GLSL 1.30.08 specification, section 8.4 template typename genType::value_type dot( genType const & x, genType const & y); //! Returns the cross product of x and y. //! //! \li GLSL cross man page //! \li GLSL 1.30.08 specification, section 8.4 template detail::tvec3 cross( detail::tvec3 const & x, detail::tvec3 const & y); //! Returns a vector in the same direction as x but with length of 1. //! //! \li GLSL normalize man page //! \li GLSL 1.30.08 specification, section 8.4 template genType normalize( genType const & x); //! If dot(Nref, I) < 0.0, return N, otherwise, return -N. //! //! \li GLSL faceforward man page //! \li GLSL 1.30.08 specification, section 8.4 template genType faceforward( genType const & N, genType const & I, genType const & Nref); //! For the incident vector I and surface orientation N, //! returns the reflection direction : result = I - 2.0 * dot(N, I) * N. //! //! \li GLSL reflect man page //! \li GLSL 1.30.08 specification, section 8.4 template genType reflect( genType const & I, genType const & N); //! For the incident vector I and surface normal N, //! and the ratio of indices of refraction eta, //! return the refraction vector. //! //! \li GLSL refract man page //! \li GLSL 1.30.08 specification, section 8.4 template genType refract( genType const & I, genType const & N, typename genType::value_type const & eta); ///@} }//namespace geometric }//namespace function }//namespace core using namespace core::function::geometric; }//namespace glm #include "func_geometric.inl" #endif//glm_core_func_geometric libavg-1.8.2/src/glm/core/func_geometric.inl000066400000000000000000000170411236127404500207700ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2008-08-03 // Updated : 2010-02-04 // Licence : This source is under MIT License // File : glm/core/func_geometric.inl /////////////////////////////////////////////////////////////////////////////////////////////////// namespace glm { namespace core{ namespace function{ namespace geometric{ // length template GLM_FUNC_QUALIFIER genType length ( genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'length' only accept floating-point inputs"); genType sqr = x * x; return sqrt(sqr); } template GLM_FUNC_QUALIFIER typename detail::tvec2::value_type length ( detail::tvec2 const & v ) { GLM_STATIC_ASSERT(detail::type::is_float, "'length' only accept floating-point inputs"); typename detail::tvec2::value_type sqr = v.x * v.x + v.y * v.y; return sqrt(sqr); } template GLM_FUNC_QUALIFIER typename detail::tvec3::value_type length ( detail::tvec3 const & v ) { GLM_STATIC_ASSERT(detail::type::is_float, "'length' only accept floating-point inputs"); typename detail::tvec3::value_type sqr = v.x * v.x + v.y * v.y + v.z * v.z; return sqrt(sqr); } template GLM_FUNC_QUALIFIER typename detail::tvec4::value_type length ( detail::tvec4 const & v ) { GLM_STATIC_ASSERT(detail::type::is_float, "'length' only accept floating-point inputs"); typename detail::tvec4::value_type sqr = v.x * v.x + v.y * v.y + v.z * v.z + v.w * v.w; return sqrt(sqr); } // distance template GLM_FUNC_QUALIFIER genType distance ( genType const & p0, genType const & p1 ) { GLM_STATIC_ASSERT(detail::type::is_float, "'distance' only accept floating-point inputs"); return length(p1 - p0); } template GLM_FUNC_QUALIFIER typename detail::tvec2::value_type distance ( detail::tvec2 const & p0, detail::tvec2 const & p1 ) { GLM_STATIC_ASSERT(detail::type::is_float, "'distance' only accept floating-point inputs"); return length(p1 - p0); } template GLM_FUNC_QUALIFIER typename detail::tvec3::value_type distance ( detail::tvec3 const & p0, detail::tvec3 const & p1 ) { GLM_STATIC_ASSERT(detail::type::is_float, "'distance' only accept floating-point inputs"); return length(p1 - p0); } template GLM_FUNC_QUALIFIER typename detail::tvec4::value_type distance ( detail::tvec4 const & p0, detail::tvec4 const & p1 ) { GLM_STATIC_ASSERT(detail::type::is_float, "'distance' only accept floating-point inputs"); return length(p1 - p0); } // dot template GLM_FUNC_QUALIFIER genType dot ( genType const & x, genType const & y ) { GLM_STATIC_ASSERT(detail::type::is_float, "'dot' only accept floating-point inputs"); return x * y; } template GLM_FUNC_QUALIFIER typename detail::tvec2::value_type dot ( detail::tvec2 const & x, detail::tvec2 const & y ) { GLM_STATIC_ASSERT(detail::type::is_float, "'dot' only accept floating-point inputs"); return x.x * y.x + x.y * y.y; } template GLM_FUNC_QUALIFIER T dot ( detail::tvec3 const & x, detail::tvec3 const & y ) { GLM_STATIC_ASSERT(detail::type::is_float, "'dot' only accept floating-point inputs"); return x.x * y.x + x.y * y.y + x.z * y.z; } /* // SSE3 GLM_FUNC_QUALIFIER float dot(const tvec4& x, const tvec4& y) { float Result; __asm { mov esi, x mov edi, y movaps xmm0, [esi] mulps xmm0, [edi] haddps( _xmm0, _xmm0 ) haddps( _xmm0, _xmm0 ) movss Result, xmm0 } return Result; } */ template GLM_FUNC_QUALIFIER T dot ( detail::tvec4 const & x, detail::tvec4 const & y ) { GLM_STATIC_ASSERT(detail::type::is_float, "'dot' only accept floating-point inputs"); return x.x * y.x + x.y * y.y + x.z * y.z + x.w * y.w; } // cross template GLM_FUNC_QUALIFIER detail::tvec3 cross ( detail::tvec3 const & x, detail::tvec3 const & y ) { GLM_STATIC_ASSERT(detail::type::is_float, "'cross' only accept floating-point inputs"); return detail::tvec3( x.y * y.z - y.y * x.z, x.z * y.x - y.z * x.x, x.x * y.y - y.x * x.y); } // normalize template GLM_FUNC_QUALIFIER genType normalize ( genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'normalize' only accept floating-point inputs"); return x < genType(0) ? genType(-1) : genType(1); } // According to issue 10 GLSL 1.10 specification, if length(x) == 0 then result is undefine and generate an error template GLM_FUNC_QUALIFIER detail::tvec2 normalize ( detail::tvec2 const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'normalize' only accept floating-point inputs"); typename detail::tvec2::value_type sqr = x.x * x.x + x.y * x.y; return x * inversesqrt(sqr); } template GLM_FUNC_QUALIFIER detail::tvec3 normalize ( detail::tvec3 const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'normalize' only accept floating-point inputs"); typename detail::tvec3::value_type sqr = x.x * x.x + x.y * x.y + x.z * x.z; return x * inversesqrt(sqr); } template GLM_FUNC_QUALIFIER detail::tvec4 normalize ( detail::tvec4 const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'normalize' only accept floating-point inputs"); typename detail::tvec4::value_type sqr = x.x * x.x + x.y * x.y + x.z * x.z + x.w * x.w; return x * inversesqrt(sqr); } // faceforward template GLM_FUNC_QUALIFIER genType faceforward ( genType const & N, genType const & I, genType const & Nref ) { return dot(Nref, I) < 0 ? N : -N; } // reflect template genType reflect ( genType const & I, genType const & N ) { return I - N * dot(N, I) * float(2); } // refract template GLM_FUNC_QUALIFIER genType refract ( genType const & I, genType const & N, typename genType::value_type const & eta ) { //It could be a vector //GLM_STATIC_ASSERT(detail::type::is_float); typename genType::value_type dotValue = dot(N, I); typename genType::value_type k = typename genType::value_type(1) - eta * eta * (typename genType::value_type(1) - dotValue * dotValue); if(k < typename genType::value_type(0)) return genType(0); else return eta * I - (eta * dotValue + sqrt(k)) * N; } }//namespace geometric }//namespace function }//namespace core }//namespace glm libavg-1.8.2/src/glm/core/func_integer.hpp000066400000000000000000000152061236127404500204550ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2010-03-17 // Updated : 2010-03-31 // Licence : This source is under MIT License // File : glm/core/func_integer.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_core_func_integer #define glm_core_func_integer namespace glm { namespace core{ namespace function{ //! Define integer functions from Section 8.8 of GLSL 4.00.8 specification. namespace integer{ /// \addtogroup core_funcs ///@{ //! Adds 32-bit unsigned integer x and y, returning the sum //! modulo pow(2, 32). The value carry is set to 0 if the sum was //! less than pow(2, 32), or to 1 otherwise. //! //! \li GLSL uaddCarry man page //! \li GLSL 4.00.08 specification, section 8.8 template genUType uaddCarry( genUType const & x, genUType const & y, genUType & carry); //! Subtracts the 32-bit unsigned integer y from x, returning //! the difference if non-negative, or pow(2, 32) plus the difference //! otherwise. The value borrow is set to 0 if x >= y, or to 1 otherwise. //! //! \li GLSL usubBorrow man page //! \li GLSL 4.00.08 specification, section 8.8 template genUType usubBorrow( genUType const & x, genUType const & y, genUType & borrow); //! Multiplies 32-bit integers x and y, producing a 64-bit //! result. The 32 least-significant bits are returned in lsb. //! The 32 most-significant bits are returned in msb. //! //! \li GLSL umulExtended man page //! \li GLSL 4.00.08 specification, section 8.8 template void umulExtended( genUType const & x, genUType const & y, genUType & msb, genUType & lsb); //! Multiplies 32-bit integers x and y, producing a 64-bit //! result. The 32 least-significant bits are returned in lsb. //! The 32 most-significant bits are returned in msb. //! //! \li GLSL imulExtended man page //! \li GLSL 4.00.08 specification, section 8.8 template void imulExtended( genIType const & x, genIType const & y, genIType & msb, genIType & lsb); //! Extracts bits [offset, offset + bits - 1] from value, //! returning them in the least significant bits of the result. //! For unsigned data types, the most significant bits of the //! result will be set to zero. For signed data types, the //! most significant bits will be set to the value of bit offset + base 1. //! //! If bits is zero, the result will be zero. The result will be //! undefined if offset or bits is negative, or if the sum of //! offset and bits is greater than the number of bits used //! to store the operand. //! //! \li GLSL bitfieldExtract man page //! \li GLSL 4.00.08 specification, section 8.8 template genIUType bitfieldExtract( genIUType const & Value, int const & Offset, int const & Bits); //! Returns the insertion the bits least-significant bits of insert into base. //! //! The result will have bits [offset, offset + bits - 1] taken //! from bits [0, bits 1] of insert, and all other bits taken //! directly from the corresponding bits of base. If bits is //! zero, the result will simply be base. The result will be //! undefined if offset or bits is negative, or if the sum of //! offset and bits is greater than the number of bits used to //! store the operand. //! //! \li GLSL bitfieldInsert man page //! \li GLSL 4.00.08 specification, section 8.8 template genIUType bitfieldInsert( genIUType const & Base, genIUType const & Insert, int const & Offset, int const & Bits); //! Returns the reversal of the bits of value. //! The bit numbered n of the result will be taken from bit (bits - 1) - n of value, //! where bits is the total number of bits used to represent value. //! //! \li GLSL bitfieldReverse man page //! \li GLSL 4.00.08 specification, section 8.8 template genIUType bitfieldReverse(genIUType const & value); //! Returns the number of bits set to 1 in the binary representation of value. //! //! \li GLSL bitCount man page //! \li GLSL 4.00.08 specification, section 8.8 template class C> typename C::signed_type bitCount(C const & Value); //! Returns the bit number of the least significant bit set to //! 1 in the binary representation of value. //! If value is zero, -1 will be returned. //! //! \li GLSL findLSB man page //! \li GLSL 4.00.08 specification, section 8.8 template class C> typename C::signed_type findLSB(C const & Value); //! Returns the bit number of the most significant bit in the binary representation of value. //! For positive integers, the result will be the bit number of the most significant bit set to 1. //! For negative integers, the result will be the bit number of the most significant //! bit set to 0. For a value of zero or negative one, -1 will be returned. //! //! \li GLSL findMSB man page //! \li GLSL 4.00.08 specification, section 8.8 template class C> typename C::signed_type findMSB(C const & Value); ///@} }//namespace integer }//namespace function }//namespace core using namespace core::function::integer; }//namespace glm #include "func_integer.inl" #endif//glm_core_func_integer libavg-1.8.2/src/glm/core/func_integer.inl000066400000000000000000000345511236127404500204540ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2010-03-17 // Updated : 2010-03-31 // Licence : This source is under MIT License // File : glm/core/func_integer.inl /////////////////////////////////////////////////////////////////////////////////////////////////// namespace glm { namespace detail { }//namespace detail namespace core{ namespace function{ namespace integer { // uaddCarry template GLM_FUNC_QUALIFIER genUType uaddCarry ( genUType const & x, genUType const & y, genUType & Carry ) { detail::highp_uint_t Value64 = detail::highp_uint_t(x) + detail::highp_uint_t(y); genUType Result = genUType(Value64 % (detail::highp_uint_t(1) << detail::highp_uint_t(32))); Carry = (Value64 % (detail::highp_uint_t(1) << detail::highp_uint_t(32))) > 1 ? 1 : 0; return Result; } template GLM_FUNC_QUALIFIER detail::tvec2 uaddCarry ( detail::tvec2 const & x, detail::tvec2 const & y, detail::tvec2 & Carry ) { return detail::tvec2( uaddCarry(x[0], y[0], Carry[0]), uaddCarry(x[1], y[1], Carry[1])); } template GLM_FUNC_QUALIFIER detail::tvec3 uaddCarry ( detail::tvec3 const & x, detail::tvec3 const & y, detail::tvec3 & Carry ) { return detail::tvec3( uaddCarry(x[0], y[0], Carry[0]), uaddCarry(x[1], y[1], Carry[1]), uaddCarry(x[2], y[2], Carry[2])); } template GLM_FUNC_QUALIFIER detail::tvec4 uaddCarry ( detail::tvec4 const & x, detail::tvec4 const & y, detail::tvec4 & Carry ) { return detail::tvec4( uaddCarry(x[0], y[0], Carry[0]), uaddCarry(x[1], y[1], Carry[1]), uaddCarry(x[2], y[2], Carry[2]), uaddCarry(x[3], y[3], Carry[3])); } // usubBorrow template GLM_FUNC_QUALIFIER genUType usubBorrow ( genUType const & x, genUType const & y, genUType & Borrow ) { Borrow = x >= y ? 0 : 1; if(x > y) return genUType(detail::highp_int_t(x) - detail::highp_int_t(y)); else return genUType(detail::highp_int_t(1) << (detail::highp_int_t(32) + detail::highp_int_t(x) - detail::highp_int_t(y))); } template GLM_FUNC_QUALIFIER detail::tvec2 usubBorrow ( detail::tvec2 const & x, detail::tvec2 const & y, detail::tvec2 & Borrow ) { return detail::tvec2( usubBorrow(x[0], y[0], Borrow[0]), usubBorrow(x[1], y[1], Borrow[1])); } template GLM_FUNC_QUALIFIER detail::tvec3 usubBorrow ( detail::tvec3 const & x, detail::tvec3 const & y, detail::tvec3 & Borrow ) { return detail::tvec3( usubBorrow(x[0], y[0], Borrow[0]), usubBorrow(x[1], y[1], Borrow[1]), usubBorrow(x[2], y[2], Borrow[2])); } template GLM_FUNC_QUALIFIER detail::tvec4 usubBorrow ( detail::tvec4 const & x, detail::tvec4 const & y, detail::tvec4 & Borrow ) { return detail::tvec4( usubBorrow(x[0], y[0], Borrow[0]), usubBorrow(x[1], y[1], Borrow[1]), usubBorrow(x[2], y[2], Borrow[2]), usubBorrow(x[3], y[3], Borrow[3])); } // umulExtended template GLM_FUNC_QUALIFIER void umulExtended ( genUType const & x, genUType const & y, genUType & msb, genUType & lsb ) { detail::highp_uint_t ValueX64 = x; detail::highp_uint_t ValueY64 = y; detail::highp_uint_t Value64 = ValueX64 * ValueY64; msb = *(genUType*)&genUType(Value64 & ((detail::highp_uint_t(1) << detail::highp_uint_t(32)) - detail::highp_uint_t(1))); lsb = *(genUType*)&genUType(Value64 >> detail::highp_uint_t(32)); } template GLM_FUNC_QUALIFIER detail::tvec2 umulExtended ( detail::tvec2 const & x, detail::tvec2 const & y, detail::tvec2 & msb, detail::tvec2 & lsb ) { return detail::tvec2( umulExtended(x[0], y[0], msb, lsb), umulExtended(x[1], y[1], msb, lsb)); } template GLM_FUNC_QUALIFIER detail::tvec3 umulExtended ( detail::tvec3 const & x, detail::tvec3 const & y, detail::tvec3 & msb, detail::tvec3 & lsb ) { return detail::tvec3( umulExtended(x[0], y[0], msb, lsb), umulExtended(x[1], y[1], msb, lsb), umulExtended(x[2], y[2], msb, lsb)); } template GLM_FUNC_QUALIFIER detail::tvec4 umulExtended ( detail::tvec4 const & x, detail::tvec4 const & y, detail::tvec4 & msb, detail::tvec4 & lsb ) { return detail::tvec4( umulExtended(x[0], y[0], msb, lsb), umulExtended(x[1], y[1], msb, lsb), umulExtended(x[2], y[2], msb, lsb), umulExtended(x[3], y[3], msb, lsb)); } // imulExtended template GLM_FUNC_QUALIFIER void imulExtended ( genIType const & x, genIType const & y, genIType & msb, genIType & lsb ) { detail::highp_int_t ValueX64 = x; detail::highp_int_t ValueY64 = y; detail::highp_int_t Value64 = ValueX64 * ValueY64; msb = *(genIType*)&genIType(Value64 & ((detail::highp_uint_t(1) << detail::highp_uint_t(32)) - detail::highp_uint_t(1))); lsb = *(genIType*)&genIType(Value64 >> detail::highp_uint_t(32)); } template GLM_FUNC_QUALIFIER detail::tvec2 imulExtended ( detail::tvec2 const & x, detail::tvec2 const & y, detail::tvec2 & msb, detail::tvec2 & lsb ) { return detail::tvec2( imulExtended(x[0], y[0], msb, lsb), imulExtended(x[1], y[1], msb, lsb)); } template GLM_FUNC_QUALIFIER detail::tvec3 imulExtended ( detail::tvec3 const & x, detail::tvec3 const & y, detail::tvec3 & msb, detail::tvec3 & lsb ) { return detail::tvec3( imulExtended(x[0], y[0], msb, lsb), imulExtended(x[1], y[1], msb, lsb), imulExtended(x[2], y[2], msb, lsb)); } template GLM_FUNC_QUALIFIER detail::tvec4 imulExtended ( detail::tvec4 const & x, detail::tvec4 const & y, detail::tvec4 & msb, detail::tvec4 & lsb ) { return detail::tvec4( imulExtended(x[0], y[0], msb, lsb), imulExtended(x[1], y[1], msb, lsb), imulExtended(x[2], y[2], msb, lsb), imulExtended(x[3], y[3], msb, lsb)); } // bitfieldExtract template GLM_FUNC_QUALIFIER genIUType bitfieldExtract ( genIUType const & Value, int const & Offset, int const & Bits ) { int GenSize = int(sizeof(genIUType)) << int(3); assert(Offset + Bits <= GenSize); genIUType ShiftLeft = Bits ? Value << (GenSize - (Bits + Offset)) : genIUType(0); genIUType ShiftBack = ShiftLeft >> genIUType(GenSize - Bits); return ShiftBack; } template GLM_FUNC_QUALIFIER detail::tvec2 bitfieldExtract ( detail::tvec2 const & Value, int const & Offset, int const & Bits ) { return detail::tvec2( bitfieldExtract(Value[0]), bitfieldExtract(Value[1])); } template GLM_FUNC_QUALIFIER detail::tvec3 bitfieldExtract ( detail::tvec3 const & Value, int const & Offset, int const & Bits ) { return detail::tvec3( bitfieldExtract(Value[0]), bitfieldExtract(Value[1]), bitfieldExtract(Value[2])); } template GLM_FUNC_QUALIFIER detail::tvec4 bitfieldExtract ( detail::tvec4 const & Value, int const & Offset, int const & Bits ) { return detail::tvec4( bitfieldExtract(Value[0]), bitfieldExtract(Value[1]), bitfieldExtract(Value[2]), bitfieldExtract(Value[3])); } // bitfieldInsert template GLM_FUNC_QUALIFIER genIUType bitfieldInsert ( genIUType const & Base, genIUType const & Insert, int const & Offset, int const & Bits ) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldInsert' only accept integer values"); assert(Offset + Bits <= sizeof(genIUType)); if(Bits == 0) return Base; genIUType Mask = 0; for(int Bit = Offset; Bit < Offset + Bits; ++Bit) Mask |= (1 << Bit); return (Base & ~Mask) | (Insert & Mask); } template GLM_FUNC_QUALIFIER detail::tvec2 bitfieldInsert ( detail::tvec2 const & Base, detail::tvec2 const & Insert, int const & Offset, int const & Bits ) { return detail::tvec2( bitfieldInsert(Base[0], Insert[0], Offset, Bits), bitfieldInsert(Base[1], Insert[1], Offset, Bits)); } template GLM_FUNC_QUALIFIER detail::tvec3 bitfieldInsert ( detail::tvec3 const & Base, detail::tvec3 const & Insert, int const & Offset, int const & Bits ) { return detail::tvec3( bitfieldInsert(Base[0], Insert[0], Offset, Bits), bitfieldInsert(Base[1], Insert[1], Offset, Bits), bitfieldInsert(Base[2], Insert[2], Offset, Bits)); } template GLM_FUNC_QUALIFIER detail::tvec4 bitfieldInsert ( detail::tvec4 const & Base, detail::tvec4 const & Insert, int const & Offset, int const & Bits ) { return detail::tvec4( bitfieldInsert(Base[0], Insert[0], Offset, Bits), bitfieldInsert(Base[1], Insert[1], Offset, Bits), bitfieldInsert(Base[2], Insert[2], Offset, Bits), bitfieldInsert(Base[3], Insert[3], Offset, Bits)); } // bitfieldReverse template GLM_FUNC_QUALIFIER genIUType bitfieldReverse(genIUType const & Value) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitfieldReverse' only accept integer values"); genIUType Out = 0; std::size_t BitSize = sizeof(genIUType) * 8; for(std::size_t i = 0; i < BitSize; ++i) if(Value & (genIUType(1) << i)) Out |= genIUType(1) << (BitSize - 1 - i); return Out; } template GLM_FUNC_QUALIFIER detail::tvec2 bitfieldReverse ( detail::tvec2 const & value ) { return detail::tvec2( bitfieldReverse(value[0]), bitfieldReverse(value[1])); } template GLM_FUNC_QUALIFIER detail::tvec3 bitfieldReverse ( detail::tvec3 const & value ) { return detail::tvec3( bitfieldReverse(value[0]), bitfieldReverse(value[1]), bitfieldReverse(value[2])); } template GLM_FUNC_QUALIFIER detail::tvec4 bitfieldReverse ( detail::tvec4 const & value ) { return detail::tvec4( bitfieldReverse(value[0]), bitfieldReverse(value[1]), bitfieldReverse(value[2]), bitfieldReverse(value[3])); } // bitCount template GLM_FUNC_QUALIFIER int bitCount(genIUType const & Value) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'bitCount' only accept integer values"); int Count = 0; for(std::size_t i = 0; i < sizeof(genIUType) * std::size_t(8); ++i) { if(Value & (1 << i)) ++Count; } return Count; } template GLM_FUNC_QUALIFIER detail::tvec2 bitCount ( detail::tvec2 const & value ) { return detail::tvec2( bitCount(value[0]), bitCount(value[1])); } template GLM_FUNC_QUALIFIER detail::tvec3 bitCount ( detail::tvec3 const & value ) { return detail::tvec3( bitCount(value[0]), bitCount(value[1]), bitCount(value[2])); } template GLM_FUNC_QUALIFIER detail::tvec4 bitCount ( detail::tvec4 const & value ) { return detail::tvec4( bitCount(value[0]), bitCount(value[1]), bitCount(value[2]), bitCount(value[3])); } // findLSB template GLM_FUNC_QUALIFIER int findLSB ( genIUType const & Value ) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findLSB' only accept integer values"); if(Value == 0) return -1; genIUType Bit; for(Bit = genIUType(0); !(Value & (1 << Bit)); ++Bit){} return Bit; } template GLM_FUNC_QUALIFIER detail::tvec2 findLSB ( detail::tvec2 const & value ) { return detail::tvec2( findLSB(value[0]), findLSB(value[1])); } template GLM_FUNC_QUALIFIER detail::tvec3 findLSB ( detail::tvec3 const & value ) { return detail::tvec3( findLSB(value[0]), findLSB(value[1]), findLSB(value[2])); } template GLM_FUNC_QUALIFIER detail::tvec4 findLSB ( detail::tvec4 const & value ) { return detail::tvec4( findLSB(value[0]), findLSB(value[1]), findLSB(value[2]), findLSB(value[3])); } // findMSB template GLM_FUNC_QUALIFIER int findMSB ( genIUType const & Value ) { GLM_STATIC_ASSERT(std::numeric_limits::is_integer, "'findMSB' only accept integer values"); if(Value == 0) return -1; genIUType bit = genIUType(-1); for(genIUType tmp = Value; tmp; tmp >>= 1, ++bit){} return bit; } template GLM_FUNC_QUALIFIER detail::tvec2 findMSB ( detail::tvec2 const & value ) { return detail::tvec2( findMSB(value[0]), findMSB(value[1])); } template GLM_FUNC_QUALIFIER detail::tvec3 findMSB ( detail::tvec3 const & value ) { return detail::tvec3( findMSB(value[0]), findMSB(value[1]), findMSB(value[2])); } template GLM_FUNC_QUALIFIER detail::tvec4 findMSB ( detail::tvec4 const & value ) { return detail::tvec4( findMSB(value[0]), findMSB(value[1]), findMSB(value[2]), findMSB(value[3])); } }//namespace integer }//namespace function }//namespace core }//namespace glm libavg-1.8.2/src/glm/core/func_matrix.hpp000066400000000000000000000100621236127404500203170ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2008-08-03 // Updated : 2010-02-04 // Licence : This source is under MIT License // File : glm/core/func_matrix.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_core_func_matrix #define glm_core_func_matrix namespace glm { namespace core{ namespace function{ //! Define all matrix functions from Section 8.5 of GLSL 1.30.8 specification. Included in glm namespace. namespace matrix{ /// \addtogroup core_funcs ///@{ //! Multiply matrix x by matrix y component-wise, i.e., //! result[i][j] is the scalar product of x[i][j] and y[i][j]. //! //! \li GLSL matrixCompMult man page //! \li GLSL 1.30.08 specification, section 8.5 template matType matrixCompMult( matType const & x, matType const & y); //! Treats the first parameter c as a column vector //! and the second parameter r as a row vector //! and does a linear algebraic matrix multiply c * r. //! //! \li GLSL outerProduct man page //! \li GLSL 1.30.08 specification, section 8.5 template matType outerProduct( vecType const & c, vecType const & r); //! Returns the transposed matrix of x //! //! \li GLSL transpose man page //! \li GLSL 1.30.08 specification, section 8.5 template typename matType::transpose_type transpose( matType const & x); //! Return the determinant of a mat2 matrix. //! //! \li GLSL determinant man page //! \li GLSL 1.30.08 specification, section 8.5 template typename detail::tmat2x2::value_type determinant( detail::tmat2x2 const & m); //! Return the determinant of a mat3 matrix. //! //! \li GLSL determinant man page //! \li GLSL 1.30.08 specification, section 8.5 template typename detail::tmat3x3::value_type determinant( detail::tmat3x3 const & m); //! Return the determinant of a mat4 matrix. //! //! \li GLSL determinant man page //! \li GLSL 1.30.08 specification, section 8.5 template typename detail::tmat4x4::value_type determinant( detail::tmat4x4 const & m); //! Return the inverse of a mat2 matrix. //! //! \li GLSL inverse man page //! \li GLSL 1.40.07 specification, section 8.5 template detail::tmat2x2 inverse( detail::tmat2x2 const & m); //! Return the inverse of a mat3 matrix. //! //! \li GLSL inverse man page //! \li GLSL 1.40.07 specification, section 8.5 template detail::tmat3x3 inverse( detail::tmat3x3 const & m); //! Return the inverse of a mat4 matrix. //! //! \li GLSL inverse man page //! \li GLSL 1.40.07 specification, section 8.5 template detail::tmat4x4 inverse( detail::tmat4x4 const & m); ///@} }//namespace matrix }//namespace function }//namespace core using namespace core::function::matrix; }//namespace glm #include "func_matrix.inl" #endif//glm_core_func_matrix libavg-1.8.2/src/glm/core/func_matrix.inl000066400000000000000000000411551236127404500203210ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2008-03-08 // Updated : 2010-02-04 // Licence : This source is under MIT License // File : glm/core/func_matrix.inl /////////////////////////////////////////////////////////////////////////////////////////////////// namespace glm { namespace core{ namespace function{ namespace matrix{ // matrixCompMult template GLM_FUNC_QUALIFIER matType matrixCompMult ( matType const & x, matType const & y ) { GLM_STATIC_ASSERT(detail::type::is_float, "'matrixCompMult' only accept floating-point inputs"); matType result(matType::null); for(typename matType::size_type i = 0; i < matType::col_size(); ++i) result[i] = x[i] * y[i]; return result; } // outerProduct template GLM_FUNC_QUALIFIER detail::tmat2x2 outerProduct ( detail::tvec2 const & c, detail::tvec2 const & r ) { GLM_STATIC_ASSERT(detail::type::is_float, "'outerProduct' only accept floating-point inputs"); detail::tmat2x2 m(detail::tmat2x2::null); m[0][0] = c[0] * r[0]; m[0][1] = c[1] * r[0]; m[1][0] = c[0] * r[1]; m[1][1] = c[1] * r[1]; return m; } template GLM_FUNC_QUALIFIER detail::tmat3x3 outerProduct ( detail::tvec3 const & c, detail::tvec3 const & r ) { GLM_STATIC_ASSERT(detail::type::is_float, "'outerProduct' only accept floating-point inputs"); detail::tmat3x3 m(detail::tmat3x3::null); for(typename detail::tmat3x3::size_type i = 0; i < detail::tmat3x3::col_size(); ++i) m[i] = c * r[i]; return m; } template GLM_FUNC_QUALIFIER detail::tmat4x4 outerProduct ( detail::tvec4 const & c, detail::tvec4 const & r ) { GLM_STATIC_ASSERT(detail::type::is_float, "'outerProduct' only accept floating-point inputs"); detail::tmat4x4 m(detail::tmat4x4::null); for(typename detail::tmat4x4::size_type i = 0; i < detail::tmat4x4::col_size(); ++i) m[i] = c * r[i]; return m; } template GLM_FUNC_QUALIFIER detail::tmat2x3 outerProduct ( detail::tvec3 const & c, detail::tvec2 const & r ) { GLM_STATIC_ASSERT(detail::type::is_float, "'outerProduct' only accept floating-point inputs"); detail::tmat2x3 m(detail::tmat2x3::null); m[0][0] = c.x * r.x; m[0][1] = c.y * r.x; m[0][2] = c.z * r.x; m[1][0] = c.x * r.y; m[1][1] = c.y * r.y; m[1][2] = c.z * r.y; return m; } template GLM_FUNC_QUALIFIER detail::tmat3x2 outerProduct ( detail::tvec2 const & c, detail::tvec3 const & r ) { GLM_STATIC_ASSERT(detail::type::is_float, "'outerProduct' only accept floating-point inputs"); detail::tmat3x2 m(detail::tmat3x2::null); m[0][0] = c.x * r.x; m[0][1] = c.y * r.x; m[1][0] = c.x * r.y; m[1][1] = c.y * r.y; m[2][0] = c.x * r.z; m[2][1] = c.y * r.z; return m; } template GLM_FUNC_QUALIFIER detail::tmat2x4 outerProduct ( detail::tvec2 const & c, detail::tvec4 const & r ) { GLM_STATIC_ASSERT(detail::type::is_float, "'outerProduct' only accept floating-point inputs"); detail::tmat2x4 m(detail::tmat2x4::null); m[0][0] = c.x * r.x; m[0][1] = c.y * r.x; m[0][2] = c.z * r.x; m[0][3] = c.w * r.x; m[1][0] = c.x * r.y; m[1][1] = c.y * r.y; m[1][2] = c.z * r.y; m[1][3] = c.w * r.y; return m; } template GLM_FUNC_QUALIFIER detail::tmat4x2 outerProduct ( detail::tvec4 const & c, detail::tvec2 const & r ) { GLM_STATIC_ASSERT(detail::type::is_float, "'outerProduct' only accept floating-point inputs"); detail::tmat4x2 m(detail::tmat4x2::null); m[0][0] = c.x * r.x; m[0][1] = c.y * r.x; m[1][0] = c.x * r.y; m[1][1] = c.y * r.y; m[2][0] = c.x * r.z; m[2][1] = c.y * r.z; m[3][0] = c.x * r.w; m[3][1] = c.y * r.w; return m; } template GLM_FUNC_QUALIFIER detail::tmat3x4 outerProduct ( detail::tvec4 const & c, detail::tvec3 const & r ) { GLM_STATIC_ASSERT(detail::type::is_float, "'outerProduct' only accept floating-point inputs"); detail::tmat3x4 m(detail::tmat3x4::null); m[0][0] = c.x * r.x; m[0][1] = c.y * r.x; m[0][2] = c.z * r.x; m[0][3] = c.w * r.x; m[1][0] = c.x * r.y; m[1][1] = c.y * r.y; m[1][2] = c.z * r.y; m[1][3] = c.w * r.y; m[2][0] = c.x * r.z; m[2][1] = c.y * r.z; m[2][2] = c.z * r.z; m[2][3] = c.w * r.z; return m; } template GLM_FUNC_QUALIFIER detail::tmat4x3 outerProduct ( detail::tvec3 const & c, detail::tvec4 const & r ) { GLM_STATIC_ASSERT(detail::type::is_float, "'outerProduct' only accept floating-point inputs"); detail::tmat4x3 m(detail::tmat4x3::null); m[0][0] = c.x * r.x; m[0][1] = c.y * r.x; m[0][2] = c.z * r.x; m[1][0] = c.x * r.y; m[1][1] = c.y * r.y; m[1][2] = c.z * r.y; m[2][0] = c.x * r.z; m[2][1] = c.y * r.z; m[2][2] = c.z * r.z; m[3][0] = c.x * r.w; m[3][1] = c.y * r.w; m[3][2] = c.z * r.w; return m; } template GLM_FUNC_QUALIFIER detail::tmat2x2 transpose ( detail::tmat2x2 const & m ) { GLM_STATIC_ASSERT(detail::type::is_float, "'transpose' only accept floating-point inputs"); detail::tmat2x2 result(detail::tmat2x2::null); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[1][0] = m[0][1]; result[1][1] = m[1][1]; return result; } template GLM_FUNC_QUALIFIER detail::tmat3x3 transpose ( detail::tmat3x3 const & m ) { GLM_STATIC_ASSERT(detail::type::is_float, "'transpose' only accept floating-point inputs"); detail::tmat3x3 result(detail::tmat3x3::null); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[0][2] = m[2][0]; result[1][0] = m[0][1]; result[1][1] = m[1][1]; result[1][2] = m[2][1]; result[2][0] = m[0][2]; result[2][1] = m[1][2]; result[2][2] = m[2][2]; return result; } template GLM_FUNC_QUALIFIER detail::tmat4x4 transpose ( detail::tmat4x4 const & m ) { GLM_STATIC_ASSERT(detail::type::is_float, "'transpose' only accept floating-point inputs"); detail::tmat4x4 result(detail::tmat4x4::null); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[0][2] = m[2][0]; result[0][3] = m[3][0]; result[1][0] = m[0][1]; result[1][1] = m[1][1]; result[1][2] = m[2][1]; result[1][3] = m[3][1]; result[2][0] = m[0][2]; result[2][1] = m[1][2]; result[2][2] = m[2][2]; result[2][3] = m[3][2]; result[3][0] = m[0][3]; result[3][1] = m[1][3]; result[3][2] = m[2][3]; result[3][3] = m[3][3]; return result; } template GLM_FUNC_QUALIFIER detail::tmat2x3 transpose ( detail::tmat3x2 const & m ) { GLM_STATIC_ASSERT(detail::type::is_float, "'transpose' only accept floating-point inputs"); detail::tmat2x3 result(detail::tmat2x3::null); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[0][2] = m[2][0]; result[1][0] = m[0][1]; result[1][1] = m[1][1]; result[1][2] = m[2][1]; return result; } template GLM_FUNC_QUALIFIER detail::tmat3x2 transpose ( detail::tmat2x3 const & m ) { GLM_STATIC_ASSERT(detail::type::is_float, "'transpose' only accept floating-point inputs"); detail::tmat3x2 result(detail::tmat3x2::null); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[1][0] = m[0][1]; result[1][1] = m[1][1]; result[2][0] = m[0][2]; result[2][1] = m[1][2]; return result; } template GLM_FUNC_QUALIFIER detail::tmat2x4 transpose ( detail::tmat4x2 const & m ) { GLM_STATIC_ASSERT(detail::type::is_float, "'transpose' only accept floating-point inputs"); detail::tmat2x4 result(detail::tmat2x4::null); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[0][2] = m[2][0]; result[0][3] = m[3][0]; result[1][0] = m[0][1]; result[1][1] = m[1][1]; result[1][2] = m[2][1]; result[1][3] = m[3][1]; return result; } template GLM_FUNC_QUALIFIER detail::tmat4x2 transpose ( detail::tmat2x4 const & m ) { GLM_STATIC_ASSERT(detail::type::is_float, "'transpose' only accept floating-point inputs"); detail::tmat4x2 result(detail::tmat4x2::null); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[1][0] = m[0][1]; result[1][1] = m[1][1]; result[2][0] = m[0][2]; result[2][1] = m[1][2]; result[3][0] = m[0][3]; result[3][1] = m[1][3]; return result; } template GLM_FUNC_QUALIFIER detail::tmat3x4 transpose ( detail::tmat4x3 const & m ) { GLM_STATIC_ASSERT(detail::type::is_float, "'transpose' only accept floating-point inputs"); detail::tmat3x4 result(detail::tmat3x4::null); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[0][2] = m[2][0]; result[0][3] = m[3][0]; result[1][0] = m[0][1]; result[1][1] = m[1][1]; result[1][2] = m[2][1]; result[1][3] = m[3][1]; result[2][0] = m[0][2]; result[2][1] = m[1][2]; result[2][2] = m[2][2]; result[2][3] = m[3][2]; return result; } template GLM_FUNC_QUALIFIER detail::tmat4x3 transpose ( detail::tmat3x4 const & m ) { GLM_STATIC_ASSERT(detail::type::is_float, "'transpose' only accept floating-point inputs"); detail::tmat4x3 result(detail::tmat4x3::null); result[0][0] = m[0][0]; result[0][1] = m[1][0]; result[0][2] = m[2][0]; result[1][0] = m[0][1]; result[1][1] = m[1][1]; result[1][2] = m[2][1]; result[2][0] = m[0][2]; result[2][1] = m[1][2]; result[2][2] = m[2][2]; result[3][0] = m[0][3]; result[3][1] = m[1][3]; result[3][2] = m[2][3]; return result; } template GLM_FUNC_QUALIFIER typename detail::tmat2x2::value_type determinant ( detail::tmat2x2 const & m ) { GLM_STATIC_ASSERT(detail::type::is_float, "'determinant' only accept floating-point inputs"); return m[0][0] * m[1][1] - m[1][0] * m[0][1]; } template GLM_FUNC_QUALIFIER typename detail::tmat3x3::value_type determinant ( detail::tmat3x3 const & m ) { GLM_STATIC_ASSERT(detail::type::is_float, "'determinant' only accept floating-point inputs"); return + m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]); } template GLM_FUNC_QUALIFIER typename detail::tmat4x4::value_type determinant ( detail::tmat4x4 const & m ) { GLM_STATIC_ASSERT(detail::type::is_float, "'determinant' only accept floating-point inputs"); T SubFactor00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; T SubFactor01 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; T SubFactor02 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; T SubFactor03 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; T SubFactor04 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; T SubFactor05 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; detail::tvec4 DetCof( + (m[1][1] * SubFactor00 - m[1][2] * SubFactor01 + m[1][3] * SubFactor02), - (m[1][0] * SubFactor00 - m[1][2] * SubFactor03 + m[1][3] * SubFactor04), + (m[1][0] * SubFactor01 - m[1][1] * SubFactor03 + m[1][3] * SubFactor05), - (m[1][0] * SubFactor02 - m[1][1] * SubFactor04 + m[1][2] * SubFactor05)); return m[0][0] * DetCof[0] + m[0][1] * DetCof[1] + m[0][2] * DetCof[2] + m[0][3] * DetCof[3]; } template GLM_FUNC_QUALIFIER detail::tmat2x2 inverse ( detail::tmat2x2 const & m ) { GLM_STATIC_ASSERT(detail::type::is_float, "'inverse' only accept floating-point inputs"); //valType Determinant = m[0][0] * m[1][1] - m[1][0] * m[0][1]; T Determinant = determinant(m); detail::tmat2x2 Inverse( + m[1][1] / Determinant, - m[0][1] / Determinant, - m[1][0] / Determinant, + m[0][0] / Determinant); return Inverse; } template GLM_FUNC_QUALIFIER detail::tmat3x3 inverse ( detail::tmat3x3 const & m ) { GLM_STATIC_ASSERT(detail::type::is_float, "'inverse' only accept floating-point inputs"); //valType Determinant = m[0][0] * (m[1][1] * m[2][2] - m[2][1] * m[1][2]) // - m[1][0] * (m[0][1] * m[2][2] - m[2][1] * m[0][2]) // + m[2][0] * (m[0][1] * m[1][2] - m[1][1] * m[0][2]); T Determinant = determinant(m); detail::tmat3x3 Inverse(detail::tmat3x3::null); Inverse[0][0] = + (m[1][1] * m[2][2] - m[2][1] * m[1][2]); Inverse[1][0] = - (m[1][0] * m[2][2] - m[2][0] * m[1][2]); Inverse[2][0] = + (m[1][0] * m[2][1] - m[2][0] * m[1][1]); Inverse[0][1] = - (m[0][1] * m[2][2] - m[2][1] * m[0][2]); Inverse[1][1] = + (m[0][0] * m[2][2] - m[2][0] * m[0][2]); Inverse[2][1] = - (m[0][0] * m[2][1] - m[2][0] * m[0][1]); Inverse[0][2] = + (m[0][1] * m[1][2] - m[1][1] * m[0][2]); Inverse[1][2] = - (m[0][0] * m[1][2] - m[1][0] * m[0][2]); Inverse[2][2] = + (m[0][0] * m[1][1] - m[1][0] * m[0][1]); Inverse /= Determinant; return Inverse; } template GLM_FUNC_QUALIFIER detail::tmat4x4 inverse ( detail::tmat4x4 const & m ) { GLM_STATIC_ASSERT(detail::type::is_float, "'inverse' only accept floating-point inputs"); T Coef00 = m[2][2] * m[3][3] - m[3][2] * m[2][3]; T Coef02 = m[1][2] * m[3][3] - m[3][2] * m[1][3]; T Coef03 = m[1][2] * m[2][3] - m[2][2] * m[1][3]; T Coef04 = m[2][1] * m[3][3] - m[3][1] * m[2][3]; T Coef06 = m[1][1] * m[3][3] - m[3][1] * m[1][3]; T Coef07 = m[1][1] * m[2][3] - m[2][1] * m[1][3]; T Coef08 = m[2][1] * m[3][2] - m[3][1] * m[2][2]; T Coef10 = m[1][1] * m[3][2] - m[3][1] * m[1][2]; T Coef11 = m[1][1] * m[2][2] - m[2][1] * m[1][2]; T Coef12 = m[2][0] * m[3][3] - m[3][0] * m[2][3]; T Coef14 = m[1][0] * m[3][3] - m[3][0] * m[1][3]; T Coef15 = m[1][0] * m[2][3] - m[2][0] * m[1][3]; T Coef16 = m[2][0] * m[3][2] - m[3][0] * m[2][2]; T Coef18 = m[1][0] * m[3][2] - m[3][0] * m[1][2]; T Coef19 = m[1][0] * m[2][2] - m[2][0] * m[1][2]; T Coef20 = m[2][0] * m[3][1] - m[3][0] * m[2][1]; T Coef22 = m[1][0] * m[3][1] - m[3][0] * m[1][1]; T Coef23 = m[1][0] * m[2][1] - m[2][0] * m[1][1]; detail::tvec4 const SignA(+1, -1, +1, -1); detail::tvec4 const SignB(-1, +1, -1, +1); detail::tvec4 Fac0(Coef00, Coef00, Coef02, Coef03); detail::tvec4 Fac1(Coef04, Coef04, Coef06, Coef07); detail::tvec4 Fac2(Coef08, Coef08, Coef10, Coef11); detail::tvec4 Fac3(Coef12, Coef12, Coef14, Coef15); detail::tvec4 Fac4(Coef16, Coef16, Coef18, Coef19); detail::tvec4 Fac5(Coef20, Coef20, Coef22, Coef23); detail::tvec4 Vec0(m[1][0], m[0][0], m[0][0], m[0][0]); detail::tvec4 Vec1(m[1][1], m[0][1], m[0][1], m[0][1]); detail::tvec4 Vec2(m[1][2], m[0][2], m[0][2], m[0][2]); detail::tvec4 Vec3(m[1][3], m[0][3], m[0][3], m[0][3]); detail::tvec4 Inv0 = SignA * (Vec1 * Fac0 - Vec2 * Fac1 + Vec3 * Fac2); detail::tvec4 Inv1 = SignB * (Vec0 * Fac0 - Vec2 * Fac3 + Vec3 * Fac4); detail::tvec4 Inv2 = SignA * (Vec0 * Fac1 - Vec1 * Fac3 + Vec3 * Fac5); detail::tvec4 Inv3 = SignB * (Vec0 * Fac2 - Vec1 * Fac4 + Vec2 * Fac5); detail::tmat4x4 Inverse(Inv0, Inv1, Inv2, Inv3); detail::tvec4 Row0(Inverse[0][0], Inverse[1][0], Inverse[2][0], Inverse[3][0]); T Determinant = glm::dot(m[0], Row0); Inverse /= Determinant; return Inverse; } }//namespace matrix }//namespace function }//namespace core }//namespace glm libavg-1.8.2/src/glm/core/func_noise.hpp000066400000000000000000000044041236127404500201330ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2008-08-01 // Updated : 2008-09-10 // Licence : This source is under MIT License // File : glm/core/func_noise.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_core_func_noise #define glm_core_func_noise namespace glm { namespace core{ namespace function{ // Define all noise functions from Section 8.9 of GLSL 1.30.8 specification. Included in glm namespace. namespace noise{ /// \addtogroup core_funcs ///@{ //! Returns a 1D noise value based on the input value x. //! //! \li GLSL noise1 man page //! \li GLSL 1.30.08 specification, section 8.9 template typename genType::value_type noise1(genType const & x); //! Returns a 2D noise value based on the input value x. //! //! \li GLSL noise2 man page //! \li GLSL 1.30.08 specification, section 8.9 template detail::tvec2 noise2(genType const & x); //! Returns a 3D noise value based on the input value x. //! //! \li GLSL noise3 man page //! \li GLSL 1.30.08 specification, section 8.9 template detail::tvec3 noise3(genType const & x); //! Returns a 4D noise value based on the input value x. //! //! \li GLSL noise4 man page //! \li GLSL 1.30.08 specification, section 8.9 template detail::tvec4 noise4(genType const & x); ///@} }//namespace noise }//namespace function }//namespace core using namespace core::function::noise; }//namespace glm #include "func_noise.inl" #endif//glm_core_func_noise libavg-1.8.2/src/glm/core/func_noise.inl000066400000000000000000000012601236127404500201230ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2008-08-01 // Updated : 2011-04-14 // Licence : This source is under MIT License // File : glm/core/func_noise.inl /////////////////////////////////////////////////////////////////////////////////////////////////// namespace glm { namespace core{ namespace function{ namespace noise{ }//namespace noise }//namespace function }//namespace core }//namespace glm libavg-1.8.2/src/glm/core/func_packing.hpp000066400000000000000000000171131236127404500204330ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2010-03-17 // Updated : 2010-03-17 // Licence : This source is under MIT License // File : glm/core/func_packing.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_core_func_packing #define glm_core_func_packing namespace glm { namespace core{ namespace function{ //! Define packing functions from section 8.4 floating-point pack and unpack functions of GLSL 4.00.8 specification namespace packing { /// \addtogroup core_funcs ///@{ //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. //! Then, the results are packed into the returned 32-bit unsigned integer. //! //! The conversion for component c of v to fixed point is done as follows: //! packUnorm2x16: round(clamp(c, 0, +1) * 65535.0) //! //! The first component of the vector will be written to the least significant bits of the output; //! the last component will be written to the most significant bits. //! //! \li GLSL packUnorm2x16 man page //! \li GLSL 4.00.08 specification, section 8.4 detail::uint32 packUnorm2x16(detail::tvec2 const & v); //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. //! Then, the results are packed into the returned 32-bit unsigned integer. //! //! The conversion for component c of v to fixed point is done as follows: //! packUnorm4x8: round(clamp(c, 0, +1) * 255.0) //! //! The first component of the vector will be written to the least significant bits of the output; //! the last component will be written to the most significant bits. //! //! \li GLSL packUnorm4x8 man page //! \li GLSL 4.00.08 specification, section 8.4 detail::uint32 packUnorm4x8(detail::tvec4 const & v); //! First, converts each component of the normalized floating-point value v into 8- or 16-bit integer values. //! Then, the results are packed into the returned 32-bit unsigned integer. //! //! The conversion for component c of v to fixed point is done as follows: //! packSnorm4x8: round(clamp(c, -1, +1) * 127.0) //! //! The first component of the vector will be written to the least significant bits of the output; //! the last component will be written to the most significant bits. //! //! \li GLSL packSnorm4x8 man page //! \li GLSL 4.00.08 specification, section 8.4 detail::uint32 packSnorm4x8(detail::tvec4 const & v); //! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. //! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. //! //! The conversion for unpacked fixed-point value f to floating point is done as follows: //! unpackUnorm2x16: f / 65535.0 //! //! The first component of the returned vector will be extracted from the least significant bits of the input; //! the last component will be extracted from the most significant bits. //! //! \li GLSL unpackUnorm2x16 man page //! \li GLSL 4.00.08 specification, section 8.4 detail::tvec2 unpackUnorm2x16(detail::uint32 const & p); //! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. //! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. //! //! The conversion for unpacked fixed-point value f to floating point is done as follows: //! unpackUnorm4x8: f / 255.0 //! //! The first component of the returned vector will be extracted from the least significant bits of the input; //! the last component will be extracted from the most significant bits. //! //! \li GLSL unpackUnorm4x8 man page //! \li GLSL 4.00.08 specification, section 8.4 detail::tvec4 unpackUnorm4x8(detail::uint32 const & p); //! First, unpacks a single 32-bit unsigned integer p into a pair of 16-bit unsigned integers, four 8-bit unsigned integers, or four 8-bit signed integers. //! Then, each component is converted to a normalized floating-point value to generate the returned two- or four-component vector. //! //! The conversion for unpacked fixed-point value f to floating point is done as follows: //! unpackSnorm4x8: clamp(f / 127.0, -1, +1) //! //! The first component of the returned vector will be extracted from the least significant bits of the input; //! the last component will be extracted from the most significant bits. //! //! \li GLSL unpackSnorm4x8 man page //! \li GLSL 4.00.08 specification, section 8.4 detail::tvec4 unpackSnorm4x8(detail::uint32 const & p); //! Returns a double-precision value obtained by packing the components of v into a 64-bit value. //! If an IEEE 754 Inf or NaN is created, it will not signal, and the resulting floating point value is unspecified. //! Otherwise, the bit- level representation of v is preserved. //! The first vector component specifies the 32 least significant bits; //! the second component specifies the 32 most significant bits. //! //! \li GLSL packDouble2x32 man page //! \li GLSL 4.00.08 specification, section 8.4 double packDouble2x32(detail::tvec2 const & v); //! Returns a two-component unsigned integer vector representation of v. //! The bit-level representation of v is preserved. //! The first component of the vector contains the 32 least significant bits of the double; //! the second component consists the 32 most significant bits. //! //! \li GLSL unpackDouble2x32 man page //! \li GLSL 4.00.08 specification, section 8.4 detail::tvec2 unpackDouble2x32(double const & v); ///@} }//namespace packing }//namespace function }//namespace core using namespace core::function::packing; }//namespace glm #include "func_packing.inl" #endif//glm_core_func_packing libavg-1.8.2/src/glm/core/func_packing.inl000066400000000000000000000065611236127404500204330ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2010-03-17 // Updated : 2010-03-17 // Licence : This source is under MIT License // File : glm/core/func_packing.inl /////////////////////////////////////////////////////////////////////////////////////////////////// namespace glm { namespace detail { }//namespace detail namespace core{ namespace function{ namespace packing { GLM_FUNC_QUALIFIER detail::uint32 packUnorm2x16(detail::tvec2 const & v) { detail::uint16 A((detail::uint16)round(clamp(v.x, 0.0f, 1.0f) * 65535.0f)); detail::uint16 B((detail::uint16)round(clamp(v.y, 0.0f, 1.0f) * 65535.0f)); return detail::uint32((B << 16) | A); } GLM_FUNC_QUALIFIER detail::uint32 packUnorm4x8(detail::tvec4 const & v) { detail::uint8 A((detail::uint8)round(clamp(v.x, 0.0f, 1.0f) * 255.0f)); detail::uint8 B((detail::uint8)round(clamp(v.y, 0.0f, 1.0f) * 255.0f)); detail::uint8 C((detail::uint8)round(clamp(v.z, 0.0f, 1.0f) * 255.0f)); detail::uint8 D((detail::uint8)round(clamp(v.w, 0.0f, 1.0f) * 255.0f)); return detail::uint32((D << 24) | (C << 16) | (B << 8) | A); } GLM_FUNC_QUALIFIER detail::uint32 packSnorm4x8(detail::tvec4 const & v) { detail::uint8 A((detail::uint8)round(clamp(v.x,-1.0f, 1.0f) * 255.0f)); detail::uint8 B((detail::uint8)round(clamp(v.y,-1.0f, 1.0f) * 255.0f)); detail::uint8 C((detail::uint8)round(clamp(v.z,-1.0f, 1.0f) * 255.0f)); detail::uint8 D((detail::uint8)round(clamp(v.w,-1.0f, 1.0f) * 255.0f)); return detail::uint32((D << 24) | (C << 16) | (B << 8) | A); } GLM_FUNC_QUALIFIER detail::tvec2 unpackUnorm2x16(detail::uint32 const & p) { detail::uint16 A(detail::uint16(p >> 0)); detail::uint16 B(detail::uint16(p >> 16)); return detail::tvec2( A * 1.0f / 65535.0f, B * 1.0f / 65535.0f); } GLM_FUNC_QUALIFIER detail::tvec4 unpackUnorm4x8(detail::uint32 const & p) { detail::uint8 A(detail::uint8(p >> 0)); detail::uint8 B(detail::uint8(p >> 8)); detail::uint8 C(detail::uint8(p >> 16)); detail::uint8 D(detail::uint8(p >> 24)); return detail::tvec4( A * 1.0f / 255.0f, B * 1.0f / 255.0f, C * 1.0f / 255.0f, D * 1.0f / 255.0f); } GLM_FUNC_QUALIFIER detail::tvec4 unpackSnorm4x8(detail::uint32 const & p) { detail::uint8 A(detail::uint8(p >> 0)); detail::uint8 B(detail::uint8(p >> 8)); detail::uint8 C(detail::uint8(p >> 16)); detail::uint8 D(detail::uint8(p >> 24)); return clamp(detail::tvec4( A * 1.0f / 127.0f, B * 1.0f / 127.0f, C * 1.0f / 127.0f, D * 1.0f / 127.0f), -1.0f, 1.0f); } GLM_FUNC_QUALIFIER double packDouble2x32(detail::tvec2 const & v) { return *(double*)&v; } GLM_FUNC_QUALIFIER detail::tvec2 unpackDouble2x32(double const & v) { return *(detail::tvec2*)&v; } }//namespace packing }//namespace function }//namespace core }//namespace glm libavg-1.8.2/src/glm/core/func_trigonometric.hpp000066400000000000000000000141451236127404500217060ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2008-08-01 // Updated : 2008-09-10 // Licence : This source is under MIT License // File : glm/core/func_trigonometric.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_core_func_trigonometric #define glm_core_func_trigonometric namespace glm { namespace core{ namespace function{ //! Define Angle and trigonometry functions //! from Section 8.1 of GLSL 1.30.8 specification. //! Included in glm namespace. namespace trigonometric{ /// \addtogroup core_funcs ///@{ //! Converts degrees to radians and returns the result. //! //! \li GLSL radians man page //! \li GLSL 1.30.08 specification, section 8.1 template genType radians(genType const & degrees); //! Converts radians to degrees and returns the result. //! //! \li GLSL degrees man page //! \li GLSL 1.30.08 specification, section 8.1 template genType degrees(genType const & radians); //! The standard trigonometric sine function. //! The values returned by this function will range from [-1, 1]. //! //! \li GLSL sin man page //! \li GLSL 1.30.08 specification, section 8.1 template genType sin(genType const & angle); //! The standard trigonometric cosine function. //! The values returned by this function will range from [-1, 1]. //! //! \li GLSL cos man page //! \li GLSL 1.30.08 specification, section 8.1 template genType cos(genType const & angle); //! The standard trigonometric tangent function. //! //! \li GLSL tan man page //! \li GLSL 1.30.08 specification, section 8.1 template genType tan(genType const & angle); //! Arc sine. Returns an angle whose sine is x. //! The range of values returned by this function is [-PI/2, PI/2]. //! Results are undefined if |x| > 1. //! //! \li GLSL asin man page //! \li GLSL 1.30.08 specification, section 8.1 template genType asin(genType const & x); //! Arc cosine. Returns an angle whose sine is x. //! The range of values returned by this function is [0, PI]. //! Results are undefined if |x| > 1. //! //! \li GLSL acos man page //! \li GLSL 1.30.08 specification, section 8.1 template genType acos(genType const & x); //! Arc tangent. Returns an angle whose tangent is y/x. //! The signs of x and y are used to determine what //! quadrant the angle is in. The range of values returned //! by this function is [-PI, PI]. Results are undefined //! if x and y are both 0. //! //! \li GLSL atan man page //! \li GLSL 1.30.08 specification, section 8.1 template genType atan(genType const & y, genType const & x); //! Arc tangent. Returns an angle whose tangent is y_over_x. //! The range of values returned by this function is [-PI/2, PI/2]. //! //! \li GLSL atan man page //! \li GLSL 1.30.08 specification, section 8.1 template genType atan(genType const & y_over_x); //! Returns the hyperbolic sine function, (exp(x) - exp(-x)) / 2 //! //! \li GLSL sinh man page //! \li GLSL 1.30.08 specification, section 8.1 template genType sinh(genType const & angle); //! Returns the hyperbolic cosine function, (exp(x) + exp(-x)) / 2 //! //! \li GLSL cosh man page //! \li GLSL 1.30.08 specification, section 8.1 template genType cosh(genType const & angle); //! Returns the hyperbolic tangent function, sinh(angle) / cosh(angle) //! //! \li GLSL tanh man page //! \li GLSL 1.30.08 specification, section 8.1 template genType tanh(genType const & angle); //! Arc hyperbolic sine; returns the inverse of sinh. //! //! \li GLSL asinh man page //! \li GLSL 1.30.08 specification, section 8.1 template genType asinh(genType const & x); //! Arc hyperbolic cosine; returns the non-negative inverse //! of cosh. Results are undefined if x < 1. //! //! \li GLSL acosh man page //! \li GLSL 1.30.08 specification, section 8.1 template genType acosh(genType const & x); //! Arc hyperbolic tangent; returns the inverse of tanh. //! Results are undefined if abs(x) >= 1. //! //! \li GLSL atanh man page //! \li GLSL 1.30.08 specification, section 8.1 template genType atanh(genType const & x); ///@} }//namespace trigonometric }//namespace function }//namespace core using namespace core::function::trigonometric; }//namespace glm #include "func_trigonometric.inl" #endif//glm_core_func_trigonometric libavg-1.8.2/src/glm/core/func_trigonometric.inl000066400000000000000000000375421236127404500217070ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2008-08-03 // Updated : 2008-09-14 // Licence : This source is under MIT License // File : glm/core/func_trigonometric.inl /////////////////////////////////////////////////////////////////////////////////////////////////// namespace glm { namespace core{ namespace function{ namespace trigonometric{ // radians template GLM_FUNC_QUALIFIER genType radians ( genType const & degrees ) { GLM_STATIC_ASSERT(detail::type::is_float, "'radians' only accept floating-point input"); const genType pi = genType(3.1415926535897932384626433832795); return degrees * (pi / genType(180)); } template GLM_FUNC_QUALIFIER detail::tvec2 radians ( detail::tvec2 const & degrees ) { return detail::tvec2( radians(degrees.x), radians(degrees.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 radians ( detail::tvec3 const & degrees ) { return detail::tvec3( radians(degrees.x), radians(degrees.y), radians(degrees.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 radians ( detail::tvec4 const & degrees ) { return detail::tvec4( radians(degrees.x), radians(degrees.y), radians(degrees.z), radians(degrees.w)); } // degrees template GLM_FUNC_QUALIFIER genType degrees ( genType const & radians ) { GLM_STATIC_ASSERT(detail::type::is_float, "'degrees' only accept floating-point input"); const genType pi = genType(3.1415926535897932384626433832795); return radians * (genType(180) / pi); } template GLM_FUNC_QUALIFIER detail::tvec2 degrees ( detail::tvec2 const & radians ) { return detail::tvec2( degrees(radians.x), degrees(radians.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 degrees ( detail::tvec3 const & radians ) { return detail::tvec3( degrees(radians.x), degrees(radians.y), degrees(radians.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 degrees ( detail::tvec4 const & radians ) { return detail::tvec4( degrees(radians.x), degrees(radians.y), degrees(radians.z), degrees(radians.w)); } // sin template GLM_FUNC_QUALIFIER genType sin ( genType const & angle ) { GLM_STATIC_ASSERT(detail::type::is_float, "'sin' only accept floating-point input"); return ::std::sin(angle); } template GLM_FUNC_QUALIFIER detail::tvec2 sin ( detail::tvec2 const & angle ) { return detail::tvec2( sin(angle.x), sin(angle.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 sin ( detail::tvec3 const & angle ) { return detail::tvec3( sin(angle.x), sin(angle.y), sin(angle.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 sin ( detail::tvec4 const & angle ) { return detail::tvec4( sin(angle.x), sin(angle.y), sin(angle.z), sin(angle.w)); } // cos template GLM_FUNC_QUALIFIER genType cos(genType const & angle) { GLM_STATIC_ASSERT(detail::type::is_float, "'cos' only accept floating-point input"); return ::std::cos(angle); } template GLM_FUNC_QUALIFIER detail::tvec2 cos ( detail::tvec2 const & angle ) { return detail::tvec2( cos(angle.x), cos(angle.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 cos ( detail::tvec3 const & angle ) { return detail::tvec3( cos(angle.x), cos(angle.y), cos(angle.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 cos ( detail::tvec4 const & angle ) { return detail::tvec4( cos(angle.x), cos(angle.y), cos(angle.z), cos(angle.w)); } // tan template GLM_FUNC_QUALIFIER genType tan ( genType const & angle ) { GLM_STATIC_ASSERT(detail::type::is_float, "'tan' only accept floating-point input"); return ::std::tan(angle); } template GLM_FUNC_QUALIFIER detail::tvec2 tan ( detail::tvec2 const & angle ) { return detail::tvec2( tan(angle.x), tan(angle.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 tan ( detail::tvec3 const & angle ) { return detail::tvec3( tan(angle.x), tan(angle.y), tan(angle.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 tan ( detail::tvec4 const & angle ) { return detail::tvec4( tan(angle.x), tan(angle.y), tan(angle.z), tan(angle.w)); } // asin template GLM_FUNC_QUALIFIER genType asin ( genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'asin' only accept floating-point input"); return ::std::asin(x); } template GLM_FUNC_QUALIFIER detail::tvec2 asin ( detail::tvec2 const & x ) { return detail::tvec2( asin(x.x), asin(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 asin ( detail::tvec3 const & x ) { return detail::tvec3( asin(x.x), asin(x.y), asin(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 asin ( detail::tvec4 const & x ) { return detail::tvec4( asin(x.x), asin(x.y), asin(x.z), asin(x.w)); } // acos template GLM_FUNC_QUALIFIER genType acos ( genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'acos' only accept floating-point input"); return ::std::acos(x); } template GLM_FUNC_QUALIFIER detail::tvec2 acos ( detail::tvec2 const & x ) { return detail::tvec2( acos(x.x), acos(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 acos ( detail::tvec3 const & x ) { return detail::tvec3( acos(x.x), acos(x.y), acos(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 acos ( detail::tvec4 const & x ) { return detail::tvec4( acos(x.x), acos(x.y), acos(x.z), acos(x.w)); } // atan template GLM_FUNC_QUALIFIER genType atan ( genType const & y, genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'atan' only accept floating-point input"); return ::std::atan2(y, x); } template GLM_FUNC_QUALIFIER detail::tvec2 atan ( detail::tvec2 const & y, detail::tvec2 const & x ) { return detail::tvec2( atan(y.x, x.x), atan(y.y, x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 atan ( detail::tvec3 const & y, detail::tvec3 const & x ) { return detail::tvec3( atan(y.x, x.x), atan(y.y, x.y), atan(y.z, x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 atan ( detail::tvec4 const & y, detail::tvec4 const & x ) { return detail::tvec4( atan(y.x, x.x), atan(y.y, x.y), atan(y.z, x.z), atan(y.w, x.w)); } template GLM_FUNC_QUALIFIER genType atan ( genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'atan' only accept floating-point input"); return ::std::atan(x); } template GLM_FUNC_QUALIFIER detail::tvec2 atan ( detail::tvec2 const & x ) { return detail::tvec2( atan(x.x), atan(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 atan ( detail::tvec3 const & x ) { return detail::tvec3( atan(x.x), atan(x.y), atan(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 atan ( detail::tvec4 const & x ) { return detail::tvec4( atan(x.x), atan(x.y), atan(x.z), atan(x.w)); } // sinh template GLM_FUNC_QUALIFIER genType sinh ( genType const & angle ) { GLM_STATIC_ASSERT(detail::type::is_float, "'sinh' only accept floating-point input"); return std::sinh(angle); } template GLM_FUNC_QUALIFIER detail::tvec2 sinh ( detail::tvec2 const & angle ) { return detail::tvec2( sinh(angle.x), sinh(angle.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 sinh ( detail::tvec3 const & angle ) { return detail::tvec3( sinh(angle.x), sinh(angle.y), sinh(angle.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 sinh ( detail::tvec4 const & angle ) { return detail::tvec4( sinh(angle.x), sinh(angle.y), sinh(angle.z), sinh(angle.w)); } // cosh template GLM_FUNC_QUALIFIER genType cosh ( genType const & angle ) { GLM_STATIC_ASSERT(detail::type::is_float, "'cosh' only accept floating-point input"); return std::cosh(angle); } template GLM_FUNC_QUALIFIER detail::tvec2 cosh ( detail::tvec2 const & angle ) { return detail::tvec2( cosh(angle.x), cosh(angle.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 cosh ( detail::tvec3 const & angle ) { return detail::tvec3( cosh(angle.x), cosh(angle.y), cosh(angle.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 cosh ( detail::tvec4 const & angle ) { return detail::tvec4( cosh(angle.x), cosh(angle.y), cosh(angle.z), cosh(angle.w)); } // tanh template GLM_FUNC_QUALIFIER genType tanh ( genType const & angle ) { GLM_STATIC_ASSERT(detail::type::is_float, "'tanh' only accept floating-point input"); return std::tanh(angle); } template GLM_FUNC_QUALIFIER detail::tvec2 tanh ( detail::tvec2 const & angle ) { return detail::tvec2( tanh(angle.x), tanh(angle.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 tanh ( detail::tvec3 const & angle ) { return detail::tvec3( tanh(angle.x), tanh(angle.y), tanh(angle.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 tanh ( detail::tvec4 const & angle ) { return detail::tvec4( tanh(angle.x), tanh(angle.y), tanh(angle.z), tanh(angle.w)); } // asinh template GLM_FUNC_QUALIFIER genType asinh ( genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'asinh' only accept floating-point input"); return (x < genType(0) ? genType(-1) : (x > genType(0) ? genType(1) : genType(0))) * log(abs(x) + sqrt(genType(1) + x * x)); } template GLM_FUNC_QUALIFIER detail::tvec2 asinh ( detail::tvec2 const & x ) { return detail::tvec2( asinh(x.x), asinh(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 asinh ( detail::tvec3 const & x ) { return detail::tvec3( asinh(x.x), asinh(x.y), asinh(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 asinh ( detail::tvec4 const & x ) { return detail::tvec4( asinh(x.x), asinh(x.y), asinh(x.z), asinh(x.w)); } // acosh template GLM_FUNC_QUALIFIER genType acosh ( genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'acosh' only accept floating-point input"); if(x < genType(1)) return genType(0); return log(x + sqrt(x * x - genType(1))); } template GLM_FUNC_QUALIFIER detail::tvec2 acosh ( detail::tvec2 const & x ) { return detail::tvec2( acosh(x.x), acosh(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 acosh ( detail::tvec3 const & x ) { return detail::tvec3( acosh(x.x), acosh(x.y), acosh(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 acosh ( detail::tvec4 const & x ) { return detail::tvec4( acosh(x.x), acosh(x.y), acosh(x.z), acosh(x.w)); } // atanh template GLM_FUNC_QUALIFIER genType atanh ( genType const & x ) { GLM_STATIC_ASSERT(detail::type::is_float, "'atanh' only accept floating-point input"); if(abs(x) >= genType(1)) return 0; return genType(0.5) * log((genType(1) + x) / (genType(1) - x)); } template GLM_FUNC_QUALIFIER detail::tvec2 atanh ( detail::tvec2 const & x ) { return detail::tvec2( atanh(x.x), atanh(x.y)); } template GLM_FUNC_QUALIFIER detail::tvec3 atanh ( detail::tvec3 const & x ) { return detail::tvec3( atanh(x.x), atanh(x.y), atanh(x.z)); } template GLM_FUNC_QUALIFIER detail::tvec4 atanh ( detail::tvec4 const & x ) { return detail::tvec4( atanh(x.x), atanh(x.y), atanh(x.z), atanh(x.w)); } }//namespace trigonometric }//namespace function }//namespace core }//namespace glm libavg-1.8.2/src/glm/core/func_vector_relational.hpp000066400000000000000000000211141236127404500225270ustar00rootroot00000000000000/////////////////////////////////////////////////////////////////////////////////////////////////// // OpenGL Mathematics Copyright (c) 2005 - 2011 G-Truc Creation (www.g-truc.net) /////////////////////////////////////////////////////////////////////////////////////////////////// // Created : 2008-08-03 // Updated : 2008-09-09 // Licence : This source is under MIT License // File : glm/core/func_vector_relational.hpp /////////////////////////////////////////////////////////////////////////////////////////////////// #ifndef glm_core_func_vector_relational #define glm_core_func_vector_relational #include "_detail.hpp" namespace glm { namespace core{ namespace function{ //! Define vector relational functions from Section 8.6 of GLSL 1.30.8 specification. //! Included in glm namespace. namespace vector_relational { /// \addtogroup core_funcs ///@{ //! Returns the component-wise comparison result of x < y. //! //! \li GLSL lessThan man page //! \li GLSL 1.30.08 specification, section 8.6 template class vecType> GLM_FUNC_QUALIFIER typename vecType::bool_type lessThan ( vecType const & x, vecType const & y ) { GLM_STATIC_ASSERT(detail::is_vector >::_YES, "Invalid template instantiation of 'lessThan', GLM vector types required"); GLM_STATIC_ASSERT(detail::is_bool::_NO, "Invalid template instantiation of 'lessThan', GLM vector types required floating-point or integer value types vectors"); typename vecType::bool_type Result(vecType::null); for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) Result[i] = x[i] < y[i]; return Result; } //! Returns the component-wise comparison of result x <= y. //! //! \li GLSL lessThanEqual man page //! \li GLSL 1.30.08 specification, section 8.6 template class vecType> GLM_FUNC_QUALIFIER typename vecType::bool_type lessThanEqual ( vecType const & x, vecType const & y ) { GLM_STATIC_ASSERT(detail::is_vector >::_YES, "Invalid template instantiation of 'lessThanEqual', GLM vector types required"); GLM_STATIC_ASSERT(detail::is_bool::_NO, "Invalid template instantiation of 'lessThanEqual', GLM vector types required floating-point or integer value types vectors"); typename vecType::bool_type Result(vecType::null); for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) Result[i] = x[i] <= y[i]; return Result; } //! Returns the component-wise comparison of result x > y. //! //! \li GLSL greaterThan man page //! \li GLSL 1.30.08 specification, section 8.6 template class vecType> GLM_FUNC_QUALIFIER typename vecType::bool_type greaterThan ( vecType const & x, vecType const & y ) { GLM_STATIC_ASSERT(detail::is_vector >::_YES, "Invalid template instantiation of 'greaterThan', GLM vector types required"); GLM_STATIC_ASSERT(detail::is_bool::_NO, "Invalid template instantiation of 'greaterThan', GLM vector types required floating-point or integer value types vectors"); typename vecType::bool_type Result(vecType::null); for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) Result[i] = x[i] > y[i]; return Result; } //! Returns the component-wise comparison of result x >= y. //! //! \li GLSL greaterThanEqual man page //! \li GLSL 1.30.08 specification, section 8.6 template class vecType> GLM_FUNC_QUALIFIER typename vecType::bool_type greaterThanEqual ( vecType const & x, vecType const & y ) { GLM_STATIC_ASSERT(detail::is_vector >::_YES, "Invalid template instantiation of 'greaterThanEqual', GLM vector types required"); GLM_STATIC_ASSERT(detail::is_bool::_NO, "Invalid template instantiation of 'greaterThanEqual', GLM vector types required floating-point or integer value types vectors"); typename vecType::bool_type Result(vecType::null); for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) Result[i] = x[i] >= y[i]; return Result; } //! Returns the component-wise comparison of result x == y. //! //! \li GLSL equal man page //! \li GLSL 1.30.08 specification, section 8.6 template class vecType> GLM_FUNC_QUALIFIER typename vecType::bool_type equal ( vecType const & x, vecType const & y ) { GLM_STATIC_ASSERT(detail::is_vector >::_YES, "Invalid template instantiation of 'equal', GLM vector types required"); typename vecType::bool_type Result(vecType::null); for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) Result[i] = x[i] == y[i]; return Result; } //! Returns the component-wise comparison of result x != y. //! //! \li GLSL notEqual man page //! \li GLSL 1.30.08 specification, section 8.6 template class vecType> GLM_FUNC_QUALIFIER typename vecType::bool_type notEqual ( vecType const & x, vecType const & y ) { GLM_STATIC_ASSERT(detail::is_vector >::_YES, "Invalid template instantiation of 'notEqual', GLM vector types required"); typename vecType::bool_type Result(vecType::null); for(typename vecType::size_type i = 0; i < vecType::value_size(); ++i) Result[i] = x[i] != y[i]; return Result; } //! Returns true if any component of x is true. //! //! \li GLSL any man page //! \li GLSL 1.30.08 specification, section 8.6 template